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

Re: [PATCH] Add 'preserve' subcommand to 'git stash'

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 17, 2023, 11:21 UTC
Message-ID
<xmqqwn02qqp4.fsf@gitster.g>
In-Reply-To
<ZI1xLwemOs9Vxorf@ugly>
Oswald Buddenhagen <oswald.buddenhagen@gmx.de> writes:
Show 5 quoted lines
> i may be totally wrong about it (because i don't understand the
> motivation behind this feature, either), but i think the _intent_ of
> nadav's patch is to merely expose the first half of "stash push" (the
> other half is the implicit "reset --hard"). it may not be a
> sufficiently good one, but there is clearly an analogy here.

I do agree that it would be reasonable to want to expose the first half (the other half is "now the local mod got saved in a stash, adjust the working tree and/or the index"), but then that means the code should cover the various operating modes we have, and let the users perform their first half, so that the second half (which by the way needs to be exposed by another series later) can be used on top of the result to emulate as if the combined two (i.e. "stash save/push") have been run, for the feature to be complete, no?

Lack of the second half can be excused away with "let's do these one step at a time", but the analogy fails to hold with an incomplete coverage of even the first half, I am afraid.

But as you said, I think the lack of concrete "here is how this feature is expected to be used and why it is useful because it allows us to do X that we haven't been able to before" is the largest first issue in the posted patch, as that leaves reviewers guessing without feeling they "understand the motivation behind" the feature. Such an understanding would help us to tell where to stop (maybe in certain modes doing only the "first half" does not make sense because the corresponding "second half" inherently does not exist for some reason, in which case it is fine not to support such a mode that is supported by "stash push").

Previous: Oswald BuddenhagenNext: Nadav Goldstein
Message 6 of 10 in “Add 'preserve' subcommand to 'git stash'”
  1. Add 'preserve' subcommand to 'git stash'Nadav Goldstein via GitGitGadget, Jun 16, 2023
  2. Junio C HamanoJun 16, 2023
  3. Oswald BuddenhagenJun 16, 2023
  4. Junio C HamanoJun 16, 2023
  5. Oswald BuddenhagenJun 17, 2023
  6. Junio C HamanoJun 17, 2023
  7. Nadav GoldsteinJun 18, 2023
  8. Oswald BuddenhagenJun 18, 2023
  9. Nadav GoldsteinJun 18, 2023
  10. Junio C HamanoJun 19, 2023

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.