From: Junio C Hamano Date: Sun, 12 Feb 2006 12:15:50 +0000 (-0800) Subject: Merge branch 'jc/nostat' X-Git-Tag: v1.3.0-rc1~54^2~83 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/bff606b8e9b897caeb66c4addfd16c04ebea0b8b?hp=-c Merge branch 'jc/nostat' * jc/nostat: "assume unchanged" git: documentation. ls-files: split "show-valid-bit" into a different option. --- bff606b8e9b897caeb66c4addfd16c04ebea0b8b diff --combined ls-files.c index 1c8ab73989,30296fd84f..5539fd8549 --- a/ls-files.c +++ b/ls-files.c @@@ -20,6 -20,7 +20,7 @@@ static int show_unmerged = 0 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; @@@ -447,7 -448,8 +448,8 @@@ static void show_ce_entry(const char *t 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])) @@@ -490,28 -492,8 +492,28 @@@ static void show_files(void const char *path = ".", *base = ""; int baselen = prefix_len; - if (baselen) + if (baselen) { path = base = prefix; + if (exclude_per_dir) { + char *p, *pp = xmalloc(baselen+1); + memcpy(pp, prefix, baselen+1); + p = pp; + while (1) { + char save = *p; + *p = 0; + push_exclude_per_directory(pp, p-pp); + *p++ = save; + if (!save) + break; + p = strchr(p, '/'); + if (p) + p++; + else + p = pp + baselen; + } + free(pp); + } + } read_directory(path, base, baselen); qsort(dir, nr_dir, sizeof(struct nond_on_fs *), cmp_name); if (show_others) @@@ -612,7 -594,7 +614,7 @@@ static void verify_pathspec(void } 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=] [--exclude-from=] " "[ --exclude-per-directory= ] [--full-name] [--] []*"; @@@ -637,13 -619,15 +639,15 @@@ int main(int argc, const char **argv 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")) {