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

Re: [PATCH] stash: --keep option just saves

From
Miles Bader <miles@gnu.org>
Date
Feb 12, 2009, 05:01 UTC
Message-ID
<buovdrgckpa.fsf@dhlpc061.dev.necel.com>
In-Reply-To
<7vljscbp60.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 12 quoted lines
> This one, the "snapshot", and various other related topics, are quite
> different.  The workflow the --keep (and for that matter, "snapshot")
> would support I can think of does not sound a very good one we would want
> to recommend (--untracked is a different issue; I haven't formed an
> opinion).
>
> You build on a branch, but you are forever in the state of indecision, and
> instead of committing, you keep saying "save --keep" number of times to
> leave a checkpoint on your stash.  After number of iterations, you may
> have many stashes in "git stash list", but what you can do with them is
> "git reset --hard && git stash apply stash@{$n}" to go back to any of the
> state, but that is about it.
Yeah, but that's a pretty useful thing.

I often save checkpoints of my working state before starting a tentative/intrusive series of edits -- if they are clearly just part of a larger logical change, I may not want to make separate commits [or perhaps more commonly, I'm not entirely sure what the final commit will be like, and am still "exploring"].

Of course this can also be done in git by doing temporary commits (to be changed later with --amend, or rolled back before making the real commit), or whatever, but I think pretty much every usage of git-stash can be done fairly easily via some other means in git; git-stash is really just a convenience.

-miles
-- 
Politeness, n. The most acceptable hypocrisy.
Previous: Junio C HamanoNext: Nanako Shiraishi
Message 3 of 8 in “stash: --keep option just saves”
  1. stash: --keep option just savesNanako Shiraishi, Feb 11, 2009
  2. Junio C HamanoFeb 11, 2009
  3. Miles BaderFeb 12, 2009
  4. Nanako ShiraishiFeb 12, 2009
  5. Miles BaderFeb 12, 2009
  6. Nanako ShiraishiFeb 12, 2009
  7. Junio C HamanoFeb 12, 2009
  8. Björn SteinbrinkFeb 13, 2009

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.