summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4b37666)
raw | patch | inline | side by side (parent: 4b37666)
author | René Scharfe <rene.scharfe@lsrfire.ath.cx> | |
Sun, 12 Aug 2007 17:46:55 +0000 (19:46 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 13 Aug 2007 20:06:23 +0000 (13:06 -0700) |
As Wincent Colaiuta found out, it's a bit unexpected for git diff to
start a pager even when the --quiet option is specified. The problem
is that the pager hides the return code -- which is the only output
we're interested in in this case.
Push pager setup down into builtin-diff.c and don't start the pager
if --exit-code or --quiet (which implies --exit-code) was specified.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
start a pager even when the --quiet option is specified. The problem
is that the pager hides the return code -- which is the only output
we're interested in in this case.
Push pager setup down into builtin-diff.c and don't start the pager
if --exit-code or --quiet (which implies --exit-code) was specified.
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-diff.c | patch | blob | history | |
git.c | patch | blob | history |
diff --git a/builtin-diff.c b/builtin-diff.c
index b48121e6e21ddd29fbb725c813aa22d0bcee2ea2..8dc17b0dd7af33f83aebeae88d4e616e76da52eb 100644 (file)
--- a/builtin-diff.c
+++ b/builtin-diff.c
rev.diffopt.allow_external = 1;
rev.diffopt.recursive = 1;
+ /* If the user asked for our exit code then don't start a
+ * pager or we would end up reporting its exit code instead.
+ */
+ if (!rev.diffopt.exit_with_status)
+ setup_pager();
+
/* Do we have --cached and not have a pending object, then
* default to HEAD by hand. Eek.
*/
index e5daae0f95d33dd19e7c02a50b7addfd59c64058..cab0e7227dfbea3c07be81317418518e55499e18 100644 (file)
--- a/git.c
+++ b/git.c
{ "config", cmd_config },
{ "count-objects", cmd_count_objects, RUN_SETUP },
{ "describe", cmd_describe, RUN_SETUP },
- { "diff", cmd_diff, USE_PAGER },
+ { "diff", cmd_diff },
{ "diff-files", cmd_diff_files },
{ "diff-index", cmd_diff_index, RUN_SETUP },
{ "diff-tree", cmd_diff_tree, RUN_SETUP },