Thread (2 messages) flat view 2 messages, 2 authors, 2021-12-21

Re: [PATCH v2] merge: allow to pretend a merge is made into a different branch

From: Derrick Stolee <hidden>
Date: 2021-12-21 13:52:46

On 12/20/2021 5:53 PM, Junio C Hamano wrote:
Teach the "--into-name=<branch>" option to "git merge" and its
underlying "git fmt-merge-message", to pretend as if we were merging
into <branch>, no matter what branch we are actually merging into,
when they prepare the merge message.  The pretend name honors the
usual "into <target>" suppression mechanism, which can be seen in
the tests added here.
I like the change to "--into-name".
 
-	if (starts_with(current_branch, "refs/heads/"))
+
+	if (opts->into_name)
+		current_branch = opts->into_name;
+	else if (starts_with(current_branch, "refs/heads/"))
 		current_branch += 11;
I briefly considered whether this 'else if' should just be an
'if' to allow stripping "revs/heads/" from the --into-name option,
but I think it is better as-is, so we use the literal value that
the user supplied.

This patch LGTM.

Thanks,
-Stolee
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help