Re: [PATCH 5/9] revert: add --ff option to allow fast forward when cherry-picking

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

 



Junio C Hamano <gitster@xxxxxxxxx> writes:

> Christian Couder <chriscool@xxxxxxxxxxxxx> writes:
>
>> As "git merge" fast forwards if possible, it seems sensible to
>> have such a feature for "git cherry-pick" too, especially as it
>> could be used in git-rebase--interactive.sh.

One more thing, in the same part of the code:

>> +	if (!(flags & PICK_REVERSE) && ff_ok && commit->parents) {
>> +		unsigned char head_sha1[20];
>> +		if (get_sha1("HEAD", head_sha1))
>> +			die("You do not have a valid HEAD.");
>> +		if (!hashcmp(commit->parents->item->object.sha1, head_sha1)) {
>> +			char *hex = sha1_to_hex(commit->object.sha1);

Is there a need to check commit->parents->next?

Should this code work the same way if the commit being cherry-picked is a
merge?  Should "-m <parent-num>" option affect this codepath in any way?

--
To unsubscribe from this list: 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]