From: Uwe Kleine-König Date: Fri, 19 Dec 2008 21:18:37 +0000 (+0100) Subject: tg export (collapse): implement skipping empty patches X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=7e24a4aafda160b0715436034d5c8bf6f62ad8bd;p=topgit.git tg export (collapse): implement skipping empty patches Signed-off-by: Uwe Kleine-König Signed-off-by: martin f. krafft --- 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" }