From: Junio C Hamano Date: Mon, 22 Jul 2013 18:24:11 +0000 (-0700) Subject: Merge branch 'jx/clean-interactive' X-Git-Url: https://repo.or.cz/w/git/mingw.git/commitdiff_plain/988f98f61fc80021311c2d161084c03a55f7354d Merge branch 'jx/clean-interactive' Add "interactive" mode to "git clean". The early part to refactor relative path related helper functions looked sensible. * jx/clean-interactive: test: run testcases with POSIX absolute paths on Windows test: add t7301 for git-clean--interactive git-clean: add documentation for interactive git-clean git-clean: add ask each interactive action git-clean: add select by numbers interactive action git-clean: add filter by pattern interactive action git-clean: use a git-add-interactive compatible UI git-clean: add colors to interactive git-clean git-clean: show items of del_list in columns git-clean: add support for -i/--interactive git-clean: refactor git-clean into two phases write_name{_quoted_relative,}(): remove redundant parameters quote_path_relative(): remove redundant parameter quote.c: substitute path_relative with relative_path path.c: refactor relative_path(), not only strip prefix test: add test cases for relative_path --- 988f98f61fc80021311c2d161084c03a55f7354d diff --cc builtin/clean.c index e344137ef2,bf03acfe88..dba8387747 --- a/builtin/clean.c +++ b/builtin/clean.c @@@ -221,8 -912,9 +912,9 @@@ int cmd_clean(int argc, const char **ar struct dir_entry *ent = dir.entries[i]; int len, pos; int matches = 0; - struct cache_entry *ce; + const struct cache_entry *ce; struct stat st; + const char *rel; /* * Remove the '/' at the end that directory diff --cc builtin/ls-files.c index 80fff23ad9,29d45b4f5a..5cf3e31370 --- a/builtin/ls-files.c +++ b/builtin/ls-files.c @@@ -163,15 -167,13 +167,15 @@@ static void show_ce_entry(const char *t find_unique_abbrev(ce->sha1,abbrev), ce_stage(ce)); } - write_name(ce->name, ce_namelen(ce)); + write_name(ce->name); 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); + const struct stat_data *sd = &ce->ce_stat_data; + + printf(" ctime: %d:%d\n", sd->sd_ctime.sec, sd->sd_ctime.nsec); + printf(" mtime: %d:%d\n", sd->sd_mtime.sec, sd->sd_mtime.nsec); + printf(" dev: %d\tino: %d\n", sd->sd_dev, sd->sd_ino); + printf(" uid: %d\tgid: %d\n", sd->sd_uid, sd->sd_gid); + printf(" size: %d\tflags: %x\n", sd->sd_size, ce->ce_flags); } }