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

[PATCH TopGit] tg-export.sh: support tag objects as parent

From
ABAndrey Borzenkov <arvidjaar@gmail.com>
Date
Mar 17, 2011, 18:30 UTC
Message-ID
<1300386623-31666-1-git-send-email-arvidjaar@gmail.com>
Currently tg-export fails with

Collapsing u/quota-pull fatal: 2770ca86dec8b9cc36bf50127e5aff7f29557e3c is not a valid 'commit' object

Check for and resolve tag objects for parent.
Signed-off-by: Andrey Borzenkov <arvidjaar@gmail.com>
---
 tg-export.sh |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/tg-export.sh b/tg-export.sh
index 486ec94..4574882 100644
--- a/tg-export.sh
+++ b/tg-export.sh
@@ -95,7 +95,8 @@ collapsed_commit()
 	>"$playground/^body"
 
 	# Determine parent
-	parent="$(cut -f 1 "$playground/$name^parents")"
+	parent="$(cut -f 1 "$playground/$name^parents" | \
+		while read p; do [ $(git cat-file -t $p 2> /dev/null) = tag ] && git cat-file tag $p | head -1 | cut -d' ' -f2 || echo $p; done)"
 	if [ "$(cat "$playground/$name^parents" | wc -l)" -gt 1 ]; then
 		# Produce a merge commit first
 		parent="$({
-- 
tg: (9aa66bc..) u/parent-tag (depends on: u/signed-off-by)
Message 1 of 1 in “tg-export.sh: support tag objects as parent”
  1. tg-export.sh: support tag objects as parentAndrey Borzenkov, Mar 17, 2011

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.