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

git cat-file -e behavior

From
Michal Čihař <michal@cihar.com>
Date
Feb 29, 2016, 09:58 UTC
Message-ID
<56D41645.4050800@cihar.com>
Hi
the documentation for "git cat-file -e" says:
> Suppress all output; instead exit with zero status if <object> exists
and is a valid object.

However running it on non existing object will complain "fatal: Not a valid object name".

$ git cat-file -e master:README.rst $ echo $? 0 $ git cat-file -e master:foo fatal: Not a valid object name master:foo $ echo $? 128

Is the output in this case expected?
I'm currently running 2.7.0.
-- 
	Michal Čihař | http://cihar.com | http://blog.cihar.com
Next: Jeff King
Message 1 of 5 in “git cat-file -e behavior”
  1. Michal ČihařFeb 29, 2016
  2. Jeff KingFeb 29, 2016
  3. Michal ČihařFeb 29, 2016
  4. Jeff KingFeb 29, 2016
  5. Jeff KingFeb 29, 2016

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.