{"thread":{"id":"3757","subject":"[PATCH] Ability to automaticaly push tags to remote repositories.","startedAt":"2006-03-30T12:56:02Z","lastAt":"2006-06-02T20:58:36Z","messageCount":3,"participants":["Krzysiek Pawlik","Petr Baudis"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"18146","messageId":"442BD562.3030207@people.pl","threadId":"3757","inReplyTo":null,"subject":"[PATCH] Ability to automaticaly push tags to remote repositories.","fromName":"Krzysiek Pawlik","fromEmail":"krzysiek.pawlik@people.pl","sentAt":"2006-03-30T12:56:02Z","receivedAt":"2006-03-30T12:56:02Z","isPatch":true,"sender":{"key":"krzysiek.pawlik@people.pl","avatar":"https://gravatar.com/avatar/05218c3d47410c496c83467dd36d83d4e4457f4825f00124575b50302bd952e2?d=mp&s=160"},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\n\n- From `cg-push --long-help`:\n\n- -t TAG::\n        Tells cg-push to also push the given tag. Note that in the\n        future, cg-push should push tags automatically. Also note\n        that even if you pass `cg-push` the '-t' arguments, your\n        HEAD is still pushed as well in addition to the tags.\n\nOne of possible ways of doing it is in attached patch. Comments,\nsuggestions?\n\n- --\nKrzysiek Pawlik (Nelchael)\nRLU #322999 GPG Key ID: 0xBC555551\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1.4.2.2 (GNU/Linux)\n\niD8DBQFEK9Vigo/w9rxVVVERAvXkAJ42ESjs3REY0ECqIYlbz+9WX/3+ZQCfSQs/\nB4X6U2io0Wq0/0oiolpUW1g=\n=3ZR7\n-----END PGP SIGNATURE-----\n\n\nAbility to automaticaly push tags to remote repositories.\n\n---\ncommit 6e581cf43ccf7236ea47ac4ba9b51df9cda3c671\ntree b440cb8e4629c5c77e38fb6179992b52edf8c861\nparent 891c6d85f38a326e91d62906e1696a38d28fb105\nauthor Krzysiek Pawlik <kpawlik@silvermedia.pl> Thu, 30 Mar 2006 14:48:36 +0200\ncommitter Krzysiek Pawlik <kpawlik@silvermedia.pl> Thu, 30 Mar 2006 14:48:36 +0200\n\n cg-push |   15 +++++++++++++++\n 1 files changed, 15 insertions(+), 0 deletions(-)\n\ndiff --git a/cg-push b/cg-push\nindex 4332b28..865cbd5 100755\n--- a/cg-push\n+++ b/cg-push\n@@ -43,17 +43,32 @@ send_pack_update()\n \n locbranch=\"$_git_head\"\n tags=()\n+auto_push_tags=yes\n while optparse; do\n \tif optparse -r=; then\n \t\tlocbranch=\"$OPTARG\"\n \t\t[ \"$(cg-object-id -c \"$locbranch\")\" ] || exit 1\n \telif optparse -t=; then\n \t\ttags[${#tags[@]}]=\"refs/tags/$OPTARG\"\n+\t\tauto_push_tags=no\n \telse\n \t\toptfail\n \tfi\n done\n \n+if [ \"${auto_push_tags}\" = \"yes\" ]; then\n+\tif [ ! -d \"$_git/cogito-tags-pushed\" ]; then\n+\t\tmkdir \"$_git/cogito-tags-pushed\" || die \"can't create cache for pushed tags\"\n+\tfi\n+\tfor i in `cg-tag-ls | awk '{print $1}'`; do\n+\t\tif [ ! -f \"$_git/cogito-tags-pushed/${i}\" ]; then\n+\t\t\techo \"Adding ${i} to list of tags to push\"\n+\t\t\ttags[${#tags[@]}]=\"refs/tags/${i}\"\n+\t\t\ttouch \"$_git/cogito-tags-pushed/${i}\"\n+\t\tfi\n+\tdone\n+fi\n+\n [ ${#ARGS[@]} -gt 1 ] && die \"too many arguments, I can push only one branch at once\"\n name=\"${ARGS[0]}\"\n \n\n\n\f\n!-------------------------------------------------------------flip-\n\n\n"},{"id":"18147","messageId":"442BE8C2.5000907@people.pl","threadId":"3757","inReplyTo":"442BD562.3030207@people.pl","subject":"Re: [PATCH] Ability to automaticaly push tags to remote repositories.","fromName":"Krzysiek Pawlik","fromEmail":"krzysiek.pawlik@people.pl","sentAt":"2006-03-30T14:18:42Z","receivedAt":"2006-03-30T14:18:42Z","isPatch":true,"sender":{"key":"krzysiek.pawlik@people.pl","avatar":"https://gravatar.com/avatar/05218c3d47410c496c83467dd36d83d4e4457f4825f00124575b50302bd952e2?d=mp&s=160"},"body":"Krzysiek Pawlik wrote:\n> Comments, suggestions?\n\nBroken when there are no tags. Attached patch fixes it.\n\n-- \nKrzysiek Pawlik (Nelchael)\nRLU #322999 GPG Key ID: 0xBC555551\n\n\n\nFix auto-push of tags when there are no tags.\n\n---\ncommit eff67bafe333c28c238feb614f098b987216ffb0\ntree 8758ae4a2eace9c4fdf64ec89c1f983871097a74\nparent 6e581cf43ccf7236ea47ac4ba9b51df9cda3c671\nauthor Krzysiek Pawlik <kpawlik@silvermedia.pl> Thu, 30 Mar 2006 16:10:26 +0200\ncommitter Krzysiek Pawlik <kpawlik@silvermedia.pl> Thu, 30 Mar 2006 16:10:26 +0200\n\n cg-push |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/cg-push b/cg-push\nindex 865cbd5..40016c1 100755\n--- a/cg-push\n+++ b/cg-push\n@@ -60,7 +60,7 @@ if [ \"${auto_push_tags}\" = \"yes\" ]; then\n \tif [ ! -d \"$_git/cogito-tags-pushed\" ]; then\n \t\tmkdir \"$_git/cogito-tags-pushed\" || die \"can't create cache for pushed tags\"\n \tfi\n-\tfor i in `cg-tag-ls | awk '{print $1}'`; do\n+\tfor i in `cg-tag-ls 2> /dev/null | awk '{print $1}'`; do\n \t\tif [ ! -f \"$_git/cogito-tags-pushed/${i}\" ]; then\n \t\t\techo \"Adding ${i} to list of tags to push\"\n \t\t\ttags[${#tags[@]}]=\"refs/tags/${i}\"\n\n\n\f\n!-------------------------------------------------------------flip-\n\n\n"},{"id":"21115","messageId":"20060602205836.GG10488@pasky.or.cz","threadId":"3757","inReplyTo":"442BD562.3030207@people.pl","subject":"Re: [PATCH] Ability to automaticaly push tags to remote repositories.","fromName":"Petr Baudis","fromEmail":"pasky@ucw.cz","sentAt":"2006-06-02T20:58:36Z","receivedAt":"2006-06-02T20:58:36Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Thu, Mar 30, 2006 at 02:56:02PM CEST, I got a letter\nwhere Krzysiek Pawlik <krzysiek.pawlik@people.pl> said that...\n> -----BEGIN PGP SIGNED MESSAGE-----\n> Hash: SHA1\n> \n> \n> - From `cg-push --long-help`:\n> \n> - -t TAG::\n>         Tells cg-push to also push the given tag. Note that in the\n>         future, cg-push should push tags automatically. Also note\n>         that even if you pass `cg-push` the '-t' arguments, your\n>         HEAD is still pushed as well in addition to the tags.\n> \n> One of possible ways of doing it is in attached patch. Comments,\n> suggestions?\n\nWell, this works properly only when you ever push to a single\nrepository, which many people don't. Besides, if you have two branches,\npush branch A but tag a commit only on branch B, you will now be pushing\nan invalid tag since the other end won't have the branch B and thus the\ntagged commit.\n\nA better way would be to use git-ls-remote --tags to get the list of\nremote tags and compare that with the list of local tags, then push\nthose tags that tag commits on the branch we are pushing and the other\nend does not have them.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nA person is just about as big as the things that make them angry.\n"}]}