{"thread":{"id":"25114","subject":"[PATCH] t/t7300: workaround ancient touch by rearranging arguments","startedAt":"2010-09-15T20:58:22Z","lastAt":"2010-09-18T03:46:19Z","messageCount":5,"participants":["Brandon Casey","Junio C Hamano","Jeff King","Sverre Rabbelier"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"150758","messageId":"i6Vnwbi85zvoD6Nzpw2lc1cAb4fZRJiU13x2r3wnIFnHDZWo9gkMwp9pRXJjgiXl4Ce-ERc-tvc@cipher.nrlssc.navy.mil","threadId":"25114","inReplyTo":null,"subject":"[PATCH] t/t7300: workaround ancient touch by rearranging arguments","fromName":"Brandon Casey","fromEmail":"casey@nrlssc.navy.mil","sentAt":"2010-09-15T20:58:22Z","receivedAt":"2010-09-15T20:58:22Z","isPatch":true,"sender":{"key":"drafnel@gmail.com","avatar":"https://avatars.githubusercontent.com/u/921167?v=4"},"body":"From: Brandon Casey <drafnel@gmail.com>\n\nThe ancient touch on Solaris 7 thinks that a decimal number supplied as\nthe first argument specifies a date_time to give to the files specified by\nthe remaining arguments.  In this case, it fails to parse '1' as a proper\ndate_time and exits with a failure status.  Workaround this flaw by\nrearranging the arguments supplied to touch so that a non-digit appears\nfirst and touch will not be confused.\n\nSigned-off-by: Brandon Casey <casey@nrlssc.navy.mil>\n---\n t/t7300-clean.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/t/t7300-clean.sh b/t/t7300-clean.sh\nindex 7dbbea1..6c776e9 100755\n--- a/t/t7300-clean.sh\n+++ b/t/t7300-clean.sh\n@@ -443,7 +443,7 @@ test_expect_success 'git clean -e' '\n \t(\n \t\tcd repo &&\n \t\tgit init &&\n-\t\ttouch 1 2 3 known &&\n+\t\ttouch known 1 2 3 &&\n \t\tgit add known &&\n \t\tgit clean -f -e 1 -e 2 &&\n \t\ttest -e 1 &&\n-- \n1.7.2.1\n"},{"id":"150761","messageId":"7vocby64oi.fsf@alter.siamese.dyndns.org","threadId":"25114","inReplyTo":"i6Vnwbi85zvoD6Nzpw2lc1cAb4fZRJiU13x2r3wnIFnHDZWo9gkMwp9pRXJjgiXl4Ce-ERc-tvc@cipher.nrlssc.navy.mil","subject":"Re: [PATCH] t/t7300: workaround ancient touch by rearranging arguments","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-09-15T22:08:13Z","receivedAt":"2010-09-15T22:08:13Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Brandon Casey <casey@nrlssc.navy.mil> writes:\n\n> From: Brandon Casey <drafnel@gmail.com>\n>\n> The ancient touch on Solaris 7 thinks that a decimal number supplied as\n> the first argument specifies a date_time to give to the files specified by\n> the remaining arguments.  In this case, it fails to parse '1' as a proper\n> date_time and exits with a failure status.  Workaround this flaw by\n> rearranging the arguments supplied to touch so that a non-digit appears\n> first and touch will not be confused.\n>\n> Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>\n\nYuck, there were other reasons why I tend to write \">file\" in our tests,\njust to create a new and empty file, but I didn't remember seeing this\none.  It's been a while since I touched Solaris the last time.\n\nThanks for catching.\n\n>  t/t7300-clean.sh |    2 +-\n>  1 files changed, 1 insertions(+), 1 deletions(-)\n>\n> diff --git a/t/t7300-clean.sh b/t/t7300-clean.sh\n> index 7dbbea1..6c776e9 100755\n> --- a/t/t7300-clean.sh\n> +++ b/t/t7300-clean.sh\n> @@ -443,7 +443,7 @@ test_expect_success 'git clean -e' '\n>  \t(\n>  \t\tcd repo &&\n>  \t\tgit init &&\n> -\t\ttouch 1 2 3 known &&\n> +\t\ttouch known 1 2 3 &&\n>  \t\tgit add known &&\n>  \t\tgit clean -f -e 1 -e 2 &&\n>  \t\ttest -e 1 &&\n> -- \n> 1.7.2.1\n"},{"id":"150782","messageId":"20100916003117.GA2527@sigill.intra.peff.net","threadId":"25114","inReplyTo":"i6Vnwbi85zvoD6Nzpw2lc1cAb4fZRJiU13x2r3wnIFnHDZWo9gkMwp9pRXJjgiXl4Ce-ERc-tvc@cipher.nrlssc.navy.mil","subject":"Re: [PATCH] t/t7300: workaround ancient touch by rearranging arguments","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2010-09-16T00:31:17Z","receivedAt":"2010-09-16T00:31:17Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Wed, Sep 15, 2010 at 03:58:22PM -0500, Brandon Casey wrote:\n\n> From: Brandon Casey <drafnel@gmail.com>\n> \n> The ancient touch on Solaris 7 thinks that a decimal number supplied as\n> the first argument specifies a date_time to give to the files specified by\n> the remaining arguments.  In this case, it fails to parse '1' as a proper\n> date_time and exits with a failure status.  Workaround this flaw by\n> rearranging the arguments supplied to touch so that a non-digit appears\n> first and touch will not be confused.\n\nHmm, this seemed eerily familiar, and sure enough:\n\n  http://article.gmane.org/gmane.comp.version-control.git/101270\n\nI don't _think_ I had Solaris 7 anytime recently, so the issue may be\neven more widespread (I would guess that my patch was a result of\nSolaris 8). Anyway, good catch.\n\n-Peff\n"},{"id":"150913","messageId":"AANLkTinKxSugWedXxLPkSUKyRBBkTimawVY23+A5nzsZ@mail.gmail.com","threadId":"25114","inReplyTo":"20100916003117.GA2527@sigill.intra.peff.net","subject":"Re: [PATCH] t/t7300: workaround ancient touch by rearranging arguments","fromName":"Sverre Rabbelier","fromEmail":"srabbelier@gmail.com","sentAt":"2010-09-17T23:26:25Z","receivedAt":"2010-09-17T23:26:25Z","isPatch":true,"sender":{"key":"srabbelier@gmail.com","avatar":"https://avatars.githubusercontent.com/u/3098?v=4"},"body":"Heya,\n\nOn Thu, Sep 16, 2010 at 02:31, Jeff King <peff@peff.net> wrote:\n> Hmm, this seemed eerily familiar, and sure enough:\n>\n>  http://article.gmane.org/gmane.comp.version-control.git/101270\n\nDoes this call for a git_touch which does a regular 'touch' for each\nof its arguments?\n\n-- \nCheers,\n\nSverre Rabbelier\n"},{"id":"150920","messageId":"20100918034619.GA18343@sigill.intra.peff.net","threadId":"25114","inReplyTo":"AANLkTinKxSugWedXxLPkSUKyRBBkTimawVY23+A5nzsZ@mail.gmail.com","subject":"Re: [PATCH] t/t7300: workaround ancient touch by rearranging arguments","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2010-09-18T03:46:19Z","receivedAt":"2010-09-18T03:46:19Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Sep 18, 2010 at 01:26:25AM +0200, Sverre Rabbelier wrote:\n\n> On Thu, Sep 16, 2010 at 02:31, Jeff King <peff@peff.net> wrote:\n> > Hmm, this seemed eerily familiar, and sure enough:\n> >\n> >  http://article.gmane.org/gmane.comp.version-control.git/101270\n> \n> Does this call for a git_touch which does a regular 'touch' for each\n> of its arguments?\n\nI don't know the broken touch's behavior, and I don't have it handy. It\nmight handle \"touch 1\" fine or it might interpret it as \"touch at time\n1, no file arguments\". Brandon's solution is good enough for a test\nscript.\n\nIf you really wanted a portable git_touch, you would spell it \">>$file\".\n\n-Peff\n"}]}