{"thread":{"id":"16475","subject":"[PATCH] tg export: implement skipping empty patches for quilt mode","startedAt":"2008-11-26T12:12:32Z","lastAt":"2008-11-26T12:12:32Z","messageCount":1,"participants":["Uwe Kleine-König"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"96538","messageId":"1227701552-9702-1-git-send-email-u.kleine-koenig@pengutronix.de","threadId":"16475","inReplyTo":"20081126102507.GA29100@piper.oerlikon.madduck.net","subject":"[PATCH] tg export: implement skipping empty patches for quilt mode","fromName":"Uwe Kleine-König","fromEmail":"u.kleine-koenig@pengutronix.de","sentAt":"2008-11-26T12:12:32Z","receivedAt":"2008-11-26T12:12:32Z","isPatch":true,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"From: Uwe Kleine-König <ukleinek@strlen.de>\n\naddionally fix the README item for skipping the export of empty patches\nnot to need an option (-n) as this should be the default.\n\nSigned-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>\n---\n README       |    2 +-\n tg-export.sh |   12 ++++++++----\n 2 files changed, 9 insertions(+), 5 deletions(-)\n\ndiff --git a/README b/README\nindex 5bfe3ee..9b92d43 100644\n--- a/README\n+++ b/README\n@@ -414,7 +414,7 @@ tg export\n \tTODO: Make stripping of non-essential headers configurable\n \tTODO: Make stripping of [PATCH] and other prefixes configurable\n \tTODO: --mbox option for other mode of operation\n-\tTODO: -n option to prevent exporting of empty patches\n+\tTODO: prevent exporting of empty patches\n \tTODO: -a option to export all branches\n \tTODO: For quilt exporting, use a temporary branch and remove it when\n \t      done - this would allow producing conflict-less series\ndiff --git a/tg-export.sh b/tg-export.sh\nindex 52af88d..f133fb8 100644\n--- a/tg-export.sh\n+++ b/tg-export.sh\n@@ -140,10 +140,14 @@ quilt()\n \t\treturn\n \tfi\n \n-\techo \"Exporting $_dep\"\n-\tmkdir -p \"$(dirname \"$filename\")\"\n-\t$tg patch \"$_dep\" >\"$filename\"\n-\techo \"$_dep.diff -p1\" >>\"$output/series\"\n+\tif branch_empty \"$_dep\"; then\n+\t\techo \"Skip empty patch $_dep\";\n+\telse\n+\t\techo \"Exporting $_dep\"\n+\t\tmkdir -p \"$(dirname \"$filename\")\"\n+\t\t$tg patch \"$_dep\" >\"$filename\"\n+\t\techo \"$_dep.diff -p1\" >>\"$output/series\"\n+\tfi\n }\n \n \n-- \n1.5.6.5\n"}]}