{"thread":{"id":"17176","subject":"[PATCH] [TOPGIT] make creating a commit from a topgit branch a function","startedAt":"2009-01-14T21:27:22Z","lastAt":"2009-01-22T00:13:54Z","messageCount":7,"participants":["Uwe Kleine-König","martin f krafft"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"100484","messageId":"1231968443-13960-1-git-send-email-u.kleine-koenig@pengutronix.de","threadId":"17176","inReplyTo":null,"subject":"[PATCH] [TOPGIT] make tg remote idempotent","fromName":"Uwe Kleine-König","fromEmail":"u.kleine-koenig@pengutronix.de","sentAt":"2009-01-14T21:27:22Z","receivedAt":"2009-01-14T21:27:22Z","isPatch":true,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"Before this patch each call to tg remote added three config entries\nno matter if they already existed.  After some time my .git/config was\ncrowded.\n\nSigned-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>\n---\n tg-remote.sh |    6 +++---\n 1 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/tg-remote.sh b/tg-remote.sh\nindex c3e8bd3..7f7a1b0 100644\n--- a/tg-remote.sh\n+++ b/tg-remote.sh\n@@ -27,9 +27,9 @@ git config \"remote.$name.url\" >/dev/null || die \"unknown remote '$name'\"\n \n ## Configure the remote\n \n-git config --add \"remote.$name.fetch\" \"+refs/top-bases/*:refs/remotes/$name/top-bases/*\"\n-git config --add \"remote.$name.push\" \"+refs/top-bases/*:refs/top-bases/*\"\n-git config --add \"remote.$name.push\" \"+refs/heads/*:refs/heads/*\"\n+git config --replace-all \"remote.$name.fetch\" \"+refs/top-bases/*:refs/remotes/$name/top-bases/*\" \"+refs/top-bases/*:refs/remotes/$name/top-bases/*\"\n+git config --replace-all \"remote.$name.push\" \"+refs/top-bases/*:refs/top-bases/*\" \"+refs/top-bases/*:refs/top-bases/*\"\n+git config --replace-all \"remote.$name.push\" \"+refs/heads/*:refs/heads/*\" \"+refs/heads/*:refs/heads/*\"\n \n info \"Remote $name can now follow TopGit topic branches.\"\n if [ -z \"$populate\" ]; then\n-- \n1.5.6.5\n"},{"id":"100483","messageId":"1231968443-13960-2-git-send-email-u.kleine-koenig@pengutronix.de","threadId":"17176","inReplyTo":"1231968443-13960-1-git-send-email-u.kleine-koenig@pengutronix.de","subject":"[PATCH] [TOPGIT] make creating a commit from a topgit branch a function","fromName":"Uwe Kleine-König","fromEmail":"u.kleine-koenig@pengutronix.de","sentAt":"2009-01-14T21:27:23Z","receivedAt":"2009-01-14T21:27:23Z","isPatch":true,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"This helps avoiding code duplication for the next commit.\n\nSigned-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>\n---\n tg-export.sh |   27 ++++++++++++++++++---------\n 1 files changed, 18 insertions(+), 9 deletions(-)\n\ndiff --git a/tg-export.sh b/tg-export.sh\nindex 9e6940f..dea24d9 100644\n--- a/tg-export.sh\n+++ b/tg-export.sh\n@@ -71,14 +71,11 @@ pretty_tree()\n \t git write-tree)\n }\n \n-# collapsed_commit NAME\n-# Produce a collapsed commit of branch NAME.\n-collapsed_commit()\n+create_tg_commit()\n {\n \tname=\"$1\"\n-\n-\trm -f \"$playground/^pre\" \"$playground/^post\"\n-\t>\"$playground/^body\"\n+\ttree=\"$2\"\n+\tparent=\"$3\"\n \n \t# Get commit message and authorship information\n \tgit cat-file blob \"$name:.topmsg\" | git mailinfo \"$playground/^msg\" /dev/null > \"$playground/^info\"\n@@ -92,6 +89,20 @@ collapsed_commit()\n \ttest -n \"$GIT_AUTHOR_EMAIL\" && export GIT_AUTHOR_EMAIL\n \ttest -n \"$GIT_AUTHOR_DATE\" && export GIT_AUTHOR_DATE\n \n+\t(printf '%s\\n\\n' \"$SUBJECT\"; cat \"$playground/^msg\") |\n+\tgit stripspace |\n+\tgit commit-tree \"$tree\" -p \"$parent\"\n+}\n+\n+# collapsed_commit NAME\n+# Produce a collapsed commit of branch NAME.\n+collapsed_commit()\n+{\n+\tname=\"$1\"\n+\n+\trm -f \"$playground/^pre\" \"$playground/^post\"\n+\t>\"$playground/^body\"\n+\n \t# Determine parent\n \tparent=\"$(cut -f 1 \"$playground/$name^parents\")\"\n \tif [ \"$(cat \"$playground/$name^parents\" | wc -l)\" -gt 1 ]; then\n@@ -107,9 +118,7 @@ collapsed_commit()\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+\t\tcreate_tg_commit \"$name\" \"$(pretty_tree $name)\" \"$parent\"\n \tfi;\n \n \techo \"$name\" >>\"$playground/^ticker\"\n-- \n1.5.6.5\n"},{"id":"101339","messageId":"20090121031913.GA7422@lapse.rw.madduck.net","threadId":"17176","inReplyTo":"1231968443-13960-2-git-send-email-u.kleine-koenig@pengutronix.de","subject":"Re: [PATCH] [TOPGIT] make creating a commit from a topgit branch a function","fromName":"martin f krafft","fromEmail":"madduck@debian.org","sentAt":"2009-01-21T03:19:13Z","receivedAt":"2009-01-21T03:19:13Z","isPatch":true,"sender":{"key":"madduck@debian.org","avatar":null},"body":"also sprach Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [2009.01.15.0827 +1100]:\n> This helps avoiding code duplication for the next commit.\n\nWhat's the \"next commit\"?\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 \ni'd rather be riding a high speed tractor\nwith a beer on my lap,\nand a six pack of girls next to me.\n"},{"id":"101365","messageId":"20090121101644.GA19052@pengutronix.de","threadId":"17176","inReplyTo":"20090121031913.GA7422@lapse.rw.madduck.net","subject":"Re: [PATCH] [TOPGIT] make creating a commit from a topgit branch a function","fromName":"Uwe Kleine-König","fromEmail":"u.kleine-koenig@pengutronix.de","sentAt":"2009-01-21T10:16:44Z","receivedAt":"2009-01-21T10:16:44Z","isPatch":true,"sender":{"key":"u.kleine-koenig@pengutronix.de","avatar":"https://gravatar.com/avatar/354b5e3ceb2806a2f1e1e382ac29ddbdad18288654da62b61eb13583a857eee7?d=mp&s=160"},"body":"On Wed, Jan 21, 2009 at 02:19:13PM +1100, martin f krafft wrote:\n> also sprach Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [2009.01.15.0827 +1100]:\n> > This helps avoiding code duplication for the next commit.\n> \n> What's the \"next commit\"?\noh, sorry.  I intended to post my patch that implements `tg export\n--linearize`, but then found a bug and so didn't send it.\n\nYou can find it in my pu branch at\n\n\tgit://git.pengutronix.de/git/ukl/topgit.git pu\n\n.  It's not yet ready for general use, but I look forward to any\nconstructive feedback.\n\nBest regards and thanks for the reminder,\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":"101371","messageId":"20090121110628.GA9415@strlen.de","threadId":"17176","inReplyTo":"1231968443-13960-1-git-send-email-u.kleine-koenig@pengutronix.de","subject":"Re: [PATCH] [TOPGIT] make tg remote idempotent","fromName":"Uwe Kleine-König","fromEmail":"ukleinek@strlen.de","sentAt":"2009-01-21T11:06:28Z","receivedAt":"2009-01-21T11:06:28Z","isPatch":true,"sender":{"key":"ukleinek@strlen.de","avatar":"https://gravatar.com/avatar/71e008a89bd4c9d95c03e4823fa14b01e7f658bfc746c8a735286b945417f2d6?d=mp&s=160"},"body":"Hello,\n\nOn Wed, Jan 14, 2009 at 10:27:22PM +0100, Uwe Kleine-König wrote:\n> -git config --add \"remote.$name.fetch\" \"+refs/top-bases/*:refs/remotes/$name/top-bases/*\"\n> -git config --add \"remote.$name.push\" \"+refs/top-bases/*:refs/top-bases/*\"\n> -git config --add \"remote.$name.push\" \"+refs/heads/*:refs/heads/*\"\n> +git config --replace-all \"remote.$name.fetch\" \"+refs/top-bases/*:refs/remotes/$name/top-bases/*\" \"+refs/top-bases/*:refs/remotes/$name/top-bases/*\"\n> +git config --replace-all \"remote.$name.push\" \"+refs/top-bases/*:refs/top-bases/*\" \"+refs/top-bases/*:refs/top-bases/*\"\n> +git config --replace-all \"remote.$name.push\" \"+refs/heads/*:refs/heads/*\" \"+refs/heads/*:refs/heads/*\"\nIt seems I sent an old version of this patch.  Actually in the last\nargument '+' and '*' have to be quoted to work.\n\nI fixed this in my repo.  Should I resend the fixed patch?\n\nBest regards\nUwe\n"},{"id":"101384","messageId":"20090121143105.GA21585@lapse.rw.madduck.net","threadId":"17176","inReplyTo":"20090121110628.GA9415@strlen.de","subject":"Re: [PATCH] [TOPGIT] make tg remote idempotent","fromName":"martin f krafft","fromEmail":"madduck@debian.org","sentAt":"2009-01-21T14:31:05Z","receivedAt":"2009-01-21T14:31:05Z","isPatch":true,"sender":{"key":"madduck@debian.org","avatar":null},"body":"also sprach Uwe Kleine-König <ukleinek@strlen.de> [2009.01.21.2206 +1100]:\n> I fixed this in my repo.  Should I resend the fixed patch?\n\nNo, I will pull. Cheers,\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\"arthur slapped his arms about himself to try and get his\n circulation a little more enthusiastic about its job.\"\n                                 -- hitchhiker's guide to the galaxy\n"},{"id":"101485","messageId":"20090122001354.GA29835@lapse.rw.madduck.net","threadId":"17176","inReplyTo":"20090121101644.GA19052@pengutronix.de","subject":"Re: [PATCH] [TOPGIT] make creating a commit from a topgit branch a function","fromName":"martin f krafft","fromEmail":"madduck@debian.org","sentAt":"2009-01-22T00:13:54Z","receivedAt":"2009-01-22T00:13:54Z","isPatch":true,"sender":{"key":"madduck@debian.org","avatar":null},"body":"also sprach Uwe Kleine-König <u.kleine-koenig@pengutronix.de> [2009.01.21.2116 +1100]:\n> > What's the \"next commit\"?\n> oh, sorry.  I intended to post my patch that implements `tg export\n> --linearize`, but then found a bug and so didn't send it.\n> \n> You can find it in my pu branch at\n> \n> \tgit://git.pengutronix.de/git/ukl/topgit.git pu\n> \n> .  It's not yet ready for general use, but I look forward to any\n> constructive feedback.\n\nIt'll be a while until I can look into this. Until I do, I will only\npull in f4fa614, and we'll pull ae3fe45 when your linearizing patch\nis ready.\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\"you grabbed my hand and we fell into it,\n like a daydream - or a fever.\"\n                                        -- godspeed you black emperor!\n"}]}