chiark / gitweb /
tg export (collapse): implement skipping empty patches
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Fri, 19 Dec 2008 21:18:37 +0000 (22:18 +0100)
committermartin f. krafft <madduck@debian.org>
Mon, 5 Jan 2009 15:46:51 +0000 (16:46 +0100)
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: martin f. krafft <madduck@debian.org>
README
tg-export.sh

diff --git a/README b/README
index c19985f..8be0d17 100644 (file)
--- 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
index afb6f95..95aa346 100644 (file)
@@ -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"
 }