Re: [PATCH] reset: avoid reflog update on no-op reset
- From
Pushkar Singh <pushkarkumarsingh1970@gmail.com>
- Date
- Jan 23, 2026, 08:54 UTC
- Message-ID
- <SL2P216MB1885C5C9B75A38AE99E5511DA294A@SL2P216MB1885.KORP216.PROD.OUTLOOK.COM>
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.