summaryrefslogtreecommitdiff
path: root/git.c
diff options
context:
space:
mode:
authorJonathan Nieder <jrnieder@gmail.com>2010-07-14 17:55:12 -0500
committerJunio C Hamano <gitster@pobox.com>2010-07-14 16:07:34 -0700
commit030149a4dcd584f6b47221f5b087d081e582d790 (patch)
treecbc3a3bbd1135b542a4fd2669acc1aa72b113bea /git.c
parent73e25e7cc80e175b5c94678188333e42107fa16e (diff)
downloadgit-030149a4dcd584f6b47221f5b087d081e582d790.tar.gz
git --paginate: paginate external commands again
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 <jrnieder@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git.c')
-rw-r--r--git.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/git.c b/git.c
index 25e76939e2..99517dd83a 100644
--- a/git.c
+++ b/git.c
@@ -167,6 +167,7 @@ static int handle_alias(int *argcp, const char ***argv)
alias_string = alias_lookup(alias_command);
if (alias_string) {
if (alias_string[0] == '!') {
+ commit_pager_choice();
if (*argcp > 1) {
struct strbuf buf;
@@ -432,6 +433,8 @@ static void execv_dashed_external(const char **argv)
const char *tmp;
int status;
+ commit_pager_choice();
+
strbuf_addf(&cmd, "git-%s", argv[0]);
/*