git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wincent Colaiuta <win@wincent.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, Wincent Colaiuta <win@wincent.com>
Subject: [PATCH] Don't use the pager when running "git diff --check"
Date: Thu, 13 Dec 2007 20:45:38 +0100	[thread overview]
Message-ID: <1197575138-58070-1-git-send-email-win@wincent.com> (raw)
In-Reply-To: <1197552751-53480-2-git-send-email-win@wincent.com>

In 89d07f75 "git diff" learnt to not run the pager if the user passes
the --exit-code switch. This commit does the same for the --check
switch for the same reason: we want the user to get the exit status
from "git diff", not the pager.

Signed-off-by: Wincent Colaiuta <win@wincent.com>
---

This really should have been part of my original patch,
([PATCH 1/5] "diff --check" should affect exit status"), but I only
just discovered this now.

 builtin-diff.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/builtin-diff.c b/builtin-diff.c
index 86d01a3..ed2d218 100644
--- a/builtin-diff.c
+++ b/builtin-diff.c
@@ -247,7 +247,8 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
 	/* 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 (!DIFF_OPT_TST(&rev.diffopt, EXIT_WITH_STATUS))
+	if (!DIFF_OPT_TST(&rev.diffopt, EXIT_WITH_STATUS) &&
+	    (!&rev.diffopt.output_format & DIFF_FORMAT_CHECKDIFF))
 		setup_pager();
 
 	/* Do we have --cached and not have a pending object, then
-- 
1.5.4.rc0.5.gd201-dirty

  parent reply	other threads:[~2007-12-13 19:47 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-12-13 13:32 [PATCH 0/5] "diff --check" and whitespace enhancements Wincent Colaiuta
2007-12-13 13:32 ` [PATCH 1/5] "diff --check" should affect exit status Wincent Colaiuta
2007-12-13 13:32   ` [PATCH 2/5] New version of pre-commit hook Wincent Colaiuta
2007-12-13 13:32     ` [PATCH 3/5] Unify whitespace checking Wincent Colaiuta
2007-12-13 13:32       ` [PATCH 4/5] Make "diff --check" output match "git apply" Wincent Colaiuta
2007-12-13 13:32         ` [PATCH 5/5] Add tests for "git diff --check" with core.whitespace options Wincent Colaiuta
2007-12-14  0:55           ` Junio C Hamano
2007-12-14  0:12         ` [PATCH 4/5] Make "diff --check" output match "git apply" Junio C Hamano
2007-12-13 13:40       ` [PATCH 3/5] Unify whitespace checking Andreas Ericsson
2007-12-14  0:03       ` Junio C Hamano
2007-12-14  7:36         ` Wincent Colaiuta
2007-12-14  0:17     ` [PATCH 2/5] New version of pre-commit hook Jakub Narebski
2007-12-14  7:24       ` Wincent Colaiuta
2007-12-14 10:23         ` Jakub Narebski
2007-12-13 19:45   ` Wincent Colaiuta [this message]
2007-12-14  4:51     ` [PATCH] Don't use the pager when running "git diff --check" Jeff King
2007-12-14  5:11       ` Junio C Hamano
2007-12-14  7:33         ` Junio C Hamano
2007-12-14  7:51           ` Wincent Colaiuta
2007-12-14  7:57             ` Junio C Hamano
2007-12-14  7:47         ` Wincent Colaiuta
2007-12-14 20:54           ` Junio C Hamano
2007-12-13 23:51   ` [PATCH 1/5] "diff --check" should affect exit status Junio C Hamano
2007-12-14  2:10     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1197575138-58070-1-git-send-email-win@wincent.com \
    --to=win@wincent.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).