Git development
 help / color / mirror / Atom feed
* [PATCH] diff: squelch empty diffs even more
@ 2007-08-14 21:09 René Scharfe
  2007-08-14 21:29 ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: René Scharfe @ 2007-08-14 21:09 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Git Mailing List

When we compare two non-tracked files or explicitly specify
--no-index then the suggestion to run git-status is not helpful.
max_count is set to -2 in these cases; don't print the warning
then.

Signed-off-by: Rene Scharfe <rene.scharfe@lsfire.ath.cx>
---

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

diff --git a/builtin-diff.c b/builtin-diff.c
index 6ed7b68..b2fd8c8 100644
--- a/builtin-diff.c
+++ b/builtin-diff.c
@@ -346,8 +346,8 @@ int cmd_diff(int argc, const char **argv, const char *prefix)
 	if (rev.diffopt.exit_with_status)
 		result = rev.diffopt.has_changes;
 
-	if ((rev.diffopt.output_format & DIFF_FORMAT_PATCH)
-	    && (1 < rev.diffopt.skip_stat_unmatch))
+	if ((rev.diffopt.output_format & DIFF_FORMAT_PATCH) &&
+	    1 < rev.diffopt.skip_stat_unmatch && rev.max_count != -2)
 		printf("Warning: %d path%s touched but unmodified. "
 		       "Consider running git-status.\n",
 		       rev.diffopt.skip_stat_unmatch - 1,

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-08-15 14:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-14 21:09 [PATCH] diff: squelch empty diffs even more René Scharfe
2007-08-14 21:29 ` Junio C Hamano
2007-08-14 22:41   ` René Scharfe
2007-08-14 23:52     ` Junio C Hamano
2007-08-15 14:47       ` Johannes Schindelin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox