From: Junio C Hamano <gitster@pobox.com>
To: Phillip Wood <phillip.wood123@gmail.com>
Cc: Harald Nordgren via GitGitGadget <gitgitgadget@gmail.com>,
git@vger.kernel.org,
Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com>,
"D. Ben Knoble" <ben.knoble@gmail.com>,
Harald Nordgren <haraldnordgren@gmail.com>
Subject: Re: [PATCH v2 0/3] reflog: add --operations and --historical-branch
Date: Sat, 24 Oct 2026 09:40:05 -0700 [thread overview]
Message-ID: <xmqq5wyr128q.fsf@gitster.g> (raw)
In-Reply-To: <bfc2b43a-6198-47b0-8868-d92551548f22@gmail.com> (Phillip Wood's message of "Sat, 24 Oct 2026 14:51:13 +0100")
Phillip Wood <phillip.wood123@gmail.com> writes:
> I'm rather skeptical of this in its current form. Not all commands that
> modify the working tree update the reflog and some commands such as "git
> cherry-pick A B C" create multiple reflog entires that are
> indistinguishable from multiple invocations of a single command.
I like the direction to make the default 'git reflog' output on a
single branch easier to understand without needing any extra
filtering in this series.
'git rebase' doing its work on a detached HEAD was likely the
first, and we may want to convert more multi-step commands to do
so, including the multiple 'git cherry-pick' you mention. 'git am'
way predates the rebase that works on a detached HEAD ('git am'
introduced in Oct 2005 predates the concept of detached HEAD that
was introduced in Git 1.5.0 released in Feb 2007), and it does its
work without detaching HEAD. Its users grew to expect it to work
that way, but I am not sure how problematic a regression it would
be if we taught it to work more like 'git rebase'. For example,
because I am used to 'git am' working on the current branch, I
often do
$ git checkout --detach master
$ git am -s ...mailbox...
$ git checkout -b pw/topic-by-phillip
to compensate for the lack of it, in order to keep the events
recorded in the reflog of the pw/topic-by-phillip branch to "one
iteration per entry". This helps me compare iterations more easily,
e.g.,
$ git checkout pw/topic-by-phillip
$ git diff @{1}
$ git range-diff @{1}...
But the workflow to actively detach by the end user would work just
fine if 'git am' learns to detach first when started on a concrete
branch, to work more like 'git rebase'.
By the way, I too was annoyed that 'git reflog' defaults to the log
of HEAD a long time ago, but the irritation soon waned once I made
it a habit to always provide @{now} or @{0} to the command, as that
notation refers to the current branch.
Thanks.
next prev parent reply other threads:[~2026-10-24 16:40 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-15 13:13 [PATCH 0/3] reflog: add --operations and --historical-branch Harald Nordgren via GitGitGadget
2026-10-15 13:13 ` [PATCH 1/3] reflog: name the strings that mark switches, renames and rebase steps Harald Nordgren via GitGitGadget
2026-10-15 14:35 ` Kristoffer Haugsbakk
2026-10-15 20:52 ` Harald Nordgren
2026-10-15 13:13 ` [PATCH 2/3] reflog: add --operations to show one entry per command Harald Nordgren via GitGitGadget
2026-10-15 13:13 ` [PATCH 3/3] reflog: add --historical-branch to name the branch of each entry Harald Nordgren via GitGitGadget
2026-10-15 14:36 ` [PATCH 0/3] reflog: add --operations and --historical-branch Kristoffer Haugsbakk
2026-10-15 15:24 ` Harald Nordgren
2026-10-15 15:35 ` Kristoffer Haugsbakk
2026-10-15 20:47 ` Harald Nordgren
2026-10-16 18:26 ` D. Ben Knoble
2026-10-23 15:31 ` Harald Nordgren
2026-10-16 18:36 ` D. Ben Knoble
2026-10-17 10:03 ` Harald Nordgren
2026-10-18 18:27 ` [PATCH v2 " Harald Nordgren via GitGitGadget
2026-10-18 18:27 ` [PATCH v2 1/3] reflog: name the strings that mark switches, renames and rebase steps Harald Nordgren via GitGitGadget
2026-10-23 21:19 ` Junio C Hamano
2026-10-23 22:47 ` Harald Nordgren
2026-10-23 22:55 ` Junio C Hamano
2026-10-18 18:27 ` [PATCH v2 2/3] reflog: add --operations to show one entry per command Harald Nordgren via GitGitGadget
2026-10-18 18:27 ` [PATCH v2 3/3] reflog: add --historical-branch to name the branch of each entry Harald Nordgren via GitGitGadget
2026-10-25 19:18 ` Kristoffer Haugsbakk
2026-10-25 20:22 ` Harald Nordgren
2026-10-26 8:39 ` Kristoffer Haugsbakk
2026-10-26 8:42 ` Harald Nordgren
2026-10-23 15:32 ` [PATCH v2 0/3] reflog: add --operations and --historical-branch Harald Nordgren
2026-10-24 13:51 ` Phillip Wood
2026-10-24 15:22 ` D. Ben Knoble
2026-10-24 16:40 ` Junio C Hamano [this message]
2026-10-24 18:46 ` Harald Nordgren
2026-10-25 18:52 ` Kristoffer Haugsbakk
2026-10-26 10:52 ` Phillip Wood
2026-10-26 11:00 ` Harald Nordgren
2026-10-26 15:07 ` Junio C Hamano
2026-10-24 19:12 ` Harald Nordgren
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=xmqq5wyr128q.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=ben.knoble@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitgitgadget@gmail.com \
--cc=haraldnordgren@gmail.com \
--cc=kristofferhaugsbakk@fastmail.com \
--cc=phillip.wood123@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox