{"thread":{"id":"16850","subject":"a few Topgit patches","startedAt":"2008-12-23T14:30:35Z","lastAt":"2009-01-05T15:49:30Z","messageCount":8,"participants":["Uwe Kleine-König","martin f krafft"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"98610","messageId":"20081223143035.GA24087@cassiopeia.tralala","threadId":"16850","inReplyTo":null,"subject":"a few Topgit patches","fromName":"Uwe Kleine-König","fromEmail":"u.kleine-koenig@pengutronix.de","sentAt":"2008-12-23T14:30:35Z","receivedAt":"2008-12-23T14:30:35Z","isPatch":false,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"Hello,\n\nI hacked using topgit for some time now, and found the following changes\nto topgit useful:\n\nUwe Kleine-König (3):\n      tg export: implement skipping empty patches for collapse driver\n      tg export: Implement flattening patch paths for quilt mode\n      tg export (quilt): Implement numbering the patches\n\n README       |    1 -\n tg-export.sh |   52 ++++++++++++++++++++++++++++++++++++++++++++--------\n 2 files changed, 44 insertions(+), 9 deletions(-)\n\nYou can fetch or pull these from\n\n\tgit://git.pengutronix.de/git/ukl/topgit.git master\n\nor browse them using the following URL:\n\n\thttp://git.pengutronix.de/?p=ukl/topgit.git\n\nFor review I send the patches as a reply to this mail.\n\nBest regards\nUwe\n\n-- \nPengutronix e.K.                              | Uwe Kleine-König           |\nIndustrial Linux Solutions                    | http://www.pengutronix.de/ |\n"},{"id":"98611","messageId":"1230042744-24675-1-git-send-email-u.kleine-koenig@pengutronix.de","threadId":"16850","inReplyTo":"20081223143035.GA24087@cassiopeia.tralala","subject":"[PATCH TOPGIT] tg export: implement skipping empty patches for collapse driver","fromName":"Uwe Kleine-König","fromEmail":"u.kleine-koenig@pengutronix.de","sentAt":"2008-12-23T14:32:22Z","receivedAt":"2008-12-23T14:32:22Z","isPatch":true,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>\n---\n README       |    1 -\n tg-export.sh |   10 +++++++---\n 2 files changed, 7 insertions(+), 4 deletions(-)\n\ndiff --git a/README b/README\nindex c19985f..8be0d17 100644\n--- a/README\n+++ b/README\n@@ -414,7 +414,6 @@ 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: prevent exporting of empty patches by the collapse driver\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 afb6f95..95aa346 100644\n--- a/tg-export.sh\n+++ b/tg-export.sh\n@@ -91,9 +91,13 @@ collapsed_commit()\n \t\t\t$(for p in $parent; do echo -p $p; done))\"\n \tfi\n \n-\t(printf '%s\\n\\n' \"$SUBJECT\"; cat \"$playground/^msg\") |\n-\tgit stripspace |\n-\tgit commit-tree \"$(pretty_tree \"$name\")\" -p \"$parent\"\n+\tif branch_empty \"$name\"; then\n+\t\techo \"$parent\";\n+\telse\n+\t\t(printf '%s\\n\\n' \"$SUBJECT\"; cat \"$playground/^msg\") |\n+\t\tgit stripspace |\n+\t\tgit commit-tree \"$(pretty_tree \"$name\")\" -p \"$parent\"\n+\tfi;\n \n \techo \"$name\" >>\"$playground/^ticker\"\n }\n-- \n1.5.6.5\n"},{"id":"98612","messageId":"1230042744-24675-2-git-send-email-u.kleine-koenig@pengutronix.de","threadId":"16850","inReplyTo":"1230042744-24675-1-git-send-email-u.kleine-koenig@pengutronix.de","subject":"[PATCH TOPGIT] tg export: Implement flattening patch paths for quilt mode","fromName":"Uwe Kleine-König","fromEmail":"u.kleine-koenig@pengutronix.de","sentAt":"2008-12-23T14:32:23Z","receivedAt":"2008-12-23T14:32:23Z","isPatch":true,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"The result of providing the new flag -f is that the exported patches are\nall placed directly in the output directory, not in subdirectories.\n\nSigned-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>\n---\n tg-export.sh |   23 ++++++++++++++++++++---\n 1 files changed, 20 insertions(+), 3 deletions(-)\n\ndiff --git a/tg-export.sh b/tg-export.sh\nindex 95aa346..06b9c8d 100644\n--- a/tg-export.sh\n+++ b/tg-export.sh\n@@ -7,6 +7,7 @@ name=\n branches=\n output=\n driver=collapse\n+flatten=false\n \n \n ## Parse options\n@@ -16,6 +17,8 @@ while [ -n \"$1\" ]; do\n \tcase \"$arg\" in\n \t-b)\n \t\tbranches=\"$1\"; shift;;\n+\t-f)\n+\t\tflatten=true;;\n \t--quilt)\n \t\tdriver=quilt;;\n \t--collapse)\n@@ -34,6 +37,9 @@ done\n [ -z \"$branches\" -o \"$driver\" = \"quilt\" ] ||\n \tdie \"-b works only with the quilt driver\"\n \n+[ \"$driver\" = \"quilt\" ] || ! \"$flatten\" ||\n+\tdie \"-f works only with the quilt driver\"\n+\n if [ -z \"$branches\" ]; then\n \t# this check is only needed when no branches have been passed\n \tname=\"$(git symbolic-ref HEAD | sed 's#^refs/heads/##')\"\n@@ -138,7 +144,18 @@ quilt()\n \t\treturn\n \tfi\n \n-\tfilename=\"$output/$_dep.diff\"\n+\tif \"$flatten\"; then\n+\t\tbn=\"$(echo \"$_dep.diff\" | sed -e 's#_#__#g' -e 's#/#_#g')\";\n+\t\tdn=\"\";\n+\telse\n+\t\tbn=\"$(basename \"$_dep.diff\")\";\n+\t\tdn=\"$(dirname \"$_dep.diff\")/\";\n+\t\tif [ \"x$dn\" = \"x./\" ]; then\n+\t\t\tdn=\"\";\n+\t\tfi;\n+\tfi;\n+\n+\tfilename=\"$output/$dn$bn\";\n \tif [ -e \"$filename\" ]; then\n \t\t# We've already seen this dep\n \t\treturn\n@@ -148,9 +165,9 @@ quilt()\n \t\techo \"Skip empty patch $_dep\";\n \telse\n \t\techo \"Exporting $_dep\"\n-\t\tmkdir -p \"$(dirname \"$filename\")\"\n+\t\tmkdir -p \"$output/$dn\";\n \t\t$tg patch \"$_dep\" >\"$filename\"\n-\t\techo \"$_dep.diff -p1\" >>\"$output/series\"\n+\t\techo \"$dn$bn -p1\" >>\"$output/series\"\n \tfi\n }\n \n-- \n1.5.6.5\n"},{"id":"98613","messageId":"1230042744-24675-3-git-send-email-u.kleine-koenig@pengutronix.de","threadId":"16850","inReplyTo":"1230042744-24675-2-git-send-email-u.kleine-koenig@pengutronix.de","subject":"[PATCH TOPGIT] tg export (quilt): Implement numbering the patches","fromName":"Uwe Kleine-König","fromEmail":"u.kleine-koenig@pengutronix.de","sentAt":"2008-12-23T14:32:24Z","receivedAt":"2008-12-23T14:32:24Z","isPatch":true,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"To ease sending patches, with -n each patch gets a number prefix similar\nto git format-patch.\n\nSigned-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>\n---\n tg-export.sh |   21 ++++++++++++++++++---\n 1 files changed, 18 insertions(+), 3 deletions(-)\n\ndiff --git a/tg-export.sh b/tg-export.sh\nindex 06b9c8d..7a7d87a 100644\n--- a/tg-export.sh\n+++ b/tg-export.sh\n@@ -8,6 +8,7 @@ branches=\n output=\n driver=collapse\n flatten=false\n+numbered=false\n \n \n ## Parse options\n@@ -19,6 +20,9 @@ while [ -n \"$1\" ]; do\n \t\tbranches=\"$1\"; shift;;\n \t-f)\n \t\tflatten=true;;\n+\t-n)\n+\t\tflatten=true;\n+\t\tnumbered=true;;\n \t--quilt)\n \t\tdriver=quilt;;\n \t--collapse)\n@@ -37,6 +41,9 @@ done\n [ -z \"$branches\" -o \"$driver\" = \"quilt\" ] ||\n \tdie \"-b works only with the quilt driver\"\n \n+[ \"$driver\" = \"quilt\" ] || ! \"$numbered\" ||\n+\tdie \"-n works only with the quilt driver\";\n+\n [ \"$driver\" = \"quilt\" ] || ! \"$flatten\" ||\n \tdie \"-f works only with the quilt driver\"\n \n@@ -155,18 +162,26 @@ quilt()\n \t\tfi;\n \tfi;\n \n-\tfilename=\"$output/$dn$bn\";\n-\tif [ -e \"$filename\" ]; then\n+\tif [ -e \"$playground/$_dep\" ]; then\n \t\t# We've already seen this dep\n \t\treturn\n \tfi\n \n+\tmkdir -p \"$playground/$(dirname \"$_dep\")\";\n+\ttouch \"$playground/$_dep\";\n+\n \tif branch_empty \"$_dep\"; then\n \t\techo \"Skip empty patch $_dep\";\n \telse\n+\t\tif \"$numbered\"; then\n+\t\t\tnumber=\"$(printf \"%04u\" $(($(cat \"$playground/^number\" 2>/dev/null) + 1)))\";\n+\t\t\tbn=\"$number-$bn\";\n+\t\t\techo \"$number\" >\"$playground/^number\";\n+\t\tfi;\n+\n \t\techo \"Exporting $_dep\"\n \t\tmkdir -p \"$output/$dn\";\n-\t\t$tg patch \"$_dep\" >\"$filename\"\n+\t\t$tg patch \"$_dep\" >\"$output/$dn$bn\"\n \t\techo \"$dn$bn -p1\" >>\"$output/series\"\n \tfi\n }\n-- \n1.5.6.5\n"},{"id":"98692","messageId":"20081225145834.GA16852@lapse.rw.madduck.net","threadId":"16850","inReplyTo":"20081223143035.GA24087@cassiopeia.tralala","subject":"Re: a few Topgit patches","fromName":"martin f krafft","fromEmail":"madduck@debian.org","sentAt":"2008-12-25T14:58:34Z","receivedAt":"2008-12-25T14:58:34Z","isPatch":false,"sender":{"key":"madduck@debian.org","avatar":null},"body":"also sprach Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [2008.12.23.1530 +0100]:\n> I hacked using topgit for some time now, and found the following changes\n> to topgit useful:\n> \n> Uwe Kleine-König (3):\n>       tg export: implement skipping empty patches for collapse driver\n>       tg export: Implement flattening patch paths for quilt mode\n>       tg export (quilt): Implement numbering the patches\n\nThey all look good. I am a bit concerned about the use of\nsingle-letter options at this stage. tg-export is bound to grow, and\nusing them all up now might mean breaking compatibility later, when\na more common option needs e.g. -f, which has already been taken.\n\n-- \n .''`.   martin f. krafft <madduck@d.o>      Related projects:\n: :'  :  proud Debian developer               http://debiansystem.info\n`. `'`   http://people.debian.org/~madduck    http://vcs-pkg.org\n  `-  Debian - when you have better things to do than fixing systems\n \n\"oh what a tangled web we weave,\n when first we practice to deceive.\n but my how we improve the score,\n as we practice more and more.\"\n                                                   -- sir walter scott\n"},{"id":"98735","messageId":"20081226170334.GA18722@pengutronix.de","threadId":"16850","inReplyTo":"20081225145834.GA16852@lapse.rw.madduck.net","subject":"Re: a few Topgit patches","fromName":"Uwe Kleine-König","fromEmail":"u.kleine-koenig@pengutronix.de","sentAt":"2008-12-26T17:03:34Z","receivedAt":"2008-12-26T17:03:34Z","isPatch":false,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"Hi martin,\n\nOn Thu, Dec 25, 2008 at 03:58:34PM +0100, martin f krafft wrote:\n> also sprach Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [2008.12.23.1530 +0100]:\n> > I hacked using topgit for some time now, and found the following changes\n> > to topgit useful:\n> > \n> > Uwe Kleine-König (3):\n> >       tg export: implement skipping empty patches for collapse driver\n> >       tg export: Implement flattening patch paths for quilt mode\n> >       tg export (quilt): Implement numbering the patches\n> \n> They all look good. I am a bit concerned about the use of\n> single-letter options at this stage. tg-export is bound to grow, and\n> using them all up now might mean breaking compatibility later, when\n> a more common option needs e.g. -f, which has already been taken.\nI updated my tree to make '-f' '--flatten'.  IMHO -n is nice for getting\nnumbered patches, but if you prefer, I will make this --numbered.\n\nOh, and I just noticed that documentation is missing.  I will fix this\nwhen I sent this mail.\n\nBest regards\nUwe\n\n-- \nPengutronix e.K.                              | Uwe Kleine-König            |\nIndustrial Linux Solutions                    | http://www.pengutronix.de/  |\nPeiner Strasse 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |\nAmtsgericht Hildesheim, HRA 2686              | Fax:   +49-5121-206917-5555 |\n"},{"id":"99301","messageId":"20090104130532.GA1055@pengutronix.de","threadId":"16850","inReplyTo":"20081226170334.GA18722@pengutronix.de","subject":"Re: a few Topgit patches","fromName":"Uwe Kleine-König","fromEmail":"u.kleine-koenig@pengutronix.de","sentAt":"2009-01-04T13:05:32Z","receivedAt":"2009-01-04T13:05:32Z","isPatch":false,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"Hi martin,\n\nOn Fri, Dec 26, 2008 at 06:03:34PM +0100, Uwe Kleine-König wrote:\n> On Thu, Dec 25, 2008 at 03:58:34PM +0100, martin f krafft wrote:\n> > also sprach Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [2008.12.23.1530 +0100]:\n> > > I hacked using topgit for some time now, and found the following changes\n> > > to topgit useful:\n> > > \n> > > Uwe Kleine-König (3):\n> > >       tg export: implement skipping empty patches for collapse driver\n> > >       tg export: Implement flattening patch paths for quilt mode\n> > >       tg export (quilt): Implement numbering the patches\n> > \n> > They all look good. I am a bit concerned about the use of\n> > single-letter options at this stage. tg-export is bound to grow, and\n> > using them all up now might mean breaking compatibility later, when\n> > a more common option needs e.g. -f, which has already been taken.\n> I updated my tree to make '-f' '--flatten'.  IMHO -n is nice for getting\n> numbered patches, but if you prefer, I will make this --numbered.\n> \n> Oh, and I just noticed that documentation is missing.  I will fix this\n> when I sent this mail.\nThis is done.  Now I even changed '-n' to '--numbered' and changed the\ncommit log accordingly.  Are there still concerns about my patches?\nShould I resend the current version?\n\nThe patches are still available in my topgit repo at\n\n\tgit://git.pengutronix.de/git/ukl/topgit.git master\n\nBest regards\nUwe\n\n-- \nPengutronix e.K.                              | Uwe Kleine-König            |\nIndustrial Linux Solutions                    | http://www.pengutronix.de/  |\nPeiner Strasse 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |\nAmtsgericht Hildesheim, HRA 2686              | Fax:   +49-5121-206917-5555 |\n"},{"id":"99366","messageId":"20090105154930.GD26178@piper.oerlikon.madduck.net","threadId":"16850","inReplyTo":"20090104130532.GA1055@pengutronix.de","subject":"Re: a few Topgit patches","fromName":"martin f krafft","fromEmail":"madduck@debian.org","sentAt":"2009-01-05T15:49:30Z","receivedAt":"2009-01-05T15:49:30Z","isPatch":false,"sender":{"key":"madduck@debian.org","avatar":null},"body":"also sprach Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [2009.01.04.1405 +0100]:\n> This is done.  Now I even changed '-n' to '--numbered' and changed the\n> commit log accordingly.  Are there still concerns about my patches?\n> Should I resend the current version?\n> \n> The patches are still available in my topgit repo at\n> \n> \tgit://git.pengutronix.de/git/ukl/topgit.git master\n\nI pulled and pushed them. Thanks.\n\n-- \n .''`.   martin f. krafft <madduck@d.o>      Related projects:\n: :'  :  proud Debian developer               http://debiansystem.info\n`. `'`   http://people.debian.org/~madduck    http://vcs-pkg.org\n  `-  Debian - when you have better things to do than fixing systems\n \nsed -e '/^[when][coders]/!d' \\\n    -e '/^...[discover].$/d' \\\n    -e '/^..[real].[code]$/!d' \\\n    /usr/share/dict/words\n"}]}