From: Junio C Hamano Date: Sun, 11 May 2008 19:09:18 +0000 (-0700) Subject: Merge branch 'maint' X-Git-Tag: v1.5.6-rc0~67 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/65ea3b8c6d9517c5d7f2a6c089cc6578c9486114?ds=inline;hp=-c Merge branch 'maint' * maint: wt-status.h: declare global variables as extern builtin-commit.c: add -u as short name for --untracked-files git-repack: re-enable parsing of -n command line option --- 65ea3b8c6d9517c5d7f2a6c089cc6578c9486114 diff --combined builtin-commit.c index 6433f86cbb,e3564a526a..a65c2b8c37 --- a/builtin-commit.c +++ b/builtin-commit.c @@@ -101,7 -101,7 +101,7 @@@ static struct option builtin_commit_opt OPT_BOOLEAN('o', "only", &only, "commit only specified files"), OPT_BOOLEAN('n', "no-verify", &no_verify, "bypass pre-commit hook"), OPT_BOOLEAN(0, "amend", &amend, "amend previous commit"), - OPT_BOOLEAN(0, "untracked-files", &untracked_files, "show all untracked files"), + OPT_BOOLEAN('u', "untracked-files", &untracked_files, "show all untracked files"), OPT_BOOLEAN(0, "allow-empty", &allow_empty, "ok to record an empty change"), OPT_STRING(0, "cleanup", &cleanup_arg, "default", "how to strip spaces and #comments from message"), @@@ -175,11 -175,9 +175,11 @@@ static void add_remove_files(struct pat { int i; for (i = 0; i < list->nr; i++) { + struct stat st; struct path_list_item *p = &(list->items[i]); - if (file_exists(p->path)) - add_file_to_cache(p->path, 0); + + if (!lstat(p->path, &st)) + add_to_cache(p->path, &st, 0); else remove_file_from_cache(p->path); } @@@ -747,8 -745,10 +747,8 @@@ static int parse_and_validate_options(i die("No paths with --include/--only does not make sense."); if (argc == 0 && only && amend) only_include_assumed = "Clever... amending the last one with dirty index."; - if (argc > 0 && !also && !only) { + if (argc > 0 && !also && !only) only_include_assumed = "Explicit paths specified without -i nor -o; assuming --only paths..."; - also = 0; - } if (!cleanup_arg || !strcmp(cleanup_arg, "default")) cleanup_mode = use_editor ? CLEANUP_ALL : CLEANUP_SPACE; else if (!strcmp(cleanup_arg, "verbatim")) @@@ -810,7 -810,7 +810,7 @@@ static void print_summary(const char *p rev.verbose_header = 1; rev.show_root_diff = 1; - rev.commit_format = get_commit_format("format:%h: %s"); + get_commit_format("format:%h: %s", &rev); rev.always_show_header = 0; rev.diffopt.detect_rename = 1; rev.diffopt.rename_limit = 100;