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

Resurrecting an old git-stash discussion

From
David Aguilar <davvid@gmail.com>
Date
May 4, 2009, 01:35 UTC
Message-ID
<20090504013554.GE50640@gmail.com>

A long time ago there was a patch that made git-stash configurable:

http://lists.zerezo.com/git/msg641406.html
Junio's conclusion at the time was:

"The decision here is that I am open to a change that implements the one-time safety instruction."

http://lists.zerezo.com/git/msg641442.html

Would this be something worth implementing after this release cycle?

If so, would this be the basic logic?:
If stash.quick is undefined:
- Alert the user to what's going on
- Ask them whether they'd like to enable the quick behavior,
  or exit (thus leaving stash.quick undefined).

Valid values for stash.quick are then either undefined or 'save'.

Is it still a good idea to implement the one-time safety instruction?

I just thought I'd ask. Why? A co-worker ran into this funny situation last week:

	git branch
	git stash  # oops, didn't mean that
	git stash help # prints usage, though only by luck
	git branch help # oops, didn't mean that

There's a limit to guarding against the uneducated and by no means do I think the 2nd "oops"'s behavior should be changed. With the proposed change we would've warned him at the first "oops", and that's better than nothing.

The above is a silly example despite the fact that it actually happened. 'rm help' happily removes your 'help' file. I just figured I'd mention it since maybe instead of printing usage stash should also warn:

	Error: unknown command 'help'.
	Run 'git help stash' for more information.
Regarding the 'first time warning' thing:
  97bc00a: Emit helpful status for accidental "git stash" save

..seems like it already addressed the issue by telling users how to apply the stash. That makes the case for the first-time-warning much less compelling.

Hmm.. maybe I just answered my own question ;)

The "unknown command 'help'" thing might be good nonetheless, though.

-- 
		David
Message 1 of 1 in “Resurrecting an old git-stash discussion”
  1. David AguilarMay 4, 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.