From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Phillip Wood via GitGitGadget <gitgitgadget@gmail.com>
Cc: git@vger.kernel.org, Phillip Wood <phillip.wood123@gmail.com>,
Christian Couder <christian.couder@gmail.com>,
Elijah Newren <newren@gmail.com>,
Phillip Wood <phillip.wood@dunelm.org.uk>
Subject: Re: [PATCH v2 6/8] rebase --apply: make reflog messages match rebase --merge
Date: Wed, 20 Apr 2022 12:22:54 +0200 [thread overview]
Message-ID: <220420.865yn4833u.gmgdl@evledraar.gmail.com> (raw)
In-Reply-To: <95161f21e0004cff1bb0915aa39200b286e592e5.1650448612.git.gitgitgadget@gmail.com>
On Wed, Apr 20 2022, Phillip Wood via GitGitGadget wrote:
> From: Phillip Wood <phillip.wood@dunelm.org.uk>
>
> The apply backend creates slightly different reflog messages to the
> merge backend when starting and finishing a rebase and when picking
> commits. The choice of backend is really an implementation detail so
> it is confusing to have the same command create different messages
> depending on which backend is selected. Change the apply backend so
> the reflog messages from the two backends match as closely as
> possible. Note that there is still a difference when committing a
> conflict resolution - the merge backend will use "(continue)" rather
> than "(pick)" in that case as it does not know which command created
> the conflict that it is committing.
>
> Signed-off-by: Phillip Wood <phillip.wood@dunelm.org.uk>
> ---
> builtin/rebase.c | 9 +++++----
> t/t3406-rebase-message.sh | 2 +-
> 2 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/builtin/rebase.c b/builtin/rebase.c
> index e50361fc2a9..678339c7bf7 100644
> --- a/builtin/rebase.c
> +++ b/builtin/rebase.c
> @@ -580,10 +580,10 @@ static int move_to_original_branch(struct rebase_options *opts)
> if (!opts->onto)
> BUG("move_to_original_branch without onto");
>
> - strbuf_addf(&branch_reflog, "%s finished: %s onto %s",
> + strbuf_addf(&branch_reflog, "%s (finish): %s onto %s",
> getenv(GIT_REFLOG_ACTION_ENVIRONMENT),
> opts->head_name, oid_to_hex(&opts->onto->object.oid));
> - strbuf_addf(&head_reflog, "%s finished: returning to %s",
> + strbuf_addf(&head_reflog, "%s (finish): returning to %s",
> getenv(GIT_REFLOG_ACTION_ENVIRONMENT), opts->head_name);
> ropts.branch = opts->head_name;
> ropts.flags = RESET_HEAD_REFS_ONLY;
> @@ -613,7 +613,8 @@ static int run_am(struct rebase_options *opts)
>
> am.git_cmd = 1;
> strvec_push(&am.args, "am");
> -
> + strvec_pushf(&am.env_array, GIT_REFLOG_ACTION_ENVIRONMENT "=%s (pick)",
> + getenv(GIT_REFLOG_ACTION_ENVIRONMENT));
> if (opts->action && !strcmp("continue", opts->action)) {
> strvec_push(&am.args, "--resolved");
> strvec_pushf(&am.args, "--resolvemsg=%s", resolvemsg);
> @@ -1763,7 +1764,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
> printf(_("First, rewinding head to replay your work on top of "
> "it...\n"));
>
> - strbuf_addf(&msg, "%s: checkout %s",
> + strbuf_addf(&msg, "%s (start): checkout %s",
> getenv(GIT_REFLOG_ACTION_ENVIRONMENT), options.onto_name);
> ropts.oid = &options.onto->object.oid;
> ropts.orig_head = &options.orig_head,
> diff --git a/t/t3406-rebase-message.sh b/t/t3406-rebase-message.sh
> index bb2a4949abc..5c6cd9af3bc 100755
> --- a/t/t3406-rebase-message.sh
> +++ b/t/t3406-rebase-message.sh
> @@ -88,7 +88,7 @@ test_expect_success 'error out early upon -C<n> or --whitespace=<bad>' '
> write_reflog_expect () {
> if test $mode = --apply
> then
> - sed 's/(finish)/finished/; s/ ([^)]*)//'
> + sed 's/(continue)/(pick)/'
> else
> cat
> fi >expect
I like the new message better, but I wonder given that the old message
has been with us since 6fd2f5e60d4 (rebase: operate on a detached HEAD,
2007-11-08) whether this will break anything in the wild.
next prev parent reply other threads:[~2022-04-20 10:24 UTC|newest]
Thread overview: 73+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-21 11:10 [PATCH 0/7] rebase: make reflog messages independent of the backend Phillip Wood via GitGitGadget
2022-02-21 11:10 ` [PATCH 1/7] rebase --apply: remove duplicated code Phillip Wood via GitGitGadget
2022-04-07 13:35 ` Christian Couder
2022-04-17 1:56 ` Elijah Newren
2022-02-21 11:10 ` [PATCH 2/7] rebase --merge: fix reflog when continuing Phillip Wood via GitGitGadget
2022-04-07 13:49 ` Christian Couder
2022-04-15 14:00 ` Phillip Wood
2022-04-17 1:57 ` Elijah Newren
2022-02-21 11:10 ` [PATCH 3/7] rebase --merge: fix reflog message after skipping Phillip Wood via GitGitGadget
2022-04-17 1:58 ` Elijah Newren
2022-02-21 11:10 ` [PATCH 4/7] rebase --apply: respect GIT_REFLOG_ACTION Phillip Wood via GitGitGadget
2022-04-07 13:59 ` Christian Couder
2022-04-15 14:03 ` Phillip Wood
2022-02-21 11:10 ` [PATCH 5/7] rebase --apply: make reflog messages match rebase --merge Phillip Wood via GitGitGadget
2022-04-17 2:03 ` Elijah Newren
2022-02-21 11:10 ` [PATCH 6/7] rebase --abort: improve reflog message Phillip Wood via GitGitGadget
2022-04-17 2:07 ` Elijah Newren
2022-02-21 11:10 ` [PATCH 7/7] rebase: cleanup action handling Phillip Wood via GitGitGadget
2022-04-17 2:07 ` Elijah Newren
2022-04-04 15:34 ` Review Request (was Re: [PATCH 0/7] rebase: make reflog messages independent of the backend) Phillip Wood
2022-04-17 2:13 ` Elijah Newren
2022-04-18 18:56 ` Phillip Wood
2022-04-07 14:15 ` [PATCH 0/7] rebase: make reflog messages independent of the backend Christian Couder
2022-04-17 2:09 ` Elijah Newren
2022-04-20 9:56 ` [PATCH v2 0/8] " Phillip Wood via GitGitGadget
2022-04-20 9:56 ` [PATCH v2 1/8] rebase --apply: remove duplicated code Phillip Wood via GitGitGadget
2022-04-20 10:10 ` Ævar Arnfjörð Bjarmason
2022-04-20 18:25 ` Junio C Hamano
2022-04-20 18:39 ` Junio C Hamano
2022-04-20 9:56 ` [PATCH v2 2/8] t3406: rework rebase reflog tests Phillip Wood via GitGitGadget
2022-04-20 20:17 ` Junio C Hamano
2022-04-20 9:56 ` [PATCH v2 3/8] rebase --merge: fix reflog when continuing Phillip Wood via GitGitGadget
2022-04-20 9:56 ` [PATCH v2 4/8] rebase --merge: fix reflog message after skipping Phillip Wood via GitGitGadget
2022-04-20 9:56 ` [PATCH v2 5/8] rebase --apply: respect GIT_REFLOG_ACTION Phillip Wood via GitGitGadget
2022-04-20 9:56 ` [PATCH v2 6/8] rebase --apply: make reflog messages match rebase --merge Phillip Wood via GitGitGadget
2022-04-20 10:22 ` Ævar Arnfjörð Bjarmason [this message]
2022-04-20 22:15 ` Junio C Hamano
2022-04-20 9:56 ` [PATCH v2 7/8] rebase --abort: improve reflog message Phillip Wood via GitGitGadget
2022-04-20 9:56 ` [PATCH v2 8/8] rebase: cleanup action handling Phillip Wood via GitGitGadget
2022-04-20 10:34 ` Ævar Arnfjörð Bjarmason
2022-10-12 9:35 ` [PATCH v3 0/8] rebase: make reflog messages independent of the backend Phillip Wood via GitGitGadget
2022-10-12 9:35 ` [PATCH v3 1/8] rebase --apply: remove duplicated code Phillip Wood via GitGitGadget
2022-10-12 20:36 ` Junio C Hamano
2022-10-13 18:13 ` Junio C Hamano
2022-10-20 9:50 ` Phillip Wood
2022-10-12 9:35 ` [PATCH v3 2/8] t3406: rework rebase reflog tests Phillip Wood via GitGitGadget
2022-10-12 9:35 ` [PATCH v3 3/8] rebase --merge: fix reflog when continuing Phillip Wood via GitGitGadget
2022-10-12 9:35 ` [PATCH v3 4/8] rebase --merge: fix reflog message after skipping Phillip Wood via GitGitGadget
2022-10-12 9:35 ` [PATCH v3 5/8] rebase --apply: respect GIT_REFLOG_ACTION Phillip Wood via GitGitGadget
2022-10-12 9:35 ` [PATCH v3 6/8] rebase --apply: make reflog messages match rebase --merge Phillip Wood via GitGitGadget
2022-10-12 9:35 ` [PATCH v3 7/8] rebase --abort: improve reflog message Phillip Wood via GitGitGadget
2022-10-12 9:35 ` [PATCH v3 8/8] rebase: cleanup action handling Phillip Wood via GitGitGadget
2022-10-12 20:37 ` [PATCH v3 0/8] rebase: make reflog messages independent of the backend Junio C Hamano
2022-10-13 8:44 ` Phillip Wood
2022-10-13 15:31 ` Junio C Hamano
2022-10-21 9:21 ` [PATCH v4 " Phillip Wood via GitGitGadget
2022-10-21 9:21 ` [PATCH v4 1/8] t3406: rework rebase reflog tests Phillip Wood via GitGitGadget
2022-10-21 9:21 ` [PATCH v4 2/8] rebase --apply: improve fast-forward reflog message Phillip Wood via GitGitGadget
2022-10-21 9:21 ` [PATCH v4 3/8] rebase --merge: fix reflog when continuing Phillip Wood via GitGitGadget
2022-10-21 17:37 ` Junio C Hamano
2022-10-25 10:08 ` Phillip Wood
2022-10-25 16:11 ` Junio C Hamano
2022-10-26 15:17 ` Phillip Wood
2022-10-26 16:55 ` Junio C Hamano
2022-10-21 9:21 ` [PATCH v4 4/8] rebase --merge: fix reflog message after skipping Phillip Wood via GitGitGadget
2022-10-21 9:21 ` [PATCH v4 5/8] rebase --apply: respect GIT_REFLOG_ACTION Phillip Wood via GitGitGadget
2022-10-21 17:38 ` Junio C Hamano
2022-10-21 9:21 ` [PATCH v4 6/8] rebase --apply: make reflog messages match rebase --merge Phillip Wood via GitGitGadget
2022-10-21 17:39 ` Junio C Hamano
2022-10-21 9:21 ` [PATCH v4 7/8] rebase --abort: improve reflog message Phillip Wood via GitGitGadget
2022-10-21 17:44 ` Junio C Hamano
2022-10-21 9:21 ` [PATCH v4 8/8] rebase: cleanup action handling Phillip Wood via GitGitGadget
2022-10-21 17:54 ` 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=220420.865yn4833u.gmgdl@evledraar.gmail.com \
--to=avarab@gmail.com \
--cc=christian.couder@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=newren@gmail.com \
--cc=phillip.wood123@gmail.com \
--cc=phillip.wood@dunelm.org.uk \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).