git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: git@vger.kernel.org
Cc: "martin f. krafft" <madduck@debian.org>, Petr Baudis <pasky@ucw.cz>
Subject: [PATCH TOPGIT] tg export: implement skipping empty patches for collapse driver
Date: Tue, 23 Dec 2008 15:32:22 +0100	[thread overview]
Message-ID: <1230042744-24675-1-git-send-email-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <20081223143035.GA24087@cassiopeia.tralala>

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 README       |    1 -
 tg-export.sh |   10 +++++++---
 2 files changed, 7 insertions(+), 4 deletions(-)

diff --git a/README b/README
index c19985f..8be0d17 100644
--- a/README
+++ b/README
@@ -414,7 +414,6 @@ tg export
 	TODO: Make stripping of non-essential headers configurable
 	TODO: Make stripping of [PATCH] and other prefixes configurable
 	TODO: --mbox option for other mode of operation
-	TODO: prevent exporting of empty patches by the collapse driver
 	TODO: -a option to export all branches
 	TODO: For quilt exporting, use a temporary branch and remove it when
 	      done - this would allow producing conflict-less series
diff --git a/tg-export.sh b/tg-export.sh
index afb6f95..95aa346 100644
--- a/tg-export.sh
+++ b/tg-export.sh
@@ -91,9 +91,13 @@ collapsed_commit()
 			$(for p in $parent; do echo -p $p; done))"
 	fi
 
-	(printf '%s\n\n' "$SUBJECT"; cat "$playground/^msg") |
-	git stripspace |
-	git commit-tree "$(pretty_tree "$name")" -p "$parent"
+	if branch_empty "$name"; then
+		echo "$parent";
+	else
+		(printf '%s\n\n' "$SUBJECT"; cat "$playground/^msg") |
+		git stripspace |
+		git commit-tree "$(pretty_tree "$name")" -p "$parent"
+	fi;
 
 	echo "$name" >>"$playground/^ticker"
 }
-- 
1.5.6.5

  reply	other threads:[~2008-12-23 14:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-12-23 14:30 a few Topgit patches Uwe Kleine-König
2008-12-23 14:32 ` Uwe Kleine-König [this message]
2008-12-23 14:32   ` [PATCH TOPGIT] tg export: Implement flattening patch paths for quilt mode Uwe Kleine-König
2008-12-23 14:32     ` [PATCH TOPGIT] tg export (quilt): Implement numbering the patches Uwe Kleine-König
2008-12-25 14:58 ` a few Topgit patches martin f krafft
2008-12-26 17:03   ` Uwe Kleine-König
2009-01-04 13:05     ` Uwe Kleine-König
2009-01-05 15:49       ` martin f krafft

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=1230042744-24675-1-git-send-email-u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=git@vger.kernel.org \
    --cc=madduck@debian.org \
    --cc=pasky@ucw.cz \
    /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).