summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9d52f15)
raw | patch | inline | side by side (parent: 9d52f15)
author | Thomas Rast <trast@student.ethz.ch> | |
Fri, 30 Jul 2010 22:35:59 +0000 (00:35 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 2 Aug 2010 20:16:16 +0000 (13:16 -0700) |
Teach git-ls-files a new option --debug that just tacks all available
data from the cache onto each file's line.
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
data from the cache onto each file's line.
Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-ls-files.txt | patch | blob | history | |
builtin/ls-files.c | patch | blob | history |
index bd919f2dfddc0165f7749e425a9b1d393558d46f..a7c8174d01810bfb28e331aafc27414dd6cfad50 100644 (file)
lines, show only a partial prefix.
Non default number of digits can be specified with --abbrev=<n>.
+--debug::
+ After each line that describes a file, add more data about its
+ cache entry. This is intended to show as much information as
+ possible for manual inspection; the exact format may change at
+ any time.
+
\--::
Do not interpret any more arguments as options.
diff --git a/builtin/ls-files.c b/builtin/ls-files.c
index 1b9b8a8b4ac2baff6b9676bcf23b148f147dac6a..cc202c5f6fa6f2be7da857d2f4af7a2e4f3300d6 100644 (file)
--- a/builtin/ls-files.c
+++ b/builtin/ls-files.c
static int show_killed;
static int show_valid_bit;
static int line_terminator = '\n';
+static int debug_mode;
static const char *prefix;
static int max_prefix_len;
ce_stage(ce));
}
write_name(ce->name, ce_namelen(ce));
+ if (debug_mode) {
+ printf(" ctime: %d:%d\n", ce->ce_ctime.sec, ce->ce_ctime.nsec);
+ printf(" mtime: %d:%d\n", ce->ce_mtime.sec, ce->ce_mtime.nsec);
+ printf(" dev: %d\tino: %d\n", ce->ce_dev, ce->ce_ino);
+ printf(" uid: %d\tgid: %d\n", ce->ce_uid, ce->ce_gid);
+ printf(" size: %d\tflags: %x\n", ce->ce_size, ce->ce_flags);
+ }
}
static int show_one_ru(struct string_list_item *item, void *cbdata)
OPT_STRING(0, "with-tree", &with_tree, "tree-ish",
"pretend that paths removed since <tree-ish> are still present"),
OPT__ABBREV(&abbrev),
+ OPT_BOOLEAN(0, "debug", &debug_mode, "show debugging data"),
OPT_END()
};