Merge branch 'md/exclude-promisor-objects-fix' into maint
authorJunio C Hamano <gitster@pobox.com>
Wed, 21 Nov 2018 13:57:52 +0000 (22:57 +0900)
committerJunio C Hamano <gitster@pobox.com>
Wed, 21 Nov 2018 13:57:52 +0000 (22:57 +0900)
Operations on promisor objects make sense in the context of only a
small subset of the commands that internally use the revisions
machinery, but the "--exclude-promisor-objects" option were taken
and led to nonsense results by commands like "log", to which it
didn't make much sense.  This has been corrected.

* md/exclude-promisor-objects-fix:
  exclude-promisor-objects: declare when option is allowed
  Documentation/git-log.txt: do not show --exclude-promisor-objects

1  2 
builtin/pack-objects.c
builtin/prune.c
builtin/rev-list.c
revision.c
revision.h
t/t4202-log.sh

Simple merge
diff --cc builtin/prune.c
@@@ -118,8 -116,9 +118,9 @@@ int cmd_prune(int argc, const char **ar
  
        expire = TIME_MAX;
        save_commit_buffer = 0;
 -      check_replace_refs = 0;
 +      read_replace_refs = 0;
        ref_paranoia = 1;
+       revs.allow_exclude_promisor_objects_opt = 1;
        init_revisions(&revs, prefix);
  
        argc = parse_options(argc, argv, prefix, options, prune_usage, 0);
Simple merge
diff --cc revision.c
@@@ -2133,9 -2105,10 +2133,10 @@@ static int handle_revision_opt(struct r
                revs->limited = 1;
        } else if (!strcmp(arg, "--ignore-missing")) {
                revs->ignore_missing = 1;
-       } else if (!strcmp(arg, "--exclude-promisor-objects")) {
+       } else if (revs->allow_exclude_promisor_objects_opt &&
+                  !strcmp(arg, "--exclude-promisor-objects")) {
                if (fetch_if_missing)
 -                      die("BUG: exclude_promisor_objects can only be used when fetch_if_missing is 0");
 +                      BUG("exclude_promisor_objects can only be used when fetch_if_missing is 0");
                revs->exclude_promisor_objects = 1;
        } else {
                int opts = diff_opt_parse(&revs->diffopt, argv, argc, revs->prefix);
diff --cc revision.h
Simple merge
diff --cc t/t4202-log.sh
Simple merge