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 c19985f83d54a72728d0c36413ea7b0a03e52d6e..8be0d17ec0e005ce08693505097e4fa9e38d9131 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 afb6f95ce288fa95825d09a3da87c96366c1f532..95aa346ef014af079c40ff8b397d5bee7e1ffa01 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"
 }