Thread (1 message) 1 message, 1 author, 2016-06-15

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

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:48:11

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?
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help