From: Junio C Hamano Date: Sat, 24 Oct 2026 16:40:05 GMT Subject: Re: [PATCH v2 0/3] reflog: add --operations and --historical-branch Message-ID: In-Reply-To: Phillip Wood 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.