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

Re: [PATCH] git-stash: add flag to skip "git reset --hard"

From
Junio C Hamano <gitster@pobox.com>
Date
May 2, 2016, 18:42 UTC
Message-ID
<xmqqeg9kti6x.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<57267BBE.9010707@google.com>
Tom Anderson <thomasanderson@google.com> writes:
Show 8 quoted lines
> @@ -61,6 +61,9 @@ stashed and then cleaned up with `git clean`,
> leaving the working directory
>  in a very clean state. If the `--all` option is used instead then the
>  ignored files are stashed and cleaned in addition to the untracked files.
>  +
> +If the `--no-reset` option is used, `git reset --hard` is skipped and the
> +`--[no-]keep-index`, `--include-untracked`, and `--all` flags are ignored.
> ++

I am afraid that a reader who does not read git-stash.sh script would not know what you are talking about. They do not know (or particularly care) where "git reset --hard", how often and for what purpose. They can tell that this option affects only "save", because that is where it is described, but they would not know what it means to "skip reset --hard", other than that they cannot use the three features listed there.

It is unclear what problem you are trying to solve from this text, and the log message's mention of mtime and rebuilding makes it sound like an X-Y problem.

It could very well be that what you are trying to implement makes perfect sense and the new option is named with a stress on a wrong aspect (i.e. named after what it uses to achieve things, rather than saying what you are trying to achieve).

The workhorse used in "git stash save" (which is what you are touching) is "git stash create", and that is only responsible for recording a new stash entry without touch the working tree. Is that what you are after, perhaps?

Previous: Tom AndersonNext: Tom Anderson
Message 2 of 6 in “git-stash: add flag to skip "git reset --hard"”
  1. git-stash: add flag to skip "git reset --hard"Tom Anderson, May 1, 2016
  2. Junio C HamanoMay 2, 2016
  3. Tom AndersonMay 2, 2016
  4. Junio C HamanoMay 2, 2016
  5. Tom AndersonMay 2, 2016
  6. Junio C HamanoMay 2, 2016

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.