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

Re: [RFD/PATCH] stash: introduce checkpoint mode

From
Kyle J. McKay <mackyle@gmail.com>
Date
Feb 19, 2015, 23:43 UTC
Message-ID
<04CB0145-FE99-46EB-8430-069E05DF31EB@gmail.com>
In-Reply-To
<xmqq7fvd23mw.fsf@gitster.dls.corp.google.com>
On Feb 19, 2015, at 09:49, Junio C Hamano wrote:
Show 18 quoted lines
> "Kyle J. McKay" <mackyle@gmail.com> writes:
>
>> What about a shortcut to "reset-and-apply" as well?
>>
>> I have often been frustrated when "git stash apply" refuses to work
>> because I have changes that would be stepped on and there's no -- 
>> force
>> option like git checkout has.  I end up doing a reset just so I can
>> run stash apply.
>
> Doesn't that cut both ways, though?
>
> A single step short-cut, done in any way other than a more explicit
> way such as "git reset --hard && git stash apply" (e.g. "git stash
> reset-and-apply" or "git stash apply --force") that makes it crystal
> clear that the user _is_ discarding, has a risk of encouraging users
> to form a dangerous habit of invoking the short-cut without thinking
> and leading to "oops, I didn't mean that!".

Does that reasoning not also apply to the plethora of commands that take "--force" already?

I didn't check them all, but tag, checkout, push and branch immediately come to mind. Why is it okay for all those other commands to have a --force mode, but not git stash?

Previous: Junio C Hamano
Message 11 of 11 in “Experience with Recovering From User Error (And suggestions for improvements)”
  1. Armin RonacherFeb 16, 2015
  2. Ævar Arnfjörð BjarmasonFeb 16, 2015
  3. Ævar Arnfjörð BjarmasonFeb 16, 2015
  4. Duy NguyenFeb 16, 2015
  5. Armin RonacherFeb 16, 2015
  6. Michael J GruberFeb 18, 2015
  7. Michael J GruberFeb 19, 2015
  8. stash: introduce checkpoint modeMichael J Gruber, Feb 19, 2015
  9. Kyle J. McKayFeb 19, 2015
  10. Junio C HamanoFeb 19, 2015
  11. Kyle J. McKayFeb 19, 2015

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.