{"thread":{"id":"5901","subject":"Feature: add --force option to cg-push.","startedAt":"2006-10-12T13:30:37Z","lastAt":"2006-10-17T00:55:15Z","messageCount":2,"participants":["Pierre Marc Dumuid","Petr Baudis"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"28663","messageId":"452E437D.3070708@adelaide.edu.au","threadId":"5901","inReplyTo":null,"subject":"Feature: add --force option to cg-push.","fromName":"Pierre Marc Dumuid","fromEmail":"pierre.dumuid@adelaide.edu.au","sentAt":"2006-10-12T13:30:37Z","receivedAt":"2006-10-12T13:30:37Z","isPatch":false,"sender":{"key":"pierre.dumuid@adelaide.edu.au","avatar":null},"body":"If I cg-push on a remote branch after changing my mind about how I \nwanted the branch ordered, it will complain and say \"maybee you need to \nupdate\"\n\nI didn't know what to do, since I was on the \"no\" side of maybee.\n\nHere is a patch that adds the --force option for those people.\n\n\n\n--- /home/pmdumuid/bin/cg-push2\t2006-10-12 22:38:49.000000000 +0930\n+++ /usr/bin/cg-push\t2006-09-26 14:30:09.000000000 +0930\n@@ -27,15 +27,8 @@\n #\tfuture, cg-push should push tags automatically. Also note\n #\tthat even if you pass `cg-push` the '-t' arguments, your\n #\tHEAD is still pushed as well in addition to the tags.\n-#\n-# --force \n-#       Usually, the command refuses to update a remote ref that is\n-#       not an ancestor of the local ref used to overwrite it. This\n-#       flag disables the check. What this means is that the remote\n-#       repository can lose commits; use it with care.\n-#\n-#\n-USAGE=\"cg-push [--force] [-r LOCAL_BRANCH] [REMOTE_BRANCH] [-t TAG]...\"\n+\n+USAGE=\"cg-push [-r LOCAL_BRANCH] [REMOTE_BRANCH] [-t TAG]...\"\n \n . \"${COGITO_LIB:-/usr/lib/cogito/}\"cg-Xlib || exit 1\n \n@@ -44,12 +37,11 @@\n {\n \tname=\"$1\"; shift\n \tcommit=\"$(cg-object-id -c \"$locbranch\")\"; old=\"$(cat \"$_git/refs/heads/$name\" 2>/dev/null)\"\n-\tgit-send-pack $force \"$@\" && git-update-ref refs/heads/\"$name\" \"$commit\" $old\n+\tgit-send-pack \"$@\" && git-update-ref refs/heads/\"$name\" \"$commit\" $old\n }\n \n \n locbranch=\"$_git_head\"\n-force=\"\"\n tags=()\n while optparse; do\n \tif optparse -r=; then\n@@ -57,8 +49,6 @@\n \t\t[ \"$(cg-object-id -c \"$locbranch\")\" ] || exit 1\n \telif optparse -t=; then\n \t\ttags[${#tags[@]}]=\"refs/tags/$OPTARG\"\n-\telif optparse --force; then\n-                force=\"--force\"\n \telse\n \t\toptfail\n \tfi\n@@ -79,7 +69,7 @@\n sprembranch=\":refs/heads/$rembranch\"\n \n if [ \"${uri#http://}\" != \"$uri\" -o \"${uri#https://}\" != \"$uri\" ]; then\n-\tgit-http-push $force \"$uri/\" \"$locbranch$sprembranch\" \"${tags[@]}\"\n+\tgit-http-push \"$uri/\" \"$locbranch$sprembranch\" \"${tags[@]}\"\n elif [ \"${uri#git+ssh://}\" != \"$uri\" ]; then\n \tsend_pack_update \"$name\" \"$(echo \"$uri\" | sed 's#^git+ssh://\\([^/]*\\)\\(/.*\\)$#\\1:\\2#')\" \"$locbranch$sprembranch\" \"${tags[@]}\"\n elif [ \"${uri#rsync://}\" != \"$uri\" ]; then\n"},{"id":"28894","messageId":"20061017005515.GD20017@pasky.or.cz","threadId":"5901","inReplyTo":"452E437D.3070708@adelaide.edu.au","subject":"Re: Feature: add --force option to cg-push.","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-10-17T00:55:15Z","receivedAt":"2006-10-17T00:55:15Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Thu, Oct 12, 2006 at 03:30:37PM CEST, I got a letter\nwhere Pierre Marc Dumuid <pierre.dumuid@adelaide.edu.au> said that...\n> If I cg-push on a remote branch after changing my mind about how I \n> wanted the branch ordered, it will complain and say \"maybee you need to \n> update\"\n> \n> I didn't know what to do, since I was on the \"no\" side of maybee.\n> \n> Here is a patch that adds the --force option for those people.\n\nThanks, I've committed a similar but different patch (with better\ndescription and handling local pushes as well). Please sign off your\npatches in the future.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\n#!/bin/perl -sp0777i<X+d*lMLa^*lN%0]dsXx++lMlN/dsM0<j]dsj\n$/=unpack('H*',$_);$_=`echo 16dio\\U$k\"SK$/SM$n\\EsN0p[lN*1\nlK[d2%Sa2/d0$^Ixp\"|dc`;s/\\W//g;$_=pack('H*',/((..)*)$/)\n"}]}