git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH TOPGIT] tg export: implement skipping empty patches for collapse driver

From
Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Date
Dec 23, 2008, 14:32 UTC
Message-ID
<1230042744-24675-1-git-send-email-u.kleine-koenig@pengutronix.de>
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
Previous: Uwe Kleine-KönigNext: Uwe Kleine-König
Message 2 of 8 in “a few Topgit patches”
  1. Uwe Kleine-KönigDec 23, 2008
  2. tg export: implement skipping empty patches for collapse driverUwe Kleine-König, Dec 23, 2008
  3. tg export: Implement flattening patch paths for quilt modeUwe Kleine-König, Dec 23, 2008
  4. tg export (quilt): Implement numbering the patchesUwe Kleine-König, Dec 23, 2008
  5. martin f krafftDec 25, 2008
  6. Uwe Kleine-KönigDec 26, 2008
  7. Uwe Kleine-KönigJan 4, 2009
  8. martin f krafftJan 5, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.