diff options
author | Thomas Rast <trast@student.ethz.ch> | 2010-07-31 00:35:59 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-08-02 13:16:16 -0700 |
commit | 84974217151a66b65ae5b173045483ce5eeb5142 (patch) | |
tree | ec44b5b92d394d0178fc28074a98aa51036cb23f /builtin | |
parent | Merge branch 'maint' (diff) | |
download | tgif-84974217151a66b65ae5b173045483ce5eeb5142.tar.xz |
ls-files: learn a debugging dump format
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>
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/ls-files.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/builtin/ls-files.c b/builtin/ls-files.c index 1b9b8a8b4a..cc202c5f6f 100644 --- a/builtin/ls-files.c +++ b/builtin/ls-files.c @@ -25,6 +25,7 @@ static int show_modified; 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; @@ -162,6 +163,13 @@ static void show_ce_entry(const char *tag, struct cache_entry *ce) 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) @@ -519,6 +527,7 @@ int cmd_ls_files(int argc, const char **argv, const char *cmd_prefix) 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() }; |