Merge branch 'maint'
authorJunio C Hamano <gitster@pobox.com>
Sun, 11 May 2008 19:09:18 +0000 (12:09 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sun, 11 May 2008 19:09:18 +0000 (12:09 -0700)
* 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

1  2 
builtin-commit.c
diff --combined builtin-commit.c
index 6433f86cbb0a02ed8ca6f436ebb51b6eda0e842c,e3564a526a29927702e2aab368feae3e641c1256..a65c2b8c37c2f7785d76ec1f4e3692ee52dab8e9
@@@ -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;