Re: [POSSIBLE REGRESSION] Spurious revs after patch "revision.c: --full-history fix"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Linus Torvalds <torvalds@xxxxxxxx> 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.

> 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.

-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]