git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH TopGit] tg-export.sh: support tag objects as parent
@ 2011-03-17 18:30 Andrey Borzenkov
  0 siblings, 0 replies; only message in thread
From: Andrey Borzenkov @ 2011-03-17 18:30 UTC (permalink / raw
  To: git

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)

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2011-03-17 18:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-17 18:30 [PATCH TopGit] tg-export.sh: support tag objects as parent Andrey Borzenkov

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).