{"thread":{"id":"28","subject":"[patch pasky] update gitcancel.sh to handle modes as well","startedAt":"2005-04-14T22:57:22Z","lastAt":"2005-04-14T23:49:01Z","messageCount":7,"participants":["Martin Schlemmer","Petr Baudis"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"151","messageId":"20050414225722.GR22699@pasky.ji.cz","threadId":"28","inReplyTo":"1113519445.23299.119.camel@nosferatu.lan","subject":"Re: update gitcancel.sh to handle modes as well","fromName":"Petr Baudis","fromEmail":"pasky@ucw.cz","sentAt":"2005-04-14T22:57:22Z","receivedAt":"2005-04-14T22:57:22Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Fri, Apr 15, 2005 at 12:57:25AM CEST, I got a letter\nwhere Martin Schlemmer <azarah@nosferatu.za.org> told me that...\n> Hi,\n> \n> gitcancel.sh do not handle mode changes:\n> \n> ----\n> $ chmod -x Makefile\n> $ git cancel\n> patch: **** Only garbage was found in the patch input.\n> ----\n> \n> Rather use checkout-cache to sync our tree, as should do the right thing\n> instead of diffing (cancel imply just blow away everything).\n> \n> Signed-off-by: Martin Schlemmer <azarah@nosferatu.za.org>\n> \n> gittrack.sh:  03d6db1fb3a70605ef249c632c04e542457f0808\n> --- 03d6db1fb3a70605ef249c632c04e542457f0808/gittrack.sh\n> +++ uncommitted/gittrack.sh\n> @@ -51,6 +51,7 @@\n> \n>         read-tree $(tree-id \"$name\")\n>         gitdiff.sh local \"$name\" | gitapply.sh\n> +       update-cache --refresh\n> \n>  else\n>         [ \"$tracking\" ] || \\\n> @@ -61,6 +62,7 @@\n>         if [ -s \".git/HEAD.local\" ]; then\n>                 gitdiff.sh \"$tracking\" local | gitapply.sh\n>                 read-tree $(tree-id local)\n> +               update-cache --refresh\n> \n>                 head=$(cat .git/HEAD)\n>                 branchhead=$(cat .git/heads/$tracking)\n\nThe patch looks familiar, but not right. ;-)\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nC++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor\n"},{"id":"148","messageId":"1113519445.23299.119.camel@nosferatu.lan","threadId":"28","inReplyTo":null,"subject":"[patch pasky] update gitcancel.sh to handle modes as well","fromName":"Martin Schlemmer","fromEmail":"azarah@nosferatu.za.org","sentAt":"2005-04-14T22:57:25Z","receivedAt":"2005-04-14T22:57:25Z","isPatch":true,"sender":{"key":"azarah@nosferatu.za.org","avatar":null},"body":"Hi,\n\ngitcancel.sh do not handle mode changes:\n\n----\n$ chmod -x Makefile\n$ git cancel\npatch: **** Only garbage was found in the patch input.\n----\n\nRather use checkout-cache to sync our tree, as should do the right thing\ninstead of diffing (cancel imply just blow away everything).\n\nSigned-off-by: Martin Schlemmer <azarah@nosferatu.za.org>\n\ngittrack.sh:  03d6db1fb3a70605ef249c632c04e542457f0808\n--- 03d6db1fb3a70605ef249c632c04e542457f0808/gittrack.sh\n+++ uncommitted/gittrack.sh\n@@ -51,6 +51,7 @@\n\n        read-tree $(tree-id \"$name\")\n        gitdiff.sh local \"$name\" | gitapply.sh\n+       update-cache --refresh\n\n else\n        [ \"$tracking\" ] || \\\n@@ -61,6 +62,7 @@\n        if [ -s \".git/HEAD.local\" ]; then\n                gitdiff.sh \"$tracking\" local | gitapply.sh\n                read-tree $(tree-id local)\n+               update-cache --refresh\n\n                head=$(cat .git/HEAD)\n                branchhead=$(cat .git/heads/$tracking)\n\n\n-- \nMartin Schlemmer\n\n\n\ngittrack.sh:  03d6db1fb3a70605ef249c632c04e542457f0808\n--- 03d6db1fb3a70605ef249c632c04e542457f0808/gittrack.sh\n+++ uncommitted/gittrack.sh\n@@ -51,6 +51,7 @@\n \n \tread-tree $(tree-id \"$name\")\n \tgitdiff.sh local \"$name\" | gitapply.sh\n+\tupdate-cache --refresh\n \n else\n \t[ \"$tracking\" ] || \\\n@@ -61,6 +62,7 @@\n \tif [ -s \".git/HEAD.local\" ]; then\n \t\tgitdiff.sh \"$tracking\" local | gitapply.sh\n \t\tread-tree $(tree-id local)\n+\t\tupdate-cache --refresh\n \n \t\thead=$(cat .git/HEAD)\n \t\tbranchhead=$(cat .git/heads/$tracking)\n"},{"id":"153","messageId":"1113519890.23299.129.camel@nosferatu.lan","threadId":"28","inReplyTo":"1113519445.23299.119.camel@nosferatu.lan","subject":"Re: [patch pasky] update gitcancel.sh to handle modes as well","fromName":"Martin Schlemmer","fromEmail":"azarah@nosferatu.za.org","sentAt":"2005-04-14T23:04:50Z","receivedAt":"2005-04-14T23:04:50Z","isPatch":true,"sender":{"key":"azarah@nosferatu.za.org","avatar":null},"body":"On Fri, 2005-04-15 at 00:57 +0200, Martin Schlemmer wrote:\n> Hi,\n> \n> gitcancel.sh do not handle mode changes:\n> \n> ----\n> $ chmod -x Makefile\n> $ git cancel\n> patch: **** Only garbage was found in the patch input.\n> ----\n> \n> Rather use checkout-cache to sync our tree, as should do the right thing\n> instead of diffing (cancel imply just blow away everything).\n> \n> Signed-off-by: Martin Schlemmer <azarah@nosferatu.za.org>\n> \n> gittrack.sh:  03d6db1fb3a70605ef249c632c04e542457f0808\n> --- 03d6db1fb3a70605ef249c632c04e542457f0808/gittrack.sh\n> +++ uncommitted/gittrack.sh\n> @@ -51,6 +51,7 @@\n> \n>         read-tree $(tree-id \"$name\")\n>         gitdiff.sh local \"$name\" | gitapply.sh\n> +       update-cache --refresh\n> \n>  else\n>         [ \"$tracking\" ] || \\\n> @@ -61,6 +62,7 @@\n>         if [ -s \".git/HEAD.local\" ]; then\n>                 gitdiff.sh \"$tracking\" local | gitapply.sh\n>                 read-tree $(tree-id local)\n> +               update-cache --refresh\n> \n>                 head=$(cat .git/HEAD)\n>                 branchhead=$(cat .git/heads/$tracking)\n\nYes, I am an idiot, and its past 1am already here.\n\nRather use checkout-cache to sync our tree, as should do the right thing\ninstead of diffing (cancel imply just blow away everything).\n\nSigned-off-by: Martin Schlemmer <azarah@nosferatu.za.org>\n\ngitcancel.sh:  839b3c58f20f6eb8412f499a891e007e2e67d114\n--- 839b3c58f20f6eb8412f499a891e007e2e67d114/gitcancel.sh\n+++ uncommitted/gitcancel.sh\n@@ -10,9 +10,8 @@\n #\n # Takes no arguments. Takes the evil changes from the tree.\n\n-# FIXME: Does not revert mode changes!\n\n-show-diff | patch -p0 -R\n rm -f .git/add-queue .git/rm-queue\n+checkout-cache -q -f -a\n\n update-cache --refresh\n\n\n-- \nMartin Schlemmer\n\n\n\ngitcancel.sh:  839b3c58f20f6eb8412f499a891e007e2e67d114\n--- 839b3c58f20f6eb8412f499a891e007e2e67d114/gitcancel.sh\n+++ uncommitted/gitcancel.sh\n@@ -10,9 +10,8 @@\n #\n # Takes no arguments. Takes the evil changes from the tree.\n \n-# FIXME: Does not revert mode changes!\n \n-show-diff | patch -p0 -R\n rm -f .git/add-queue .git/rm-queue\n+checkout-cache -q -f -a\n \n update-cache --refresh\n"},{"id":"154","messageId":"20050414230712.GT22699@pasky.ji.cz","threadId":"28","inReplyTo":"1113519890.23299.129.camel@nosferatu.lan","subject":"Re: Re: [patch pasky] update gitcancel.sh to handle modes as well","fromName":"Petr Baudis","fromEmail":"pasky@ucw.cz","sentAt":"2005-04-14T23:07:12Z","receivedAt":"2005-04-14T23:07:12Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Fri, Apr 15, 2005 at 01:04:50AM CEST, I got a letter\nwhere Martin Schlemmer <azarah@nosferatu.za.org> told me that...\n> Rather use checkout-cache to sync our tree, as should do the right thing\n> instead of diffing (cancel imply just blow away everything).\n> \n> Signed-off-by: Martin Schlemmer <azarah@nosferatu.za.org>\n> \n> gitcancel.sh:  839b3c58f20f6eb8412f499a891e007e2e67d114\n> --- 839b3c58f20f6eb8412f499a891e007e2e67d114/gitcancel.sh\n> +++ uncommitted/gitcancel.sh\n> @@ -10,9 +10,8 @@\n>  #\n>  # Takes no arguments. Takes the evil changes from the tree.\n> \n> -# FIXME: Does not revert mode changes!\n> \n> -show-diff | patch -p0 -R\n>  rm -f .git/add-queue .git/rm-queue\n> +checkout-cache -q -f -a\n> \n>  update-cache --refresh\n\nWhy -q?\n\nNever make things silent unless you really know what are you doing and\nwhy. The same goes for popular throwing of -f to rm's of files which\nshould always exist or 2>/dev/null for cats.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nC++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor\n"},{"id":"156","messageId":"1113520447.23299.137.camel@nosferatu.lan","threadId":"28","inReplyTo":"20050414230712.GT22699@pasky.ji.cz","subject":"Re: Re: [patch pasky] update gitcancel.sh to handle modes as well","fromName":"Martin Schlemmer","fromEmail":"azarah@nosferatu.za.org","sentAt":"2005-04-14T23:14:07Z","receivedAt":"2005-04-14T23:14:07Z","isPatch":true,"sender":{"key":"azarah@nosferatu.za.org","avatar":null},"body":"On Fri, 2005-04-15 at 01:07 +0200, Petr Baudis wrote:\n> Dear diary, on Fri, Apr 15, 2005 at 01:04:50AM CEST, I got a letter\n> where Martin Schlemmer <azarah@nosferatu.za.org> told me that...\n> > Rather use checkout-cache to sync our tree, as should do the right thing\n> > instead of diffing (cancel imply just blow away everything).\n> > \n> > Signed-off-by: Martin Schlemmer <azarah@nosferatu.za.org>\n> > \n> > gitcancel.sh:  839b3c58f20f6eb8412f499a891e007e2e67d114\n> > --- 839b3c58f20f6eb8412f499a891e007e2e67d114/gitcancel.sh\n> > +++ uncommitted/gitcancel.sh\n> > @@ -10,9 +10,8 @@\n> >  #\n> >  # Takes no arguments. Takes the evil changes from the tree.\n> > \n> > -# FIXME: Does not revert mode changes!\n> > \n> > -show-diff | patch -p0 -R\n> >  rm -f .git/add-queue .git/rm-queue\n> > +checkout-cache -q -f -a\n> > \n> >  update-cache --refresh\n> \n> Why -q?\n> \n> Never make things silent unless you really know what are you doing and\n> why. The same goes for popular throwing of -f to rm's of files which\n> should always exist or 2>/dev/null for cats.\n> \n\nUhm, no particular reason (other than perhaps working usually on stuff\nwhere too much info just confuses the user).  If its fine in spirit, the\n-q can go.\n\n\n-- \nMartin Schlemmer\n\n"},{"id":"165","messageId":"1113521946.23299.143.camel@nosferatu.lan","threadId":"28","inReplyTo":"20050414231558.GW22699@pasky.ji.cz","subject":"Re: Re: [patch pasky] update gitcancel.sh to handle modes as well","fromName":"Martin Schlemmer","fromEmail":"azarah@nosferatu.za.org","sentAt":"2005-04-14T23:39:06Z","receivedAt":"2005-04-14T23:39:06Z","isPatch":true,"sender":{"key":"azarah@nosferatu.za.org","avatar":null},"body":"On Fri, 2005-04-15 at 01:15 +0200, Petr Baudis wrote:\n> Dear diary, on Fri, Apr 15, 2005 at 01:04:50AM CEST, I got a letter\n> where Martin Schlemmer <azarah@nosferatu.za.org> told me that...\n> > Rather use checkout-cache to sync our tree, as should do the right thing\n> > instead of diffing (cancel imply just blow away everything).\n> > \n> > Signed-off-by: Martin Schlemmer <azarah@nosferatu.za.org>\n> > \n> > gitcancel.sh:  839b3c58f20f6eb8412f499a891e007e2e67d114\n> > --- 839b3c58f20f6eb8412f499a891e007e2e67d114/gitcancel.sh\n> > +++ uncommitted/gitcancel.sh\n> > @@ -10,9 +10,8 @@\n> >  #\n> >  # Takes no arguments. Takes the evil changes from the tree.\n> > \n> > -# FIXME: Does not revert mode changes!\n> > \n> > -show-diff | patch -p0 -R\n> >  rm -f .git/add-queue .git/rm-queue\n> > +checkout-cache -q -f -a\n> > \n> >  update-cache --refresh\n> \n\nPS, shouldn't we add a read-tree $(tree-id) before the checkout-cache?\n\n\n-- \nMartin Schlemmer\n\n"},{"id":"168","messageId":"20050414234901.GY22699@pasky.ji.cz","threadId":"28","inReplyTo":"1113521946.23299.143.camel@nosferatu.lan","subject":"Re: Re: Re: [patch pasky] update gitcancel.sh to handle modes as well","fromName":"Petr Baudis","fromEmail":"pasky@ucw.cz","sentAt":"2005-04-14T23:49:01Z","receivedAt":"2005-04-14T23:49:01Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Fri, Apr 15, 2005 at 01:39:06AM CEST, I got a letter\nwhere Martin Schlemmer <azarah@nosferatu.za.org> told me that...\n> On Fri, 2005-04-15 at 01:15 +0200, Petr Baudis wrote:\n> > Dear diary, on Fri, Apr 15, 2005 at 01:04:50AM CEST, I got a letter\n> > where Martin Schlemmer <azarah@nosferatu.za.org> told me that...\n> > > Rather use checkout-cache to sync our tree, as should do the right thing\n> > > instead of diffing (cancel imply just blow away everything).\n> > > \n> > > Signed-off-by: Martin Schlemmer <azarah@nosferatu.za.org>\n> > > \n> > > gitcancel.sh:  839b3c58f20f6eb8412f499a891e007e2e67d114\n> > > --- 839b3c58f20f6eb8412f499a891e007e2e67d114/gitcancel.sh\n> > > +++ uncommitted/gitcancel.sh\n> > > @@ -10,9 +10,8 @@\n> > >  #\n> > >  # Takes no arguments. Takes the evil changes from the tree.\n> > > \n> > > -# FIXME: Does not revert mode changes!\n> > > \n> > > -show-diff | patch -p0 -R\n> > >  rm -f .git/add-queue .git/rm-queue\n> > > +checkout-cache -q -f -a\n> > > \n> > >  update-cache --refresh\n> > \n> \n> PS, shouldn't we add a read-tree $(tree-id) before the checkout-cache?\n\nA correct tree should be in the index. And if for any completely weird\nand smelly reason it isn't, I'm pondering if we should back that out and\nalways reread-tree (takes some time, but do you do git cancel all the\ntime?), or rather comply to it and adjust to the loaded tree, whichever\nit is.\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nC++: an octopus made by nailing extra legs onto a dog. -- Steve Taylor\n"}]}