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

Re: git stash push/save/create all return exit code 0, even if no object was created

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 22, 2020, 15:50 UTC
Message-ID
<xmqq8sjs8k3k.fsf@gitster.c.googlers.com>
In-Reply-To
<CAHMHMxW=muHe5qqndtdzR_md6KFQqwEonko-2gXC_q973JgB5w@mail.gmail.com>
This has been asked and answered recently at least twice, I think.
https://lore.kernel.org/git/01020169a7ad6af3-ad50e2d1-19fb-46eb-b397-759f8d579e8b-000000@eu-west-1.amazonses.com/
https://lore.kernel.org/git/CADZUK1cjvifbFYk9w6+vE95jgEBuwjoOi_1QfZHoPFBXuXHCCg@mail.gmail.com/

I think these previous ones wanted something more relevant to "git stash", in the sense that they wanted to be able to

	git stash
	do some other things
	do many other things
	if earlier "git stash" produced an entry
		git stash pop

and the answer to that may be "use stash create upfront, save it away yourself in a variable or something, then use that to restore"

But to me your use case does not look like it has much to "git stash". If a user wants to ask "is my working tree and the index dirty (iow, have I made any changes)?", wouldn't "git status" be the right tool for the job? It even has an option to produce output designed to be machine readable.

Previous: Σταύρος ΝτέντοςNext: Σταύρος Ντέντος
Message 2 of 3 in “git stash push/save/create all return exit code 0, even if no object was created”
  1. Σταύρος ΝτέντοςMar 22, 2020
  2. Junio C HamanoMar 22, 2020
  3. Σταύρος ΝτέντοςMar 22, 2020

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.