All of lore.kernel.org
 help / color / mirror / Atom feed
From: Derrick Stolee <stolee@gmail.com>
To: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Cc: Sergey Organov <sorganov@gmail.com>
Subject: Re: [PATCH v2] merge: allow to pretend a merge is made into a different branch
Date: Tue, 21 Dec 2021 08:52:42 -0500	[thread overview]
Message-ID: <c09a2e85-1c27-ed19-eb6b-c4daece49133@gmail.com> (raw)
In-Reply-To: <xmqqee66ubuw.fsf_-_@gitster.g>

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

  reply	other threads:[~2021-12-21 13:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-18  0:56 [PATCH] merge: allow to pretend a merge into detached HEAD is made into a branch Junio C Hamano
2021-12-18  8:24 ` Sergey Organov
2021-12-20 15:55   ` Junio C Hamano
2021-12-20 22:53     ` [PATCH v2] merge: allow to pretend a merge is made into a different branch Junio C Hamano
2021-12-21 13:52       ` Derrick Stolee [this message]
2021-12-18 10:27 ` [PATCH] merge: allow to pretend a merge into detached HEAD is made into a branch Ævar Arnfjörð Bjarmason
2021-12-20 15:36   ` Derrick Stolee
2021-12-20 15:57     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c09a2e85-1c27-ed19-eb6b-c4daece49133@gmail.com \
    --to=stolee@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=sorganov@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.