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

Re: qgit reports errors in the git repository

From
Linus Torvalds <torvalds@osdl.org>
Date
Dec 13, 2005, 01:06 UTC
Message-ID
<Pine.LNX.4.64.0512121700010.15597@g5.osdl.org>
In-Reply-To
<1134433440.3798.27.camel@dv>
On Mon, 12 Dec 2005, Pavel Roskin wrote:
Show 12 quoted lines
>
> Git says:
> fatal: git-cat-file 23ea3e201cea0deea909569e08e950a9ec2345f7: bad file
> 
> I believe qgit runs "git-cat-file -t tag" on in, but it's a commit.  If
> I change the git-cat-file invocation in  src/git_startup.cpp to use
> "commit" instead of "tag", qgit complains about
> 0918385dbd9656cab0d1d81ba7453d49bbc16250.
> 
> Maybe qgit should check the type of the object first?  Or maybe there
> should another type for git-cat-file that would match both tag and
> commit?

Using "git-cat-file commit <object>" already works for both real commits and for tags that point to commits.

However, the "0918385dbd9656cab0d1d81ba7453d49bbc16250" object is a tag that points to a blob (Junios public gpg key), so you can't use that.

Basically, qgit should do either:
 - check the type of the object by hand first (using "git-cat-file -t" and 
   then follow any tags it finds by hand)
_or_ 
 - just use "git-cat-file commit" and if an error occurs, just silently 
   ignore that ref since it doesn't understand them.
which one is the right strategy depends on usage.
		Linus
Previous: Pavel RoskinNext: Pavel Roskin
Message 2 of 9 in “qgit reports errors in the git repository”
  1. Pavel RoskinDec 13, 2005
  2. Linus TorvaldsDec 13, 2005
  3. Pavel RoskinDec 15, 2005
  4. Pavel RoskinDec 15, 2005
  5. Pavel RoskinDec 16, 2005
  6. Junio C HamanoDec 16, 2005
  7. Junio C HamanoDec 17, 2005
  8. Junio C HamanoDec 17, 2005
  9. Pavel RoskinDec 20, 2005

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.