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

Re: qgit reports errors in the git repository

From
PRPavel Roskin <proski@gnu.org>
Date
Dec 15, 2005, 05:27 UTC
Message-ID
<1134624477.5360.6.camel@dv>
In-Reply-To
<Pine.LNX.4.64.0512121700010.15597@g5.osdl.org>
On Mon, 2005-12-12 at 17:06 -0800, Linus Torvalds wrote:
Show 5 quoted lines
> 
> 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)
I'm a complete Qt newbie, but this patch seems to work for me.
Signed-off-by: Pavel Roskin <proski@gnu.org>
diff --git a/src/git_startup.cpp b/src/git_startup.cpp
index e08d466..1f6e9ad 100644
--- a/src/git_startup.cpp
+++ b/src/git_startup.cpp
@@ -111,6 +111,10 @@ bool Git::getRefs() {
 
 		if (itNext != rLst.constEnd() && (*itNext).right(3) == "^{}") {
 			signedTag = true;
+			if (!run("git-cat-file -t " + refSha, &runOutput))
+				continue; // invalid SHA1
+			if (runOutput != "tag\n")
+				continue; // not a tag
 			if (run("git-cat-file tag " + refSha, &runOutput)) {
 				QString msg(runOutput.section("\n\n", 1));
 				if (!msg.isEmpty())
-- 
Regards,
Pavel Roskin
Previous: Linus TorvaldsNext: Pavel Roskin
Message 3 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.