Re: [POSSIBLE REGRESSION] Spurious revs after patch "revision.c: --full-history fix"
- From
Linus Torvalds <torvalds@osdl.org>
- Date
- Jul 2, 2006, 17:14 UTC
- Message-ID
- <Pine.LNX.4.64.0607021012180.12404@g5.osdl.org>
- In-Reply-To
- <e5bfff550607020519k6007f41bne34d10c0e919f3c8@mail.gmail.com>
On Sun, 2 Jul 2006, Marco Costalba wrote:
> > What it seems is that with --parents option two more spurious revs > are printed out. This revs have nothing to do with builtin-add.c, the > file is newer then both of them.
Gaah. Does this trivial patch fix it for you?
It had the wrong test for whether a commit was a merge. What it did was to say that a non-merge has exactly one parent (which sounds almost right), but the fact is, initial trees have no parent at all, but they're obviously not merges.
So the test for non-merge should be "!parents || !parents->next", not "parents && !parents->next".
Linus
----
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)