Git development
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Linus Torvalds <torvalds@osdl.org>
Cc: git@vger.kernel.org
Subject: [PATCH] Make -s flag to show-diff a no-op.
Date: Wed, 27 Apr 2005 15:06:58 -0700	[thread overview]
Message-ID: <7vfyxbeuwt.fsf@assigned-by-dhcp.cox.net> (raw)

With the recent "no-patch-by-default" change, the -s flag to
the show-diff command (and silent variable in the show-diff.c)
became meaningless.  This patch deprecates it.

Cogito uses "show-diff -s" for the purpose of "I do not want the
patch text.  I just want to know if something has potentially
changed, in which case I know you will have some output.  I'll
run update-cache --refresh if you say something", so we cannot
barf on seeing -s on our command line yet.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---

show-diff.c |   18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)

--- k/show-diff.c
+++ l/show-diff.c
@@ -6,12 +6,12 @@
 #include "cache.h"
 #include "diff.h"
 
-static const char *show_diff_usage = "show-diff [-q] [-s] [-z] [-p] [paths...]";
+static const char *show_diff_usage =
+"show-diff [-p] [-q] [-r] [-z] [paths...]";
 
 static int generate_patch = 0;
 static int line_termination = '\n';
 static int silent = 0;
-static int silent_on_nonexisting_files = 0;
 
 static int matches_pathspec(struct cache_entry *ce, char **spec, int cnt)
 {
@@ -69,16 +69,16 @@ int main(int argc, char **argv)
 	int i;
 
 	while (1 < argc && argv[1][0] == '-') {
-		if (!strcmp(argv[1], "-s"))
-			silent_on_nonexisting_files = silent = 1;
-		else if (!strcmp(argv[1], "-p"))
+		if (!strcmp(argv[1], "-p"))
 			generate_patch = 1;
 		else if (!strcmp(argv[1], "-q"))
-			silent_on_nonexisting_files = 1;
-		else if (!strcmp(argv[1], "-z"))
-			line_termination = 0;
+			silent = 1;
 		else if (!strcmp(argv[1], "-r"))
 			; /* no-op */
+		else if (!strcmp(argv[1], "-s"))
+			; /* no-op */
+		else if (!strcmp(argv[1], "-z"))
+			line_termination = 0;
 		else
 			usage(show_diff_usage);
 		argv++; argc--;
@@ -116,7 +116,7 @@ int main(int argc, char **argv)
 				perror(ce->name);
 				continue;
 			}	
-			if (silent_on_nonexisting_files)
+			if (silent)
 				continue;
 			show_file('-', ce);
 			continue;


             reply	other threads:[~2005-04-27 22:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-04-27 22:06 Junio C Hamano [this message]
2005-04-27 22:20 ` [PATCH] Make -s flag to show-diff a no-op Linus Torvalds
2005-04-27 22:35   ` Junio C Hamano
2005-04-27 23:05     ` Linus Torvalds
2005-04-27 23:11       ` 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=7vfyxbeuwt.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=torvalds@osdl.org \
    /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