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

Re: [PATCH] cat-file --batch / --batch-check: do not exit if hashes are missing

From
LWLea Wiemann <lewiemann@gmail.com>
Date
Jun 9, 2008, 10:17 UTC
Message-ID
<484D033A.3020006@gmail.com>
In-Reply-To
<alpine.DEB.1.00.0806090201090.1783@racer>
Johannes Schindelin wrote:
> That is unexpected.  IMO this is a bug.  rev-parse I can understand, but 
> cat-file not failing when it clearly did not find the object?
 From a recent IRC conversation (with permission):

Dscho thinks that git-cat-file --batch should print an error and exit if passed an invalid revision (as opposed to the current behavior of printing "<object> missing" and continuing), since anything else would be unexpected. [1] He says that an --ignore-missing option should be introduced instead, and cat-file --batch should exit on non-existent objects unless the --ignore-missing option is given.

I maintain that my patch isn't introducing a new feature but fixing a 
bug -- cat-file --batch already doesn't exit but (as documented) prints 
"<object> missing" if passed a non-existent object.  The only exception 
is a full (= 40-character) SHA1 that isn't augmented (e.g. by "^" etc.). 
  This exception is neither useful, expected, nor documented.  Hence, my 
patch fixes this inconsistency.

If Dscho (or anybody else) wants to introduce an --ignore-missing option, feel free to submit it separately, but please don't object to my patch because of it -- my patch is merely fixing the existing code. (Note that such an option is unlikely to make it into the code though, since it would have to change the existing behavior of cat-file --batch, which other programs rely on.)

-- Lea

[1] He says he hasn't read the manual so far though because he doesn't have time for it -- if he had read it (as I repeatedly recommended) he probably wouldn't find the behavior surprising.

Previous: Johannes SchindelinNext: Jakub Narebski
Message 5 of 12 in “cat-file --batch / --batch-check: do not exit if hashes are missing”
  1. cat-file --batch / --batch-check: do not exit if hashes are missingLea Wiemann, Jun 8, 2008
  2. Johannes SchindelinJun 8, 2008
  3. Lea WiemannJun 9, 2008
  4. Johannes SchindelinJun 9, 2008
  5. Lea WiemannJun 9, 2008
  6. Jakub NarebskiJun 9, 2008
  7. Lea WiemannJun 9, 2008
  8. cat-file --batch / --batch-check: do not exit if hashes are missingLea Wiemann, Jun 9, 2008
  9. Junio C HamanoJun 9, 2008
  10. Junio C HamanoJun 9, 2008
  11. Johannes SixtJun 9, 2008
  12. Lea WiemannJun 9, 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.