{"thread":{"id":"7106","subject":"[PATCH 1/1] Guilt: Fixed guilt-patchbomb temporary mbox deletion bug","startedAt":"2007-03-06T07:01:46Z","lastAt":"2007-03-06T07:53:16Z","messageCount":5,"participants":["Nur Hussein","Junio C Hamano","Josef Sipek"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"36425","messageId":"1173164506.4877.19.camel@gandalf.dcc.usm.my","threadId":"7106","inReplyTo":null,"subject":"[PATCH 1/1] Guilt: Fixed guilt-patchbomb temporary mbox deletion bug","fromName":"Nur Hussein","fromEmail":"hussein@cs.usm.my","sentAt":"2007-03-06T07:01:46Z","receivedAt":"2007-03-06T07:01:46Z","isPatch":true,"sender":{"key":"hussein@cs.usm.my","avatar":null},"body":"A bug occurred where the temporary mbox is deleted even when 'N' or 'n' was selected\nbecause of the incorrect use of the -a operator when testing user input. Fixed now to\nuse -o instead.\n\nSigned-off-by: Nur Hussein <hussein@cs.usm.my>\n---\n guilt-patchbomb |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/guilt-patchbomb b/guilt-patchbomb\nindex 6f51b4b..ad80fb1 100755\n--- a/guilt-patchbomb\n+++ b/guilt-patchbomb\n@@ -88,5 +88,5 @@ fi\n echo -n \"Delete temporary directory? [Y/n] \"\n read n\n \n-[ \"$n\" != \"n\" -a \"$n\" != \"N\" ] && exit 0\n+[ \"$n\" != \"n\" -o \"$n\" != \"N\" ] && exit 0\n rm -rf $dir\n-- \n1.4.4.4\n\n\n-- \nThis message has been scanned for viruses and\ndangerous content by MailScanner, and is\nbelieved to be clean.\n"},{"id":"36426","messageId":"7vvehesvf1.fsf@assigned-by-dhcp.cox.net","threadId":"7106","inReplyTo":"1173164506.4877.19.camel@gandalf.dcc.usm.my","subject":"Re: [PATCH 1/1] Guilt: Fixed guilt-patchbomb temporary mbox deletion bug","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-03-06T07:06:26Z","receivedAt":"2007-03-06T07:06:26Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nur Hussein <hussein@cs.usm.my> writes:\n\n>  echo -n \"Delete temporary directory? [Y/n] \"\n>  read n\n>  \n> -[ \"$n\" != \"n\" -a \"$n\" != \"N\" ] && exit 0\n> +[ \"$n\" != \"n\" -o \"$n\" != \"N\" ] && exit 0\n>  rm -rf $dir\n\nIs it just me who finds this much more readable?\n\n\tcase \"$n\" in [nN]*) exit 0 ;; esac\n"},{"id":"36431","messageId":"20070306073821.GA26626@filer.fsl.cs.sunysb.edu","threadId":"7106","inReplyTo":"7vvehesvf1.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 1/1] Guilt: Fixed guilt-patchbomb temporary mbox deletion bug","fromName":"Josef Sipek","fromEmail":"jsipek@fsl.cs.sunysb.edu","sentAt":"2007-03-06T07:38:21Z","receivedAt":"2007-03-06T07:38:21Z","isPatch":true,"sender":{"key":"jsipek@fsl.cs.sunysb.edu","avatar":null},"body":"On Mon, Mar 05, 2007 at 11:06:26PM -0800, Junio C Hamano wrote:\n> Nur Hussein <hussein@cs.usm.my> writes:\n> \n> >  echo -n \"Delete temporary directory? [Y/n] \"\n> >  read n\n> >  \n> > -[ \"$n\" != \"n\" -a \"$n\" != \"N\" ] && exit 0\n> > +[ \"$n\" != \"n\" -o \"$n\" != \"N\" ] && exit 0\n> >  rm -rf $dir\n> \n> Is it just me who finds this much more readable?\n> \n> \tcase \"$n\" in [nN]*) exit 0 ;; esac\n \nI don't know. I never saw case being \"abused\" as the condition in a while\nloop either. I guess it is really a matter of taste. For anything more\ncomplex then [nN] I'd go with the case statement as well.\n\nI hear that the whole while-case is just an optimization for sh of many\nmoons ago - something about case being builtin but test not.\n\nJosef \"Jeff\" Sipek.\n\n-- \nOnly two things are infinite, the universe and human stupidity, and I'm not\nsure about the former.\n\t\t- Albert Einstein\n"},{"id":"36434","messageId":"20070306074740.GB26626@filer.fsl.cs.sunysb.edu","threadId":"7106","inReplyTo":"1173164506.4877.19.camel@gandalf.dcc.usm.my","subject":"Re: [PATCH 1/1] Guilt: Fixed guilt-patchbomb temporary mbox deletion bug","fromName":"Josef Sipek","fromEmail":"jsipek@fsl.cs.sunysb.edu","sentAt":"2007-03-06T07:47:41Z","receivedAt":"2007-03-06T07:47:41Z","isPatch":true,"sender":{"key":"jsipek@fsl.cs.sunysb.edu","avatar":null},"body":"On Tue, Mar 06, 2007 at 03:01:46PM +0800, Nur Hussein wrote:\n> A bug occurred where the temporary mbox is deleted even when 'N' or 'n' was selected\n> because of the incorrect use of the -a operator when testing user input. Fixed now to\n> use -o instead.\n> \n> Signed-off-by: Nur Hussein <hussein@cs.usm.my>\n> ---\n>  guilt-patchbomb |    2 +-\n>  1 files changed, 1 insertions(+), 1 deletions(-)\n> \n> diff --git a/guilt-patchbomb b/guilt-patchbomb\n> index 6f51b4b..ad80fb1 100755\n> --- a/guilt-patchbomb\n> +++ b/guilt-patchbomb\n> @@ -88,5 +88,5 @@ fi\n>  echo -n \"Delete temporary directory? [Y/n] \"\n>  read n\n>  \n> -[ \"$n\" != \"n\" -a \"$n\" != \"N\" ] && exit 0\n> +[ \"$n\" != \"n\" -o \"$n\" != \"N\" ] && exit 0\n>  rm -rf $dir\n\nWould this actually work?\n\ninput\t\t$n != n\t\t$n != N\t\taction (-a)\taction (-o)\n---------------------------------------------------------------------------\n<not N>\t\ttrue\t\ttrue\t\texit\t\texit\nn\t\tfalse\t\ttrue\t\trm\t\texit\nN\t\ttrue\t\tfalse\t\trm\t\texit\n\n\nThe new statement seems wrong. The fact that the original statement had the\nlogic inverted still remains. It should be exit if ($n==n || $n==N).\n\nJosef \"Jeff\" Sipek.\n\n-- \nResearch, n.:\n  Consider Columbus:\n    He didn't know where he was going.\n    When he got there he didn't know where he was.\n    When he got back he didn't know where he had been.\n    And he did it all on someone else's money.\n"},{"id":"36436","messageId":"20070306075316.GC26626@filer.fsl.cs.sunysb.edu","threadId":"7106","inReplyTo":"20070306074740.GB26626@filer.fsl.cs.sunysb.edu","subject":"Re: [PATCH 1/1] Guilt: Fixed guilt-patchbomb temporary mbox deletion bug","fromName":"Josef Sipek","fromEmail":"jsipek@fsl.cs.sunysb.edu","sentAt":"2007-03-06T07:53:16Z","receivedAt":"2007-03-06T07:53:16Z","isPatch":true,"sender":{"key":"jsipek@fsl.cs.sunysb.edu","avatar":null},"body":"On Tue, Mar 06, 2007 at 02:47:41AM -0500, Josef Sipek wrote:\n> On Tue, Mar 06, 2007 at 03:01:46PM +0800, Nur Hussein wrote:\n> > A bug occurred where the temporary mbox is deleted even when 'N' or 'n' was selected\n> > because of the incorrect use of the -a operator when testing user input. Fixed now to\n> > use -o instead.\n> > \n> > Signed-off-by: Nur Hussein <hussein@cs.usm.my>\n> > ---\n> >  guilt-patchbomb |    2 +-\n> >  1 files changed, 1 insertions(+), 1 deletions(-)\n> > \n> > diff --git a/guilt-patchbomb b/guilt-patchbomb\n> > index 6f51b4b..ad80fb1 100755\n> > --- a/guilt-patchbomb\n> > +++ b/guilt-patchbomb\n> > @@ -88,5 +88,5 @@ fi\n> >  echo -n \"Delete temporary directory? [Y/n] \"\n> >  read n\n> >  \n> > -[ \"$n\" != \"n\" -a \"$n\" != \"N\" ] && exit 0\n> > +[ \"$n\" != \"n\" -o \"$n\" != \"N\" ] && exit 0\n> >  rm -rf $dir\n> \n> Would this actually work?\n> \n> input\t\t$n != n\t\t$n != N\t\taction (-a)\taction (-o)\n> ---------------------------------------------------------------------------\n> <not N>\t\ttrue\t\ttrue\t\texit\t\texit\n> n\t\tfalse\t\ttrue\t\trm\t\texit\n> N\t\ttrue\t\tfalse\t\trm\t\texit\n> \n> \n> The new statement seems wrong. The fact that the original statement had the\n> logic inverted still remains. It should be exit if ($n==n || $n==N).\n\nI fixed it up and commited it.\n\nThanks,\n\nJosef \"Jeff\" Sipek.\n\n-- \nIt used to be said [...] that AIX looks like one space alien discovered\nUnix, and described it to another different space alien who then implemented\nAIX. But their universal translators were broken and they'd had to gesture a\nlot.\n\t\t- Paul Tomblin \n"}]}