git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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.
Next: Junio C Hamano
Message 1 of 2 in “Re: [PATCH] reset: avoid reflog update on no-op reset”
  1. Pushkar SinghJan 23, 2026
  2. Junio C HamanoJan 23, 2026

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.