# [PATCH] tg export: implement skipping empty patches for quilt mode

3 messages from 2008-11-26 to 2008-11-26. Participants: Uwe Kleine-König, martin f krafft.
Thread: https://gitlist.dev/t/16476

## Uwe Kleine-König, 2008-11-26 12:13

Subject: [PATCH] tg export: implement skipping empty patches for quilt mode
Message-ID: <1227701580-9762-1-git-send-email-u.kleine-koenig@pengutronix.de>
URL: https://gitlist.dev/e/1227701580-9762-1-git-send-email-u.kleine-koenig%40pengutronix.de

```
addionally fix the README item for skipping the export of empty patches
not to need an option (-n) as this should be the default.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 README       |    2 +-
 tg-export.sh |   12 ++++++++----
 2 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/README b/README
index 5bfe3ee..9b92d43 100644
--- a/README
+++ b/README
@@ -414,7 +414,7 @@ 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: -n option to prevent exporting of empty patches
+	TODO: prevent exporting of empty patches
 	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 52af88d..f133fb8 100644
--- a/tg-export.sh
+++ b/tg-export.sh
@@ -140,10 +140,14 @@ quilt()
 		return
 	fi
 
-	echo "Exporting $_dep"
-	mkdir -p "$(dirname "$filename")"
-	$tg patch "$_dep" >"$filename"
-	echo "$_dep.diff -p1" >>"$output/series"
+	if branch_empty "$_dep"; then
+		echo "Skip empty patch $_dep";
+	else
+		echo "Exporting $_dep"
+		mkdir -p "$(dirname "$filename")"
+		$tg patch "$_dep" >"$filename"
+		echo "$_dep.diff -p1" >>"$output/series"
+	fi
 }
 
 
-- 
1.5.6.5

```

## martin f krafft, 2008-11-26 20:39

Subject: Re: [PATCH] tg export: implement skipping empty patches for quilt mode
Message-ID: <20081126203959.GB31563@piper.oerlikon.madduck.net>
URL: https://gitlist.dev/e/20081126203959.GB31563%40piper.oerlikon.madduck.net
In-Reply-To: <1227701580-9762-1-git-send-email-u.kleine-koenig@pengutronix.de>

```
also sprach Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [2008.11.26.1313 +0100]:
> addionally fix the README item for skipping the export of empty patches
> not to need an option (-n) as this should be the default.
[...]
> -	TODO: -n option to prevent exporting of empty patches
> +	TODO: prevent exporting of empty patches

Is it still a TODO? Looks like your patch fixes it, no?

-- 
 .''`.   martin f. krafft <madduck@d.o>      Related projects:
: :'  :  proud Debian developer               http://debiansystem.info
`. `'`   http://people.debian.org/~madduck    http://vcs-pkg.org
  `-  Debian - when you have better things to do than fixing systems
 
"the difference between genius and stupidity
 is that genius has it's limits."
                                                    -- albert einstein

```

## Uwe Kleine-König, 2008-11-26 21:19

Subject: Re: [PATCH] tg export: implement skipping empty patches for quilt mode
Message-ID: <20081126211919.GA22474@strlen.de>
URL: https://gitlist.dev/e/20081126211919.GA22474%40strlen.de
In-Reply-To: <20081126203959.GB31563@piper.oerlikon.madduck.net>

```
Hi,

On Wed, Nov 26, 2008 at 09:39:59PM +0100, martin f krafft wrote:
> also sprach Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [2008.11.26.1313 +0100]:
> > addionally fix the README item for skipping the export of empty patches
> > not to need an option (-n) as this should be the default.
> [...]
> > -	TODO: -n option to prevent exporting of empty patches
> > +	TODO: prevent exporting of empty patches
> 
> Is it still a TODO? Looks like your patch fixes it, no?
No, it's still a TODO for the collapse driver.

Best regards
Uwe

```
