From: Junio C Hamano Date: Sat, 06 Feb 2010 00:21:12 GMT Subject: Re: [PATCH 5/9] revert: add --ff option to allow fast forward when cherry-picking Message-ID: <7vzl3nkydj.fsf@alter.siamese.dyndns.org> In-Reply-To: <7vpr4jnsm9.fsf@alter.siamese.dyndns.org> Junio C Hamano writes: > Christian Couder 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 " option affect this codepath in any way?