threads / patch / 64855

patchRe: [PATCH] reset: avoid reflog update on no-op reset

Subject: Re: [PATCH] reset: avoid reflog update on no-op reset

## tl;dr

2 messages between Jan 23, 2026 and Jan 23, 2026. Diffs are folded; open one to read it.

replies: 1people: 2as markdown or json

Pushkar Singh· Jan 23, 2026, 08:54 UTC · lore
Thanks, that makes sense.

I was reasoning about reflog entries purely in terms of reference updates, but I see your point that "git reset" also uses the reflog as a record of user actions, even when the target happens to match HEAD.

In that light, skipping the reflog entry on a no-op reset could indeed break the assumption that "@{1}" reliably refers to "the state before the most recent reset", both for scripts and for humans inspecting history.

I agree that this makes the change questionable as-is. I’m happy to drop this patch, or to rework it in a way that preserves the reflog entry while addressing the underlying concern (if there is one).

Thanks for the detailed explanation.
Junio C Hamano· Jan 23, 2026, 16:18 UTC · re: Pushkar Singh · lore
Pushkar Singh <pushkarkumarsingh1970@gmail.com> writes:
> ... or to rework it in a way that preserves the reflog
> entry while addressing the underlying concern (if there is one).

I am OK as long as this patch does not come back in its current form ;-), but it is curious what "the underlying concern" is. It sounds like you see some problems that need to be addressed if the current "the act of resetting to the same commit is recorded in the reflog", but I am not sure what they are.

Thanks.

← back to recent threads