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, 00:29 UTC
Message-ID
<7vy7b5glmr.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<e5bfff550801040814n82f34b2g17c485a207093440@mail.gmail.com>
"Marco Costalba" <mcostalba@gmail.com> writes:
> Otherwise git-stash is unusable by scripts that check
> stderr to detect fail/success of launched command.

Sorry, but I happen to disagree with your notion of "having something on stderr is an error" to begin with. I think scripts written that way are either simply bogus, or are working around a defect in the underlying command it calls (perhaps it does not signal error with exit status properly).

A command that produces machine parsable output should write that out to stdout, and if it needs to emit other informational messages meant for human consumption (this includes progress bars), that should be sent to stderr so that scripts can get the meat of the output without having to filter cruft out.

If the command does not signal an error by exiting with non-zero status, that would be a bug indeed and you can fix that instead, I think.

Previous: Jeff KingNext: Marco Costalba
Message 7 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.