summaryrefslogtreecommitdiff
path: root/ls-files.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-02-09 05:50:18 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-02-09 05:54:52 (GMT)
commit2bcab24080dc97fc628e1b601a195a9a96773fac (patch)
tree1915f0a7d000cefeaf4ca34b940376440afcdd0d /ls-files.c
parent8b9b0f3af73233595b6b1103ffb30242508a5e47 (diff)
downloadgit-2bcab24080dc97fc628e1b601a195a9a96773fac.zip
git-2bcab24080dc97fc628e1b601a195a9a96773fac.tar.gz
git-2bcab24080dc97fc628e1b601a195a9a96773fac.tar.bz2
ls-files: debugging aid for CE_VALID changes.
This is not really part of the proposed updates for CE_VALID, but with this change, ls-files -t shows CE_VALID paths with lowercase tag letters instead of the usual uppercase. Useful for checking out what is going on. Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'ls-files.c')
-rw-r--r--ls-files.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/ls-files.c b/ls-files.c
index 6af3b09..3f06ece 100644
--- a/ls-files.c
+++ b/ls-files.c
@@ -447,6 +447,22 @@ static void show_ce_entry(const char *tag, struct cache_entry *ce)
if (pathspec && !match(pathspec, ce->name, len))
return;
+ if (tag && *tag && (ce->ce_flags & htons(CE_VALID))) {
+ static char alttag[4];
+ memcpy(alttag, tag, 3);
+ if (isalpha(tag[0]))
+ alttag[0] = tolower(tag[0]);
+ else if (tag[0] == '?')
+ alttag[0] = '!';
+ else {
+ alttag[0] = 'v';
+ alttag[1] = tag[0];
+ alttag[2] = ' ';
+ alttag[3] = 0;
+ }
+ tag = alttag;
+ }
+
if (!show_stage) {
fputs(tag, stdout);
write_name_quoted("", 0, ce->name + offset,
@@ -503,7 +519,7 @@ static void show_files(void)
err = lstat(ce->name, &st);
if (show_deleted && err)
show_ce_entry(tag_removed, ce);
- if (show_modified && ce_modified(ce, &st))
+ if (show_modified && ce_modified(ce, &st, 0))
show_ce_entry(tag_modified, ce);
}
}