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

Re: Feature request: make reset --hard add something to the reflog

From
brian m. carlson <sandals@crustytoothpaste.net>
Date
May 19, 2025, 21:35 UTC
Message-ID
<aCukFlfmQcxRSqGz@tapette.crustytoothpaste.net>
In-Reply-To
<xmqqjz6cmgt4.fsf@gitster.g>
On 2025-05-19 at 21:28:07, Junio C Hamano wrote:
Show 5 quoted lines
> I do not offhand have a strong objection for the _feature_, but if
> the implementation uses the default "stash", that is a bit
> worrysome, as anybody, even a script, using "reset --hard" would add
> a new stash entry, shifting the end-user's expectation of what the
> Nth stash entry records behind user's back.

Yes, this would need to live under a different ref. We could use the same stash machinery, though, with a small refactor.

> Doesn't "reset --hard" add record to the reflog already, by the way?
> I agree that a way to recover the local modifications that "reset
> --hard" is designed to get rid of is a good addition.  I just do not
> know what the best vehicle to store the local modifications is.

It does, at least when it changes HEAD. But it doesn't preserve the local modifications anywhere, which is really the request that's being made.

-- 
brian m. carlson (they/them)
Toronto, Ontario, CA
Previous: Junio C Hamano
Message 4 of 4 in “Feature request: make reset --hard add something to the reflog”
  1. Josh Bleecher SnyderMay 19, 2025
  2. brian m. carlsonMay 19, 2025
  3. Junio C HamanoMay 19, 2025
  4. brian m. carlsonMay 19, 2025

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.