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

Re: git cat-file -e behavior

From
Michal Čihař <michal@cihar.com>
Date
Feb 29, 2016, 12:16 UTC
Message-ID
<56D436A2.4090202@cihar.com>
In-Reply-To
<20160229114455.GD29769@sigill.intra.peff.net>
Hi
Dne 29.2.2016 v 12:44 Jeff King napsal(a):
Show 6 quoted lines
> It looks like it has been this way forever. The first thing we do with
> the object is resolve its name to a sha1, and that's where the error you
> see comes from. And then we actually check whether we have the object.
> 
> I think the intended use was to feed it a sha1 to see if it exists. Then
> the name-resolution step is a noop.

I found this as best way to check whether file exists in branch. Checking git ls-tree output seems less error prone than checking return value of git cat-file -e...

> I'm not sure if the behavior you are seeing is all that bad (the
> documentation could be read as suppressing the normal stdout output, but
> error messages remain), 

I understand this, that's why I'm asking whether it's expected output or not :-).

-- 
	Michal Čihař | http://cihar.com | http://blog.cihar.com
Previous: Jeff KingNext: Jeff King
Message 3 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.