git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrey Borzenkov <arvidjaar@gmail.com>
To: git@vger.kernel.org
Subject: [PATCH TopGit] tg-export.sh: support tag objects as parent
Date: Thu, 17 Mar 2011 21:30:23 +0300	[thread overview]
Message-ID: <1300386623-31666-1-git-send-email-arvidjaar@gmail.com> (raw)

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)

                 reply	other threads:[~2011-03-17 18:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1300386623-31666-1-git-send-email-arvidjaar@gmail.com \
    --to=arvidjaar@gmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).