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

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Lea Wiemann
Date: Monday, June 9, 2008 - 3:17 am

Johannes Schindelin wrote:

 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.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] cat-file --batch / --batch-check: do not exit ..., Johannes Schindelin, (Sun Jun 8, 4:34 pm)
Re: [PATCH] cat-file --batch / --batch-check: do not exit ..., Johannes Schindelin, (Sun Jun 8, 6:02 pm)
Re: [PATCH] cat-file --batch / --batch-check: do not exit ..., Lea Wiemann, (Mon Jun 9, 3:17 am)