Code

Merge branch 'mm/shortopt-detached'
authorJunio C Hamano <gitster@pobox.com>
Sun, 22 Aug 2010 06:28:31 +0000 (23:28 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sun, 22 Aug 2010 06:28:31 +0000 (23:28 -0700)
* mm/shortopt-detached:
  log: parse separate option for --glob
  log: parse separate options like git log --grep foo
  diff: parse separate options --stat-width n, --stat-name-width n
  diff: split off a function for --stat-* option parsing
  diff: parse separate options like -S foo

Conflicts:
revision.c

1  2 
diff.c
diff.h
revision.c
t/t4202-log.sh

diff --cc diff.c
Simple merge
diff --cc diff.h
Simple merge
diff --cc revision.c
index 5f2cf1e8431199207c9abc494c877ab695b1bb07,f241f341c77c63ca6342d31e56f432dac43fbb39..b1c18906badc5fc4ce3af48daa7c226365e3c08f
@@@ -1466,11 -1484,9 +1484,13 @@@ int setup_revisions(int argc, const cha
  {
        int i, flags, left, seen_dashdash, read_from_stdin, got_rev_arg = 0;
        const char **prune_data = NULL;
 +      const char *submodule = NULL;
+       const char *optarg;
+       int argcount;
  
 +      if (opt)
 +              submodule = opt->submodule;
 +
        /* First, search for "--" */
        seen_dashdash = 0;
        for (i = 1; i < argc; i++) {
                                continue;
                        }
                        if (!strcmp(arg, "--remotes")) {
 -                              handle_refs(revs, flags, for_each_remote_ref);
 +                              handle_refs(submodule, revs, flags, for_each_remote_ref_submodule);
                                continue;
                        }
-                       if (!prefixcmp(arg, "--glob=")) {
+                       if ((argcount = parse_long_opt("glob", argv + i, &optarg))) {
                                struct all_refs_cb cb;
+                               i += argcount - 1;
                                init_all_refs_cb(&cb, revs, flags);
-                               for_each_glob_ref(handle_one_ref, arg + 7, &cb);
+                               for_each_glob_ref(handle_one_ref, optarg, &cb);
                                continue;
                        }
                        if (!prefixcmp(arg, "--branches=")) {
diff --cc t/t4202-log.sh
Simple merge