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

Re: [PATCH] git stash: one bug and one feature request

From
Junio C Hamano <gitster@pobox.com>
Date
Jan 5, 2008, 09:06 UTC
Message-ID
<7v7iiod4kw.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<e5bfff550801050025g6758bfb6p751e69e93d4299be@mail.gmail.com>
"Marco Costalba" <mcostalba@gmail.com> writes:
Show 8 quoted lines
> I understand your point. The problem is that in git there isn't an
> unique way to test success/fail for any command, as example, regarding
> checking the exit status:
>
> $ git status; echo $?
> # On branch master
> nothing to commit (working directory clean)
> 1
That is a bad example, with a slight historical background.

When you say "git status $args", you are asking the command this question.

	I am contemplating to issue "git commit $args", but will
	there actually be changes if I issued that command?

When there will be no changes staged with the given $args (in your case that happens to be empty), there won't be anything to be committed if you issued "git commit $args" at that point. The command answers "Eh, by issuing 'git commit' you will get an 'Nothing to commit', which is an error" --- and that is reported with its exit status.

Previous: Marco CostalbaNext: Wayne Davison
Message 11 of 19 in “git stash: one bug and one feature request”
  1. git stash: one bug and one feature requestMarco Costalba, Jan 4, 2008
  2. Brandon CaseyJan 4, 2008
  3. Pascal ObryJan 4, 2008
  4. Jakub NarebskiJan 4, 2008
  5. Brian SwetlandJan 4, 2008
  6. Jeff KingJan 4, 2008
  7. Junio C HamanoJan 5, 2008
  8. Marco CostalbaJan 5, 2008
  9. Junio C HamanoJan 5, 2008
  10. Marco CostalbaJan 5, 2008
  11. Junio C HamanoJan 5, 2008
  12. Wayne DavisonJan 5, 2008
  13. Junio C HamanoJan 5, 2008
  14. Marco CostalbaJan 5, 2008
  15. Brandon CaseyJan 4, 2008
  16. Marco CostalbaJan 4, 2008
  17. Brandon CaseyJan 4, 2008
  18. Marco CostalbaJan 4, 2008
  19. Junio C HamanoJan 5, 2008

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.