Re: [PATCH 5/9] revert: add --ff option to allow fast forward when cherry-picking
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 6, 2010, 00:21 UTC
- Message-ID
- <7vzl3nkydj.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <7vpr4jnsm9.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 5 quoted lines
> Christian Couder <chriscool@tuxfamily.org> 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:
Show 6 quoted lines
>> + 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?