From: Junio C Hamano <hidden> Date: 2016-06-15 22:49:08
Junio C Hamano [off-list ref] writes:
Jonathan Nieder [off-list ref] writes:
quoted
Patch is against master. There is a small semantic conflict with
jn/grep-open: SIMPLEPAGER should be changed to SIMPLEPAGERTTY in the
prerequisites for the test_default_pager function. Please let me
know if I should push a merge commit to help resolve that.
Thanks for advance warning; please double check the merge result in 'pu'
when I push it out...
I hate an enumeration that pretends to be exhausitive but is not.
So delay the pager startup when possible:
1. run_argv() already commits pager choice inside run_builtin() if a
command is found. For commands that use RUN_SETUP, waiting until
then fixes the problem described above: once git knows where to
look, it happily respects the core.pager setting.
... and for commands that do not use RUN_SETUP, what happens?
2. list_common_cmds_help() prints out 29 lines and exits....
3. help_unknown_cmd() prints out a few lines to stderr. It is not
important to paginate this, so don’t.
Missing from the above enumeration are are external commands. They depend
on commit_pager_choice() to be called before execv_dashed_external() gets
called. For example, "git -p request-pull $args" no longer works with
this patch.
Sigh..
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:08
Junio C Hamano wrote:
... and for commands that do not use RUN_SETUP, what happens?
run_builtin() still commits pager choice. The bug is neither
fixed nor made worse for them.
Missing from the above enumeration are are external commands. They depend
on commit_pager_choice() to be called before execv_dashed_external() gets
called. For example, "git -p request-pull $args" no longer works with
this patch.
Something like the following may help.
This does not protect against calling setup_pager() more than
once. Once the first pager has been set up, isatty(1) is false,
preventing additional pagers from being spawned and competing with it.
As futureproofing against --paginate=always, setup_pager() should
probably be taught to check pager_in_use(), but that should
probably wait for a separate patch.
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:08
73e25e7c (git --paginate: do not commit pager choice too early,
2010-06-26) failed to take some cases into account.
1b. Builtins that do not use RUN_SETUP (like git config) do
not find GIT_DIR set correctly when the pager is launched
from run_builtin(). So the core.pager configuration is
not honored from subdirectories of the toplevel for them.
4a. External git commands (like git request-pull) relied on the
early pager launch to take care of handling the -p option.
Ever since 73e25e7c, they do not honor the -p option at all.
4b. Commands invoked through ! aliases (like ls) were also relying
on the early pager launch.
Fix (4a) by launching the pager (if requested) before running such a
“dashed external”. For simplicity, this still does not search for a
.git directory before running the external command; when run from a
subdirectory of the toplevel, therefore, the “[core] pager”
configuration is still not honored.
Fix (4b) by launching pager if requested before carrying out such an
alias. Actually doing this has no effect, since the pager (if any)
would have already been launched in a failed attempt to try a
dashed external first. The choice-of-pager-not-honored-from-
subdirectory bug still applies here, too.
(1b) is not a regression. There is no need to fix it yet.
Noticed by Junio.
Signed-off-by: Jonathan Nieder <redacted>
---
Junio C Hamano wrote:
I hate an enumeration that pretends to be exhausitive but is not.
Sorry about that.
Here’s a patch that could be squashed in or applied on top.
git.c | 3 +++
t/t7006-pager.sh | 47 +++++++++++++++++++++++++++++++++++------------
2 files changed, 38 insertions(+), 12 deletions(-)
Missing from the above enumeration are are external commands. They depend
on commit_pager_choice() to be called before execv_dashed_external() gets
called. For example, "git -p request-pull $args" no longer works with
this patch.
Sigh..
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:15
Junio C Hamano wrote:
So delay the pager startup when possible:
1. run_argv() already commits pager choice inside run_builtin() if a
command is found. For commands that use RUN_SETUP, waiting until
then fixes the problem described above: once git knows where to
look, it happily respects the core.pager setting.
... and for commands that do not use RUN_SETUP, what happens?
Let’s help some of them out a little.
These patches teach a few more built-ins to do something like
RUN_SETUP; more precisely, a RUN_SETUP_GENTLY facility is introduced
to run setup_git_directory_gently() early just like NEEDS_PREFIX has
always caused setup_git_directory() to be run early.
This series wouldn’t be possible without Duy’s recent efforts to roll
out other fixes from the famous nd/setup topic --- thanks!
The patches should be familiar[1] and I think they are better
justified now.
The first 8 patches apply on top to jn/paginate-fix from pu. Between
patch 8 and 9 I have a merge of jn/maint-setup-fix^, with the
following explanation:
Merge branch 'jn/maint-setup-fix' (early part) into jn/paginate-fix
That topic includes a fix for “git index-pack” (which used
to save the cwd before the repository search to work around
a bug) which is needed before the repository search can be
safely run earlier.
That merge involves a trivial conflict between adding the
RUN_SETUP_GENTLY flag for this topic and removing USE_PAGER for
grep -O. The conflict is only nominal --- the two changes do not
interfere with each other.
One final note: this series is deliberately very conservative, in that
it does not touch commands like diff (which has a --no-index mode
suppressing the repository search). Such commands are neither
helped nor hindered by this series, and I think that during this
transition time we should be opportunistic rather than rigid: the rule
is to run the repository search as soon as can be easily justified but
no sooner.
Thoughts welcome, as always.
Nguyễn Thái Ngọc Duy (12):
git wrapper: introduce startup_info struct
setup: remember whether repository was found
git wrapper: allow setup_git_directory_gently() be called earlier
shortlog: run setup_git_directory_gently() sooner
grep: run setup_git_directory_gently() sooner
apply: run setup_git_directory_gently() sooner
bundle: run setup_git_directory_gently() sooner
config: run setup_git_directory_gently() sooner
index-pack: run setup_git_directory_gently() sooner
ls-remote: run setup_git_directory_gently() sooner
var: run setup_git_directory_gently() sooner
merge-file: run setup_git_directory_gently() sooner
[1] http://thread.gmane.org/gmane.comp.version-control.git/144000/focus=144110
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:15
From: Nguyễn Thái Ngọc Duy <redacted>
The startup_info struct will collect information managed by the git
setup code, such as the prefix for relative paths passed on the
command line (i.e., path to the starting cwd from the toplevel of
the work tree) and whether a git repository has been found.
In other words, startup_info is intended to be a collection of global
variables with results that were previously returned from setup
functions. This state is global anyway (since the cwd is), even
if it is not currently tracked that way. Letting these values persist
means there is more flexibility in deciding when to run setup.
For now, the struct is empty.
Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
Signed-off-by: Jonathan Nieder <redacted>
---
Changes from last round:
- commit message
- remove unnecessary memset (since statics are already automatically
zero-initialized)
cache.h | 5 +++++
environment.c | 1 +
git.c | 3 +++
3 files changed, 9 insertions(+), 0 deletions(-)
@@ -53,6 +53,7 @@ enum object_creation_mode object_creation_mode = OBJECT_CREATION_MODE;char*notes_ref_name;intgrafts_replace_parents=1;intcore_apply_sparse_checkout;+structstartup_info*startup_info;/* Parallel index stat data preload? */intcore_preload_index=0;
@@ -14,6 +14,7 @@ const char git_usage_string[] =constchargit_more_info_string[]="See 'git help COMMAND' for more information on a specific command.";+staticstructstartup_infogit_startup_info;staticintuse_pager=-1;structpager_config{constchar*cmd;
@@ -489,6 +490,8 @@ int main(int argc, const char **argv){constchar*cmd;+startup_info=&git_startup_info;+cmd=git_extract_argv0_path(argv[0]);if(!cmd)cmd="git-help";
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:15
From: Nguyễn Thái Ngọc Duy <redacted>
As v1.7.2~16^2 (git --paginate: paginate external commands
again, 2010-07-14) explains, builtins (like git config) that
do not use RUN_SETUP are not finding GIT_DIR set correctly when
it is time to launch the pager from run_builtin(). If they
were to search for a repository sooner, then the outcome of such
early repository accesses would be more predictable and reliable.
The cmd_*() functions learn whether a repository was found through the
*nongit_ok return value from setup_git_directory_gently(). If
run_builtin() is to take care of the repository search itself, that
datum needs to be retrievable from somewhere else. Use the
startup_info struct for this.
As a bonus, this information becomes available to functions such as
git_config() which might want to avoid trying to access a repository
when none is present.
Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
Signed-off-by: Jonathan Nieder <redacted>
---
Tweaked the log message a bit.
cache.h | 1 +
setup.c | 12 +++++++++++-
2 files changed, 12 insertions(+), 1 deletions(-)
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:15
From: Nguyễn Thái Ngọc Duy <redacted>
In the spirit of v1.4.2-rc3~34^2^2 (Call setup_git_directory() much
earlier, 2006-07-28), let run_builtin() take care of searching for a
repository for built-ins that want to make use of one if present.
So now you can mark your command with RUN_SETUP_GENTLY and use
nongit = !startup_info->have_repository;
in place of
prefix = setup_git_directory_gently(&nongit);
and everything will be the same, except the repository is
discovered a little sooner.
As v1.7.2~16^2 (2010-07-14) explains, this should allow more commands
to robustly use features like "git --paginate" that look at local
configuration before the command is actually run.
This patch sets up the infrastructure. Later patches will teach
particular commands to use it.
Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
Signed-off-by: Jonathan Nieder <redacted>
---
- reordered setup option bits (RUN_SETUP_GENTLY lives next to RUN_SETUP now)
- squashed in "builtin: check pager.<cmd> configuration if
RUN_SETUP_GENTLY is used"
git.c | 13 +++++++++----
1 files changed, 9 insertions(+), 4 deletions(-)
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:15
From: Nguyễn Thái Ngọc Duy <redacted>
shortlog already runs a repository search unconditionally;
running such a search earlier is not very risky.
Without this change, the “[pager] shortlog” configuration
is not respected at all: “git shortlog” unconditionally paginates.
The tests are a bit slow. Running the full battery like this
for all built-in commands would be counterproductive; the intent is
rather to test shortlog as a representative example command using
..._gently().
Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
Signed-off-by: Jonathan Nieder <redacted>
---
Clarified commit message; simplified diff by keeping the nongit
variable; added tests.
builtin/shortlog.c | 3 +--
git.c | 2 +-
t/t7006-pager.sh | 9 +++++++++
3 files changed, 11 insertions(+), 3 deletions(-)
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:15
From: Nguyễn Thái Ngọc Duy <redacted>
git grep already runs a repository search unconditionally,
even when the --no-index option is supplied; running such a
search earlier is not very risky.
Just like with shortlog, without this change, the
“[pager] grep” configuration is not respected at all.
Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
Signed-off-by: Jonathan Nieder <redacted>
---
Aside from rewriting the commit message and adding tests, this
drops the interesting
- /* die the same way as if we did it at the beginning */
- setup_git_directory();
+ die("No git repository found");
hunk. That change might be a good idea but it does not fit the
theme of this chapter.
builtin/grep.c | 6 ++----
git.c | 2 +-
t/t7006-pager.sh | 13 +++++++++++++
3 files changed, 16 insertions(+), 5 deletions(-)
@@ -791,7 +791,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)constchar**paths=NULL;inti;intdummy;-intnongit=0,use_index=1;+intuse_index=1;structoptionoptions[]={OPT_BOOLEAN(0,"cached",&cached,"search in index instead of in the work tree"),
@@ -925,7 +923,7 @@ int cmd_grep(int argc, const char **argv, const char *prefix)PARSE_OPT_STOP_AT_NON_OPTION|PARSE_OPT_NO_INTERNAL_HELP);-if(use_index&&nongit)+if(use_index&&!startup_info->have_repository)/* die the same way as if we did it at the beginning */setup_git_directory();
@@ -105,6 +105,19 @@ test_expect_success TTY 'no pager with --no-pager' '!test-epaginated.out'+test_expect_successTTY'configuration can disable pager''+rm-fpaginated.out&&+test_might_failgitconfig--unsetpager.grep&&+test_terminalgitgrepinitial&&+test-epaginated.out&&++rm-fpaginated.out&&+gitconfigpager.grepfalse&&+test_when_finished"git config --unset pager.grep"&&+test_terminalgitgrepinitial&&+!test-epaginated.out+'+# A colored commit log will begin with an appropriate ANSI escape# for the first color; the text "commit" comes later. colorful(){
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:15
From: Nguyễn Thái Ngọc Duy <redacted>
Without this change, “git -p bundle” does not always
respect the repository-local “[core] pager” setting.
It is hard to notice because subcommands other than
“git bundle unbundle” do not produce much output.
Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
Signed-off-by: Jonathan Nieder <redacted>
---
New tests and explanation.
The first new test perhaps deserves some explanation. Its
only purpose is to let us use the
test -e paginated.out || test -e subdir/paginated.out
hedge in other tests with good conscience.
builtin/bundle.c | 6 ++----
git.c | 2 +-
t/t7006-pager.sh | 33 +++++++++++++++++++++++++++++++++
3 files changed, 36 insertions(+), 5 deletions(-)
@@ -54,11 +52,11 @@ int cmd_bundle(int argc, const char **argv, const char *prefix)return!!list_bundle_refs(&header,argc,argv);}if(!strcmp(cmd,"create")){-if(nongit)+if(!startup_info->have_repository)die("Need a repository to create a bundle.");return!!create_bundle(&header,bundle_file,argc,argv);}elseif(!strcmp(cmd,"unbundle")){-if(nongit)+if(!startup_info->have_repository)die("Need a repository to unbundle.");return!!unbundle(&header,bundle_fd)||list_bundle_refs(&header,argc,argv);
@@ -57,6 +57,21 @@ test_expect_success TTY 'some commands use a pager' 'test-epaginated.out'+test_expect_failureTTY'pager runs from subdir''+echosubdir/paginated.out>expected&&+mkdir-psubdir&&+rm-fpaginated.outsubdir/paginated.out&&+(+cdsubdir&&+test_terminalgitlog+)&&+{+lspaginated.outsubdir/paginated.out||+:+}>actual&&+test_cmpexpectedactual+'+ test_expect_successTTY'some commands do not use a pager''rm-fpaginated.out||cleanup_fail&&
@@ -118,6 +133,24 @@ test_expect_success TTY 'configuration can disable pager' '!test-epaginated.out'+test_expect_success'configuration can enable pager (from subdir)''+rm-fpaginated.out&&+mkdir-psubdir&&+gitconfigpager.bundletrue&&+test_when_finished"git config --unset pager.bundle"&&++gitbundlecreatetest.bundle--all&&+rm-fpaginated.outsubdir/paginated.out&&+(+cdsubdir&&+test_terminalgitbundleunbundle../test.bundle+)&&+{+test-epaginated.out||+test-esubdir/paginated.out+}+'+# A colored commit log will begin with an appropriate ANSI escape# for the first color; the text "commit" comes later. colorful(){
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:15
From: Nguyễn Thái Ngọc Duy <redacted>
For the pager choice (and the choice to paginate) to reflect the
current repository configuration, the repository needs to be
located first.
Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
Signed-off-by: Jonathan Nieder <redacted>
---
Relative to the previous round, this simplifies the patch by retaining
the nongit var; squashes in a test; and adds some words of explanation
to the log message.
builtin/config.c | 5 ++---
git.c | 4 ++--
t/t7006-pager.sh | 8 ++++++++
3 files changed, 12 insertions(+), 5 deletions(-)
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:15
From: Nguyễn Thái Ngọc Duy <redacted>
index-pack already runs a repository search unconditionally; running
such a search earlier is not risky and ensures GIT_DIR will be set
correctly if the configuration needs to be accessed from
run_builtin().
Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
Signed-off-by: Jonathan Nieder <redacted>
---
Requires the jn/maint-setup-fix topic to apply. See the cover
letter "[PATCH jn/paginate-fix 0/12] Re: ..." for more on that.
Just like last round, except for the new log message.
builtin/index-pack.c | 2 --
git.c | 2 +-
2 files changed, 1 insertions(+), 3 deletions(-)
@@ -880,12 +880,10 @@ int cmd_index_pack(int argc, const char **argv, const char *prefix)char*index_name_buf=NULL,*keep_name_buf=NULL;structpack_idx_entry**idx_objects;unsignedcharpack_sha1[20];-intnongit;if(argc==2&&!strcmp(argv[1],"-h"))usage(index_pack_usage);-prefix=setup_git_directory_gently(&nongit);git_config(git_index_pack_config,NULL);if(prefix&&chdir(prefix))die("Cannot come back to cwd");
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:15
From: Nguyễn Thái Ngọc Duy <redacted>
ls-remote already runs a repository search unconditionally to learn
about remote nicknames and "[url] insteadof" shortcuts. Run that
search a little sooner, and now one can try
[pager]
ls-remote
to automatically paginate ls-remote output, or use repository-local
[core]
pager = whatever
with "git --paginate ls-remote <url>".
Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
Signed-off-by: Jonathan Nieder <redacted>
---
As before, aside from the commit message.
builtin/ls-remote.c | 3 ---
git.c | 4 ++--
2 files changed, 2 insertions(+), 5 deletions(-)
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:15
From: Nguyễn Thái Ngọc Duy <redacted>
Part of a campaign to make repository-local configuration
available early (simplifying the startup sequence for
built-in commands).
Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
Signed-off-by: Jonathan Nieder <redacted>
---
snuck in a little vertical compression while at it ;-)
builtin/var.c | 9 ++-------
git.c | 2 +-
2 files changed, 3 insertions(+), 8 deletions(-)
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:15
From: Nguyễn Thái Ngọc Duy <redacted>
Part of a campaign to make repository-local configuration
available early (simplifying the startup sequence for
built-in commands).
Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
Signed-off-by: Jonathan Nieder <redacted>
---
As before (except the commit message).
Well, that’s it. There’s also a separate fix for
"check-ref-format --branch", which I’ll send under separate
cover.
Still to be considered are various commands that currently
do not do an unconditional repository search, especially
low-level commands that are not about the current repository:
verify-pack, mailinfo, hash-object, archive --remote,
check-ref-format, diff --no-index, help, and all the others.
Let’s bite off one thing at a time. :)
Thanks for reading; I hope the patches were not too dull.
Thoughts (especially improvements) welcome, as always.
builtin/merge-file.c | 4 +---
git.c | 2 +-
2 files changed, 2 insertions(+), 4 deletions(-)
@@ -28,7 +28,6 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix)xmparam_txmp={{0}};intret=0,i=0,to_stdout=0;intquiet=0;-intnongit;structoptionoptions[]={OPT_BOOLEAN('p',"stdout",&to_stdout,"send results to standard output"),OPT_SET_INT(0,"diff3",&xmp.style,"use a diff3 based merge",XDL_MERGE_DIFF3),
@@ -50,8 +49,7 @@ int cmd_merge_file(int argc, const char **argv, const char *prefix)xmp.style=0;xmp.favor=0;-prefix=setup_git_directory_gently(&nongit);-if(!nongit){+if(startup_info->have_repository){/* Read the configuration file */git_config(git_xmerge_config,NULL);if(0<=git_xmerge_style)
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:15
Here’s a quick fix from the nd/setup series. Tested against master,
though it probably should be against maint.
Jonathan Nieder (2):
check-ref-format: split off functions for subcommands
check-ref-format --branch: run repository search
builtin/check-ref-format.c | 44 ++++++++++++++++++++++++++----------------
t/t1402-check-ref-format.sh | 17 ++++++++++++++++
2 files changed, 44 insertions(+), 17 deletions(-)
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:15
The code for each subcommand should be easier to read and manipulate
this way.
Signed-off-by: Jonathan Nieder <redacted>
---
builtin/check-ref-format.c | 42 +++++++++++++++++++++++++-----------------
1 files changed, 25 insertions(+), 17 deletions(-)
@@ -33,28 +33,36 @@ static void collapse_slashes(char *dst, const char *src)*dst='\0';}+staticintcheck_ref_format_branch(constchar*arg)+{+structstrbufsb=STRBUF_INIT;++if(strbuf_check_branch_ref(&sb,arg))+die("'%s' is not a valid branch name",arg);+printf("%s\n",sb.buf+11);+return0;+}++staticintcheck_ref_format_print(constchar*arg)+{+char*refname=xmalloc(strlen(arg)+1);++if(check_ref_format(arg))+return1;+collapse_slashes(refname,arg);+printf("%s\n",refname);+return0;+}+intcmd_check_ref_format(intargc,constchar**argv,constchar*prefix){if(argc==2&&!strcmp(argv[1],"-h"))usage(builtin_check_ref_format_usage);-if(argc==3&&!strcmp(argv[1],"--branch")){-structstrbufsb=STRBUF_INIT;--if(strbuf_check_branch_ref(&sb,argv[2]))-die("'%s' is not a valid branch name",argv[2]);-printf("%s\n",sb.buf+11);-exit(0);-}-if(argc==3&&!strcmp(argv[1],"--print")){-char*refname=xmalloc(strlen(argv[2])+1);--if(check_ref_format(argv[2]))-exit(1);-collapse_slashes(refname,argv[2]);-printf("%s\n",refname);-exit(0);-}+if(argc==3&&!strcmp(argv[1],"--branch"))+returncheck_ref_format_branch(argv[2]);+if(argc==3&&!strcmp(argv[1],"--print"))+returncheck_ref_format_print(argv[2]);if(argc!=2)usage(builtin_check_ref_format_usage);return!!check_ref_format(argv[1]);
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:15
check-ref-format --branch requires access to the repository
to resolve refs like @{-1}.
Noticed by Duy.
Cc: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Jonathan Nieder <redacted>
---
The original used the RUN_SETUP_GENTLY flag to run setup
unconditionally. That might still be a good idea, but I am
more comfortable running setup just for this subcommand
for now so commands like "git check-ref-format refs/foo" are not
affected.
builtin/check-ref-format.c | 2 ++
t/t1402-check-ref-format.sh | 17 +++++++++++++++++
2 files changed, 19 insertions(+), 0 deletions(-)
Nguyễn Thái Ngọc Duy (12):
git wrapper: introduce startup_info struct
setup: remember whether repository was found
git wrapper: allow setup_git_directory_gently() be called earlier
shortlog: run setup_git_directory_gently() sooner
grep: run setup_git_directory_gently() sooner
apply: run setup_git_directory_gently() sooner
bundle: run setup_git_directory_gently() sooner
config: run setup_git_directory_gently() sooner
index-pack: run setup_git_directory_gently() sooner
ls-remote: run setup_git_directory_gently() sooner
var: run setup_git_directory_gently() sooner
merge-file: run setup_git_directory_gently() sooner
[1] http://thread.gmane.org/gmane.comp.version-control.git/144000/focus=144110
I was waiting for jn/maint-setup-fix to graduate before pushing out
some more patches then I got side tracked by the subtree clone.
Anyway, thanks!
--
Duy
From: Nguyễn Thái Ngọc Duy <redacted>
As v1.7.2~16^2 (2010-07-14) explains, without this change,
“git --paginate apply” can ignore the repository-local
“[core] pager” configuration.
Applying this patch broke the following tests:
./t4119-apply-config.sh ./t4111-apply-subdir.sh
./t4131-apply-fake-ancestor.sh
I didn't look into why, they're breaking in pu now at 6ea3604. I
didn't look into why, see the smoke report at
http://smoke.git.nix.is/app/projects/report_details/33
On Mon, Aug 16, 2010 at 6:13 AM, Ævar Arnfjörð Bjarmason
[off-list ref] wrote:
2010/8/6 Jonathan Nieder [off-list ref]:
quoted
From: Nguyễn Thái Ngọc Duy <redacted>
As v1.7.2~16^2 (2010-07-14) explains, without this change,
“git --paginate apply” can ignore the repository-local
“[core] pager” configuration.
Applying this patch broke the following tests:
./t4119-apply-config.sh ./t4111-apply-subdir.sh
./t4131-apply-fake-ancestor.sh
I didn't look into why, they're breaking in pu now at 6ea3604. I
didn't look into why, see the smoke report at
http://smoke.git.nix.is/app/projects/report_details/33
The patch loses prefix and git-apply couldn't find files on disk. This
patch may fix it. I'm running tests now.
As v1.7.2~16^2 (2010-07-14) explains, without this change,
“git --paginate apply” can ignore the repository-local
“[core] pager” configuration.
Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
---
This is a replacement for 4ce097c (apply: run
setup_git_directory_gently() sooner) in pu, branch jn/paginate-fix,
which fixes prefix loss in 4ce097c.
All tests seem to run ok for me.
builtin/apply.c | 6 +++---
git.c | 2 +-
t/t7006-pager.sh | 3 +++
3 files changed, 7 insertions(+), 4 deletions(-)
From: Junio C Hamano <hidden> Date: 2016-06-15 22:49:19
Nguyễn Thái Ngọc Duy [off-list ref] writes:
As v1.7.2~16^2 (2010-07-14) explains, without this change,
“git --paginate apply” can ignore the repository-local
“[core] pager” configuration.
Signed-off-by: Nguyễn Thái Ngọc Duy <redacted>
Signed-off-by: Junio C Hamano <redacted>
Signed-off-by: Jonathan Nieder <redacted>
Signed-off-by: Junio C Hamano <redacted>
---
This is a replacement for 4ce097c (apply: run
setup_git_directory_gently() sooner) in pu, branch jn/paginate-fix,
which fixes prefix loss in 4ce097c.
+test_expect_success 'configuration can enable pager (from subdir)' '
+ rm -f paginated.out &&
+ mkdir -p subdir &&
+ git config pager.bundle true &&
+ test_when_finished "git config --unset pager.bundle" &&
+
+ git bundle create test.bundle --all &&
+ rm -f paginated.out subdir/paginated.out &&
+ (
+ cd subdir &&
+ test_terminal git bundle unbundle ../test.bundle
+ ) &&
+ {
+ test -e paginated.out ||
+ test -e subdir/paginated.out
+ }
+'
+
# A colored commit log will begin with an appropriate ANSI escape
# for the first color; the text "commit" comes later.
colorful() {
On my valgrind test setup, this never worked (i.e., fails and bisects
to this commit).
Oddly, I am seeing this error message from the second test (second in
t7006, not in this patch):
expecting success:
rm -f stdout_is_tty ||
cleanup_fail &&
if test -t 1
then
>stdout_is_tty
elif
test_have_prereq PERL &&
"$PERL_PATH" "$TEST_DIRECTORY"/t7006/test-terminal.perl \
sh -c "test -t 1"
then
>test_terminal_works
fi
Can't locate IO/Pty.pm in @INC (@INC contains: <snip>) at /local/home/trast/git/t/t7006/test-terminal.perl line 4.
BEGIN failed--compilation aborted at /local/home/trast/git/t/t7006/test-terminal.perl line 4.
ok 2 - set up terminal for tests
Which raises a few questions: Why was this never an issue before? Am
I supposed to have IO::Pty with a perl install (it's a perl 5.8.8) or
does the test need a prerequisite other than HAVE_PERL?4
--
Thomas Rast
trast@{inf,student}.ethz.ch
On my valgrind test setup, this never worked (i.e., fails and bisects
to this commit).
Agh, sloppy me... Fixes below.
Oddly, I am seeing this error message from the second test (second in
t7006, not in this patch):
[...]
Can't locate IO/Pty.pm in @INC (@INC contains: <snip>) at /local/home/trast/git/t/t7006/test-terminal.perl line 4.
BEGIN failed--compilation aborted at /local/home/trast/git/t/t7006/test-terminal.perl line 4.
ok 2 - set up terminal for tests
Which raises a few questions: Why was this never an issue before?
That’s expected behavior, marked with “ok”. :) That test is checking
if IO::Pty is available and works; if not, the relevant tests should
be skipped.
does the test need a prerequisite other than HAVE_PERL?4
From: Jonathan Nieder <hidden> Date: 2016-06-15 22:49:19
The config pagination test should not run if there is not a tty
available to force pagination on.
Reported-by: Thomas Rast <redacted>
Signed-off-by: Jonathan Nieder <redacted>
---
This one fixes for “config: run setup_git_directory_gently()
sooner”.
Thanks again for the report. I’ll think more about how to make
problems like this easily reproducible (a test_mentions_prereq()
function?).
t/t7006-pager.sh | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)