]> git.ipfire.org Git - thirdparty/git.git/commit - revision.h
rev-list: fix --reverse interaction with --parents
authorThomas Rast <trast@student.ethz.ch>
Fri, 29 Aug 2008 19:18:38 +0000 (21:18 +0200)
committerJunio C Hamano <gitster@pobox.com>
Sat, 30 Aug 2008 05:20:51 +0000 (22:20 -0700)
commit498bcd3159ae3711f2beea2ea497cdc09856ee79
treeee7d6a7e80e6a75d3f87cd8e18a66a4ed4a3a3f5
parent65347030590bcc251a9ff2ed96487a0f1b9e9fa8
rev-list: fix --reverse interaction with --parents

--reverse did not interact well with --parents, as the included test
case shows: in a history like

  A--B.
   \   \
    `C--M--D

the command

  git rev-list --reverse --parents --full-history HEAD

erroneously lists D as having no parents at all.  (Without --reverse,
it correctly lists M.)

This is caused by the machinery driving --reverse: it first grabs all
commits through the normal routines, then runs them through the same
routines again, effectively simplifying them twice.

Fix this by moving the --reverse one level up, into get_revision().
This way we can cleanly grab all commits via the normal calls, then
just pop them off the list one by one without interfering with
get_revision_internal().

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
revision.c
revision.h
t/t6013-rev-list-reverse-parents.sh [new file with mode: 0755]