Re: [POSSIBLE REGRESSION] Spurious revs after patch "revision.c: --full-history fix"
- From
Junio C Hamano <junkio@cox.net>
- Date
- Jul 2, 2006, 17:48 UTC
- Message-ID
- <7v64if6gpr.fsf@assigned-by-dhcp.cox.net>
- In-Reply-To
- <Pine.LNX.4.64.0607021012180.12404@g5.osdl.org>
Linus Torvalds <torvalds@osdl.org> writes:
> Gaah. Does this trivial patch fix it for you? > > It had the wrong test for whether a commit was a merge.
Gaah indeed -- I did not notice the logic error when I picked it up either, sorry.
Show 13 quoted lines
> diff --git a/revision.c b/revision.c > index 1cf6276..880fb7b 100644 > --- a/revision.c > +++ b/revision.c > @@ -997,7 +997,7 @@ struct commit *get_revision(struct rev_i > if (!revs->parents) > continue; > /* non-merge - always ignore it */ > - if (commit->parents && !commit->parents->next) > + if (!commit->parents || !commit->parents->next) > continue; > } > if (revs->parents)
For a casual reader who is curious, the reason it matters to treat the "root" commit sanely in this example is because with the --remove-empty option the commits that add the specified paths are already made into "fake" root commits when the above function sees them (done in try_to_simplify_commit()).
Thanks, Linus and Marco.