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, 00:05 UTC
Message-ID
<484C73DA.10804@gmail.com>
In-Reply-To
<alpine.DEB.1.00.0806090033030.1783@racer>
Johannes Schindelin wrote:
Show 10 quoted lines
> Lea Wiemann wrote:
>> -	if (type <= 0)
>> -		return 1;
>> +	if (type <= 0) {
>> +		printf("%s missing\n", obj_name);
>> +		fflush(stdout);
>> +		return 0;
>> +	}
> 
> Is it really intended that it returns 0 now?

Yes, return 0 causes it to not exit (which is the desired effect, as in documented).

> Further, should it not be an error("%s missin...  instead?  It is an 
> error, isn't it?

No, it's not an error. I suggest you read git-cat-file.1 -- getting a response of "<object> missing" (rather than cat-file terminating) if you pass in a non-existent object is the desired behavior, and it happened before for named objects, like "HEAD", but not for full hashes. Now it also happens for full hashes.

-- Lea
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 3 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.