Junio C Hamano [off-list ref] writes:
Christian Couder [off-list ref] writes:
quoted
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:
quoted
+ 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?