summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b92b2ce)
raw | patch | inline | side by side (parent: b92b2ce)
author | Junio C Hamano <junkio@cox.net> | |
Sun, 12 Feb 2006 09:47:57 +0000 (01:47 -0800) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sun, 12 Feb 2006 09:47:57 +0000 (01:47 -0800) |
To preserve compatibility with scripts that expect uppercase
letters to be shown, do not make '-t' to unconditionally show
the valid bit. Introduce '-v' option for that.
Signed-off-by: Junio C Hamano <junkio@cox.net>
letters to be shown, do not make '-t' to unconditionally show
the valid bit. Introduce '-v' option for that.
Signed-off-by: Junio C Hamano <junkio@cox.net>
ls-files.c | patch | blob | history |
diff --git a/ls-files.c b/ls-files.c
index 3f06ece84d3e6844fe068585a6142fd09376ce6b..30296fd84ff6ec2575c2b25c4fdc74d47baacc53 100644 (file)
--- a/ls-files.c
+++ b/ls-files.c
static int show_modified = 0;
static int show_killed = 0;
static int show_other_directories = 0;
+static int show_valid_bit = 0;
static int line_terminator = '\n';
static int prefix_len = 0, prefix_offset = 0;
if (pathspec && !match(pathspec, ce->name, len))
return;
- if (tag && *tag && (ce->ce_flags & htons(CE_VALID))) {
+ if (tag && *tag && show_valid_bit &&
+ (ce->ce_flags & htons(CE_VALID))) {
static char alttag[4];
memcpy(alttag, tag, 3);
if (isalpha(tag[0]))
}
static const char ls_files_usage[] =
- "git-ls-files [-z] [-t] (--[cached|deleted|others|stage|unmerged|killed|modified])* "
+ "git-ls-files [-z] [-t] [-v] (--[cached|deleted|others|stage|unmerged|killed|modified])* "
"[ --ignored ] [--exclude=<pattern>] [--exclude-from=<file>] "
"[ --exclude-per-directory=<filename> ] [--full-name] [--] [<file>]*";
line_terminator = 0;
continue;
}
- if (!strcmp(arg, "-t")) {
+ if (!strcmp(arg, "-t") || !strcmp(arg, "-v")) {
tag_cached = "H ";
tag_unmerged = "M ";
tag_removed = "R ";
tag_modified = "C ";
tag_other = "? ";
tag_killed = "K ";
+ if (arg[1] == 'v')
+ show_valid_bit = 1;
continue;
}
if (!strcmp(arg, "-c") || !strcmp(arg, "--cached")) {