mirror of
https://github.com/git/git
synced 2024-08-27 19:49:21 +00:00
Merge branch 'md/exclude-promisor-objects-fix'
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
This commit is contained in:
commit
a29b8bcf62
|
@ -761,7 +761,6 @@ Unexpected missing objects will raise an error.
|
||||||
+
|
+
|
||||||
The form '--missing=print' is like 'allow-any', but will also print a
|
The form '--missing=print' is like 'allow-any', but will also print a
|
||||||
list of the missing objects. Object IDs are prefixed with a ``?'' character.
|
list of the missing objects. Object IDs are prefixed with a ``?'' character.
|
||||||
endif::git-rev-list[]
|
|
||||||
|
|
||||||
--exclude-promisor-objects::
|
--exclude-promisor-objects::
|
||||||
(For internal use only.) Prefilter object traversal at
|
(For internal use only.) Prefilter object traversal at
|
||||||
|
@ -769,6 +768,7 @@ endif::git-rev-list[]
|
||||||
stronger than `--missing=allow-promisor` because it limits the
|
stronger than `--missing=allow-promisor` because it limits the
|
||||||
traversal, rather than just silencing errors about missing
|
traversal, rather than just silencing errors about missing
|
||||||
objects.
|
objects.
|
||||||
|
endif::git-rev-list[]
|
||||||
|
|
||||||
--no-walk[=(sorted|unsorted)]::
|
--no-walk[=(sorted|unsorted)]::
|
||||||
Only show the given commits, but do not traverse their ancestors.
|
Only show the given commits, but do not traverse their ancestors.
|
||||||
|
|
|
@ -3107,6 +3107,7 @@ static void get_object_list(int ac, const char **av)
|
||||||
|
|
||||||
repo_init_revisions(the_repository, &revs, NULL);
|
repo_init_revisions(the_repository, &revs, NULL);
|
||||||
save_commit_buffer = 0;
|
save_commit_buffer = 0;
|
||||||
|
revs.allow_exclude_promisor_objects_opt = 1;
|
||||||
setup_revisions(ac, av, &revs, NULL);
|
setup_revisions(ac, av, &revs, NULL);
|
||||||
|
|
||||||
/* make sure shallows are read */
|
/* make sure shallows are read */
|
||||||
|
|
|
@ -120,6 +120,7 @@ int cmd_prune(int argc, const char **argv, const char *prefix)
|
||||||
save_commit_buffer = 0;
|
save_commit_buffer = 0;
|
||||||
read_replace_refs = 0;
|
read_replace_refs = 0;
|
||||||
ref_paranoia = 1;
|
ref_paranoia = 1;
|
||||||
|
revs.allow_exclude_promisor_objects_opt = 1;
|
||||||
repo_init_revisions(the_repository, &revs, prefix);
|
repo_init_revisions(the_repository, &revs, prefix);
|
||||||
|
|
||||||
argc = parse_options(argc, argv, prefix, options, prune_usage, 0);
|
argc = parse_options(argc, argv, prefix, options, prune_usage, 0);
|
||||||
|
|
|
@ -374,6 +374,7 @@ int cmd_rev_list(int argc, const char **argv, const char *prefix)
|
||||||
git_config(git_default_config, NULL);
|
git_config(git_default_config, NULL);
|
||||||
repo_init_revisions(the_repository, &revs, prefix);
|
repo_init_revisions(the_repository, &revs, prefix);
|
||||||
revs.abbrev = DEFAULT_ABBREV;
|
revs.abbrev = DEFAULT_ABBREV;
|
||||||
|
revs.allow_exclude_promisor_objects_opt = 1;
|
||||||
revs.commit_format = CMIT_FMT_UNSPECIFIED;
|
revs.commit_format = CMIT_FMT_UNSPECIFIED;
|
||||||
revs.do_not_die_on_missing_tree = 1;
|
revs.do_not_die_on_missing_tree = 1;
|
||||||
|
|
||||||
|
|
|
@ -2138,7 +2138,8 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg
|
||||||
revs->limited = 1;
|
revs->limited = 1;
|
||||||
} else if (!strcmp(arg, "--ignore-missing")) {
|
} else if (!strcmp(arg, "--ignore-missing")) {
|
||||||
revs->ignore_missing = 1;
|
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)
|
if (fetch_if_missing)
|
||||||
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;
|
revs->exclude_promisor_objects = 1;
|
||||||
|
|
|
@ -156,6 +156,7 @@ struct rev_info {
|
||||||
do_not_die_on_missing_tree:1,
|
do_not_die_on_missing_tree:1,
|
||||||
|
|
||||||
/* for internal use only */
|
/* for internal use only */
|
||||||
|
allow_exclude_promisor_objects_opt:1,
|
||||||
exclude_promisor_objects:1;
|
exclude_promisor_objects:1;
|
||||||
|
|
||||||
/* Diff flags */
|
/* Diff flags */
|
||||||
|
|
|
@ -1703,4 +1703,8 @@ test_expect_success 'log --source paints symmetric ranges' '
|
||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success '--exclude-promisor-objects does not BUG-crash' '
|
||||||
|
test_must_fail git log --exclude-promisor-objects source-a
|
||||||
|
'
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
|
|
@ -118,4 +118,8 @@ test_expect_success '--no-abbrev works like --abbrev=40' '
|
||||||
check_abbrev 40 --no-abbrev
|
check_abbrev 40 --no-abbrev
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_expect_success '--exclude-promisor-objects does not BUG-crash' '
|
||||||
|
test_must_fail git blame --exclude-promisor-objects one
|
||||||
|
'
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
|
Loading…
Reference in a new issue