]> git.ipfire.org Git - thirdparty/git.git/commit - revision.h
revision: keep track of the end-user input from the command line
authorJunio C Hamano <gitster@pobox.com>
Fri, 26 Aug 2011 00:35:39 +0000 (17:35 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 26 Aug 2011 00:35:44 +0000 (17:35 -0700)
commit281eee473000e5bd46e59d636626132dc9ea85cb
tree6f0e2a002ee473400f8367da0eae1968487d8832
parent81f4953120f021832a0023dc704a0d7eb0ddf475
revision: keep track of the end-user input from the command line

Given a complex set of revision specifiers on the command line, it is too
late to look at the flags of the objects in the initial traversal list at
the beginning of limit_list() in order to determine what the objects the
end-user explicitly listed on the command line were. The process to move
objects from the pending array to the traversal list may have marked
objects that are not mentioned as UNINTERESTING, when handle_commit()
marked the parents of UNINTERESTING commits mentioned on the command line
by calling mark_parents_uninteresting().

This made "rev-list --ancestry-path ^A ..." to mistakenly list commits
that are descendants of A's parents but that are not descendants of A
itself, as ^A from the command line causes A and its parents marked as
UNINTERESTING before coming to limit_list(), and we try to enumerate the
commits that are descendants of these commits that are UNINTERESTING
before we start walking the history.

It actually is too late even if we inspected the pending object array
before calling prepare_revision_walk(), as some of the same objects might
have been mentioned twice, once as positive and another time as negative.
The "rev-list --some-option A --not --all" command may want to notice,
even if the resulting set is empty, that the user showed some interest in
"A" and do something special about it.

Prepare a separate array to keep track of what syntactic element was used
to cause each object to appear in the pending array from the command line,
and populate it as setup_revisions() parses the command line.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
revision.c
revision.h