summaryrefslogtreecommitdiff
path: root/show-diff.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <junkio@cox.net>2005-04-27 15:22:02 -0700
committerLibravatar Linus Torvalds <torvalds@ppc970.osdl.org>2005-04-27 15:22:02 -0700
commitd15aa4309cadae5c998c9ce1c45b7a104f3d80f5 (patch)
tree5dd93f1db8eb4158d814635ddbea6d451348f4d9 /show-diff.c
parent[PATCH] Fix up <sys/socket.h> include dependency (diff)
downloadtgif-d15aa4309cadae5c998c9ce1c45b7a104f3d80f5.tar.xz
[PATCH] Make -s flag to show-diff a no-op.
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 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> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'show-diff.c')
-rw-r--r--show-diff.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/show-diff.c b/show-diff.c
index 993668e014..fdd7dd4b0c 100644
--- a/show-diff.c
+++ b/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;