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

Re: [PATCH] git-cat-file: fix output when format string contains no variables

From
SBSven Brauch <svenbrauch@googlemail.com>
Date
Nov 6, 2013, 19:40 UTC
Message-ID
<5085823.Oad8MOHc71@localhost.localdomain>
In-Reply-To
<xmqqsiv98l5y.fsf@gitster.dls.corp.google.com>
On Wednesday 06 November 2013 10:00:57 Junio C Hamano wrote:
> Thanks; first some procedural issues:
Thanks, I will take care of the mentioned points for future submissions.
Show 7 quoted lines
> I think the real problem is that sha1_loose_object_info() is called
> by sha1_object_info_extended(), when it does not find a cached or a
> packed object, and the callee assumes that it is asked to fill in
> only the requested pieces of information while the caller does not
> even bother to check if such an object actually exists.
> 
> How about doing it like the attached instead?

Yes; this seems more like a proper fix. I would prefer it over my suggestion. It is illogical that sha1_loose_object_info sometimes returns an error if the object does not exist and sometimes not, depending on which properties are requested.

Sven
Previous: Jeff King
Message 4 of 4 in “git-cat-file: fix output when format string contains no variables”
  1. git-cat-file: fix output when format string contains no variablesSven Brauch, Nov 5, 2013
  2. Junio C HamanoNov 6, 2013
  3. Jeff KingNov 6, 2013
  4. Sven BrauchNov 6, 2013

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.