{"thread":{"id":"6572","subject":"[PATCH] Replace perl code with pure shell code","startedAt":"2007-01-29T08:09:25Z","lastAt":"2007-01-30T10:57:10Z","messageCount":12,"participants":["Simon 'corecode' Schubert","Junio C Hamano","Shawn O. Pearce","Randal L. Schwartz","Nikolai Weibull","Jakub Narebski"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"32948","messageId":"45BDABB5.4070301@fs.ei.tum.de","threadId":"6572","inReplyTo":null,"subject":"[PATCH] Replace perl code with pure shell code","fromName":"Simon 'corecode' Schubert","fromEmail":"corecode@fs.ei.tum.de","sentAt":"2007-01-29T08:09:25Z","receivedAt":"2007-01-29T08:09:25Z","isPatch":true,"sender":{"key":"corecode@fs.ei.tum.de","avatar":"https://gravatar.com/avatar/eff9dbf0cdac0d1e6a6cd7ed0e50763edcb376b493b5253a35ff167918ad79e1?d=mp&s=160"},"body":"Signed-off-by: Simon 'corecode' Schubert <corecode@fs.ei.tum.de>\n---\n git-clone.sh |   65 ++++++++++++++++++---------------------------------------\n 1 files changed, 21 insertions(+), 44 deletions(-)\n\ndiff --git a/git-clone.sh b/git-clone.sh\nindex ced7dfb..b3c6fa4 100755\n--- a/git-clone.sh\n+++ b/git-clone.sh\n@@ -66,48 +66,6 @@ Perhaps git-update-server-info needs to be run there?\"\n \trm -f \"$GIT_DIR/REMOTE_HEAD\"\n }\n \n-# Read git-fetch-pack -k output and store the remote branches.\n-copy_refs='\n-use File::Path qw(mkpath);\n-use File::Basename qw(dirname);\n-my $git_dir = $ARGV[0];\n-my $use_separate_remote = $ARGV[1];\n-my $origin = $ARGV[2];\n-\n-my $branch_top = ($use_separate_remote ? \"remotes/$origin\" : \"heads\");\n-my $tag_top = \"tags\";\n-\n-sub store {\n-\tmy ($sha1, $name, $top) = @_;\n-\t$name = \"$git_dir/refs/$top/$name\";\n-\tmkpath(dirname($name));\n-\topen O, \">\", \"$name\";\n-\tprint O \"$sha1\\n\";\n-\tclose O;\n-}\n-\n-open FH, \"<\", \"$git_dir/CLONE_HEAD\";\n-while (<FH>) {\n-\tmy ($sha1, $name) = /^([0-9a-f]{40})\\s(.*)$/;\n-\tnext if ($name =~ /\\^\\173/);\n-\tif ($name eq \"HEAD\") {\n-\t\topen O, \">\", \"$git_dir/REMOTE_HEAD\";\n-\t\tprint O \"$sha1\\n\";\n-\t\tclose O;\n-\t\tnext;\n-\t}\n-\tif ($name =~ s/^refs\\/heads\\///) {\n-\t\tstore($sha1, $name, $branch_top);\n-\t\tnext;\n-\t}\n-\tif ($name =~ s/^refs\\/tags\\///) {\n-\t\tstore($sha1, $name, $tag_top);\n-\t\tnext;\n-\t}\n-}\n-close FH;\n-'\n-\n quiet=\n local=no\n use_local=no\n@@ -332,8 +290,27 @@ test -d \"$GIT_DIR/refs/reference-tmp\" && rm -fr \"$GIT_DIR/refs/reference-tmp\"\n if test -f \"$GIT_DIR/CLONE_HEAD\"\n then\n \t# Read git-fetch-pack -k output and store the remote branches.\n-\t@@PERL@@ -e \"$copy_refs\" \"$GIT_DIR\" \"$use_separate_remote\" \"$origin\" ||\n-\texit\n+\tif [ -n \"$use_separate_remote\" ]\n+\tthen\n+\t\tbranch_top=\"remotes/$origin\"\n+\telse\n+\t\tbranch_top=\"heads\"\n+\tfi\n+\ttag_top=\"tags\"\n+\twhile read sha1 name\n+\tdo\n+\t\tcase \"$name\" in\n+\t\tHEAD)\n+\t\t\tdestname=\"REMOTE_HEAD\" ;;\n+\t\trefs/heads/*)\n+\t\t\tdestname=\"refs/$branch_top/${name#refs/heads/}\" ;;\n+\t\trefs/tags/*)\n+\t\t\tdestname=\"refs/$tag_top/${name#refs/tags/}\" ;;\n+\t\t*)\n+\t\t\tcontinue ;;\n+\t\tesac\n+\t\tgit-update-ref -m \"clone: from $repo\" \"$destname\" \"$sha1\" \"\"\n+\tdone < \"$GIT_DIR/CLONE_HEAD\"\n fi\n \n cd \"$D\" || exit\n-- \n1.5.0.rc1.196.geebfb\n\n\n"},{"id":"32949","messageId":"7vtzya8b4g.fsf@assigned-by-dhcp.cox.net","threadId":"6572","inReplyTo":"45BDABB5.4070301@fs.ei.tum.de","subject":"Re: [PATCH] Replace perl code with pure shell code","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-29T08:56:15Z","receivedAt":"2007-01-29T08:56:15Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Simon 'corecode' Schubert <corecode@fs.ei.tum.de> writes:\n\n> Signed-off-by: Simon 'corecode' Schubert <corecode@fs.ei.tum.de>\n> ...\n> diff --git a/git-clone.sh b/git-clone.sh\n> index ced7dfb..b3c6fa4 100755\n> --- a/git-clone.sh\n> +++ b/git-clone.sh\n> @@ -66,48 +66,6 @@ Perhaps git-update-server-info needs to be run there?\"\n> ...\n> -open FH, \"<\", \"$git_dir/CLONE_HEAD\";\n> -while (<FH>) {\n> -\tmy ($sha1, $name) = /^([0-9a-f]{40})\\s(.*)$/;\n> -\tnext if ($name =~ /\\^\\173/);\n> -\tif ($name eq \"HEAD\") {\n> ...\n\nThanks.  I like the general direction, but not quite.\n\nYou exposed one outstanding bug, which is a hint about what is\nnot quite right with your patch.\n\n-- >8 --\n[PATCH] update-ref: do not accept malformatted refs.\n\nWe used to use lock_any_ref_for_update() because the command\nneeds to also update HEAD (which is not under refs/, so\nlock_ref_sha1() cannot be used).  The function however did not\ncheck for refs with illegal characters in them.\n\nUse check_ref_format() to catch malformed refs.  For this check,\nwe specifically do not want to say having less than two levels\nin the name is illegal to allow HEAD (and perhaps other special\nrefs in the future).\n\nSigned-off-by: Junio C Hamano <junkio@cox.net>\n---\ndiff --git a/builtin-update-ref.c b/builtin-update-ref.c\nindex 1461937..5ee960b 100644\n--- a/builtin-update-ref.c\n+++ b/builtin-update-ref.c\n@@ -61,10 +61,8 @@ int cmd_update_ref(int argc, const char **argv, const char *prefix)\n \n \tlock = lock_any_ref_for_update(refname, oldval ? oldsha1 : NULL);\n \tif (!lock)\n-\t\treturn 1;\n+\t\tdie(\"%s: cannot lock the ref\", refname);\n \tif (write_ref_sha1(lock, sha1, msg) < 0)\n-\t\treturn 1;\n-\n-\t/* write_ref_sha1 always unlocks the ref, no need to do it explicitly */\n+\t\tdie(\"%s: cannot update the ref\", refname);\n \treturn 0;\n }\ndiff --git a/refs.c b/refs.c\nindex 12e46b8..3db444c 100644\n--- a/refs.c\n+++ b/refs.c\n@@ -710,6 +710,8 @@ struct ref_lock *lock_ref_sha1(const char *ref, const unsigned char *old_sha1)\n \n struct ref_lock *lock_any_ref_for_update(const char *ref, const unsigned char *old_sha1)\n {\n+\tif (check_ref_format(ref) == -1)\n+\t\treturn NULL;\n \treturn lock_ref_sha1_basic(ref, old_sha1, NULL);\n }\n \n"},{"id":"32950","messageId":"45BDBBCA.6030107@fs.ei.tum.de","threadId":"6572","inReplyTo":"7vtzya8b4g.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH] Replace perl code with pure shell code","fromName":"Simon 'corecode' Schubert","fromEmail":"corecode@fs.ei.tum.de","sentAt":"2007-01-29T09:18:02Z","receivedAt":"2007-01-29T09:18:02Z","isPatch":true,"sender":{"key":"corecode@fs.ei.tum.de","avatar":"https://gravatar.com/avatar/eff9dbf0cdac0d1e6a6cd7ed0e50763edcb376b493b5253a35ff167918ad79e1?d=mp&s=160"},"body":"\nSigned-off-by: Simon 'corecode' Schubert <corecode@fs.ei.tum.de>\n---\n>> -\tnext if ($name =~ /\\^\\173/);\n>> -\tif ($name eq \"HEAD\") {\n>> ...\n> \n> Thanks.  I like the general direction, but not quite.\n> \n> You exposed one outstanding bug, which is a hint about what is\n> not quite right with your patch.\n\nI already wondered.  What's those ^{} tags, and why is CLONE_HEAD littered with them?\n\n git-clone.sh |   67 ++++++++++++++++++++--------------------------------------\n 1 files changed, 23 insertions(+), 44 deletions(-)\n\ndiff --git a/git-clone.sh b/git-clone.sh\nindex ced7dfb..869caf9 100755\n--- a/git-clone.sh\n+++ b/git-clone.sh\n@@ -66,48 +66,6 @@ Perhaps git-update-server-info needs to be run there?\"\n \trm -f \"$GIT_DIR/REMOTE_HEAD\"\n }\n \n-# Read git-fetch-pack -k output and store the remote branches.\n-copy_refs='\n-use File::Path qw(mkpath);\n-use File::Basename qw(dirname);\n-my $git_dir = $ARGV[0];\n-my $use_separate_remote = $ARGV[1];\n-my $origin = $ARGV[2];\n-\n-my $branch_top = ($use_separate_remote ? \"remotes/$origin\" : \"heads\");\n-my $tag_top = \"tags\";\n-\n-sub store {\n-\tmy ($sha1, $name, $top) = @_;\n-\t$name = \"$git_dir/refs/$top/$name\";\n-\tmkpath(dirname($name));\n-\topen O, \">\", \"$name\";\n-\tprint O \"$sha1\\n\";\n-\tclose O;\n-}\n-\n-open FH, \"<\", \"$git_dir/CLONE_HEAD\";\n-while (<FH>) {\n-\tmy ($sha1, $name) = /^([0-9a-f]{40})\\s(.*)$/;\n-\tnext if ($name =~ /\\^\\173/);\n-\tif ($name eq \"HEAD\") {\n-\t\topen O, \">\", \"$git_dir/REMOTE_HEAD\";\n-\t\tprint O \"$sha1\\n\";\n-\t\tclose O;\n-\t\tnext;\n-\t}\n-\tif ($name =~ s/^refs\\/heads\\///) {\n-\t\tstore($sha1, $name, $branch_top);\n-\t\tnext;\n-\t}\n-\tif ($name =~ s/^refs\\/tags\\///) {\n-\t\tstore($sha1, $name, $tag_top);\n-\t\tnext;\n-\t}\n-}\n-close FH;\n-'\n-\n quiet=\n local=no\n use_local=no\n@@ -332,8 +290,29 @@ test -d \"$GIT_DIR/refs/reference-tmp\" && rm -fr \"$GIT_DIR/refs/reference-tmp\"\n if test -f \"$GIT_DIR/CLONE_HEAD\"\n then\n \t# Read git-fetch-pack -k output and store the remote branches.\n-\t@@PERL@@ -e \"$copy_refs\" \"$GIT_DIR\" \"$use_separate_remote\" \"$origin\" ||\n-\texit\n+\tif [ -n \"$use_separate_remote\" ]\n+\tthen\n+\t\tbranch_top=\"remotes/$origin\"\n+\telse\n+\t\tbranch_top=\"heads\"\n+\tfi\n+\ttag_top=\"tags\"\n+\twhile read sha1 name\n+\tdo\n+\t\tcase \"$name\" in\n+\t\t*^{*)\n+\t\t\tcontinue ;;\n+\t\tHEAD)\n+\t\t\tdestname=\"REMOTE_HEAD\" ;;\n+\t\trefs/heads/*)\n+\t\t\tdestname=\"refs/$branch_top/${name#refs/heads/}\" ;;\n+\t\trefs/tags/*)\n+\t\t\tdestname=\"refs/$tag_top/${name#refs/tags/}\" ;;\n+\t\t*)\n+\t\t\tcontinue ;;\n+\t\tesac\n+\t\tgit-update-ref -m \"clone: from $repo\" \"$destname\" \"$sha1\" \"\"\n+\tdone < \"$GIT_DIR/CLONE_HEAD\"\n fi\n \n cd \"$D\" || exit\n-- \n1.5.0.rc1.196.geebfb\n\n\n"},{"id":"32951","messageId":"20070129092815.GA22486@spearce.org","threadId":"6572","inReplyTo":"45BDBBCA.6030107@fs.ei.tum.de","subject":"Re: [PATCH] Replace perl code with pure shell code","fromName":"Shawn O. Pearce","fromEmail":"spearce@spearce.org","sentAt":"2007-01-29T09:28:16Z","receivedAt":"2007-01-29T09:28:16Z","isPatch":true,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"Simon 'corecode' Schubert <corecode@fs.ei.tum.de> wrote:\n> I already wondered.  What's those ^{} tags, and why is CLONE_HEAD littered \n> with them?\n\nThey are the deref of the thing without them.\n\nAs in, \"foo\" is a tag pointing at some object (probably a commit\nbut not necessarily) then \"foo^{}\" is whatever \"foo\"'s tag points at.\n \n> +\t\tcase \"$name\" in\n> +\t\t*^{*)\n> +\t\t\tcontinue ;;\n\nProbably could just be:\n\n\t\tcase \"$name\" in\n\t\t*^{})\n\t\t\tcontinue ;;\n\nThis is common in Git.  ^{} on the end of a ref name shows up in\nthe peek-remote/ls-remote output, but certainly is *not* a ref.\n\nSorry I missed that case eariler when I reviewed the patch. I thought\nabout it and why it wasn't handled here, but then thought maybe it\nwasn't actually occuring in the input (that someone else higher up\nhad filtered them out).\n\n-- \nShawn.\n"},{"id":"32955","messageId":"86zm82dpql.fsf@blue.stonehenge.com","threadId":"6572","inReplyTo":"45BDABB5.4070301@fs.ei.tum.de","subject":"Re: [PATCH] Replace perl code with pure shell code","fromName":"Randal L. Schwartz","fromEmail":"merlyn@stonehenge.com","sentAt":"2007-01-29T11:41:38Z","receivedAt":"2007-01-29T11:41:38Z","isPatch":true,"sender":{"key":"merlyn@stonehenge.com","avatar":"https://gravatar.com/avatar/dc528d210743ff0333e6213f9ee7b33b23f1b7bc1f3c5a8c2d819074ecd7ab19?d=mp&s=160"},"body":">>>>> \"Simon\" == Simon 'corecode' Schubert <corecode@fs.ei.tum.de> writes:\n\nSimon> +\t\t\tdestname=\"refs/$branch_top/${name#refs/heads/}\" ;;\n\nI don't think this is portable shell.  At least Perl is the same everywhere.\nIgnore me if this is a shell syntax on something other than bash.\n\n-- \nRandal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095\n<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>\nPerl/Unix/security consulting, Technical writing, Comedy, etc. etc.\nSee PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!\n"},{"id":"32956","messageId":"dbfc82860701290438y4e00cc05s5f8c8acdc8022768@mail.gmail.com","threadId":"6572","inReplyTo":"86zm82dpql.fsf@blue.stonehenge.com","subject":"Re: [PATCH] Replace perl code with pure shell code","fromName":"Nikolai Weibull","fromEmail":"now@bitwi.se","sentAt":"2007-01-29T12:38:31Z","receivedAt":"2007-01-29T12:38:31Z","isPatch":true,"sender":{"key":"now@bitwi.se","avatar":"https://gravatar.com/avatar/d9242f067845cf9a72be23e4213c3b6e53492178e5df97372088a441af846133?d=mp&s=160"},"body":"On 1/29/07, Randal L. Schwartz <merlyn@stonehenge.com> wrote:\n> >>>>> \"Simon\" == Simon 'corecode' Schubert <corecode@fs.ei.tum.de> writes:\n>\n> Simon> +                        destname=\"refs/$branch_top/${name#refs/heads/}\" ;;\n>\n> I don't think this is portable shell.  At least Perl is the same everywhere.\n> Ignore me if this is a shell syntax on something other than bash.\n\nAccording to \"The Open Group Base Specifications Issue 6\" [1]:\n\n${parameter#word}\n    Remove Smallest Prefix Pattern. The word shall be expanded to\nproduce a pattern. The parameter expansion shall then result in\nparameter, with the smallest portion of the prefix matched by the\npattern deleted.\n\nWe do require a POSIX-compliant version of sh already, right?\n\n  nikolai\n\n[1] http://www.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html#tag_02_06_02\n"},{"id":"32957","messageId":"epkq3v$66p$1@sea.gmane.org","threadId":"6572","inReplyTo":"86zm82dpql.fsf@blue.stonehenge.com","subject":"Re: [PATCH] Replace perl code with pure shell code","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2007-01-29T12:43:54Z","receivedAt":"2007-01-29T12:43:54Z","isPatch":true,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Randal L. Schwartz wrote:\n\n>>>>>> \"Simon\" == Simon 'corecode' Schubert <corecode@fs.ei.tum.de> writes:\n> \n> Simon> +                      destname=\"refs/$branch_top/${name#refs/heads/}\" ;;\n> \n> I don't think this is portable shell.  At least Perl is the same everywhere.\n> Ignore me if this is a shell syntax on something other than bash.\n\nI think ${var#pattern} is a POSIX shell syntax.\n\nNevertheless Perl embedded in shell script is (a bit) horrible.\n\n-- \nJakub Narebski\nWarsaw, Poland\nShadeHawk on #git\n"},{"id":"32958","messageId":"86fy9udmf6.fsf@blue.stonehenge.com","threadId":"6572","inReplyTo":"dbfc82860701290438y4e00cc05s5f8c8acdc8022768@mail.gmail.com","subject":"Re: [PATCH] Replace perl code with pure shell code","fromName":"Randal L. Schwartz","fromEmail":"merlyn@stonehenge.com","sentAt":"2007-01-29T12:53:17Z","receivedAt":"2007-01-29T12:53:17Z","isPatch":true,"sender":{"key":"merlyn@stonehenge.com","avatar":"https://gravatar.com/avatar/dc528d210743ff0333e6213f9ee7b33b23f1b7bc1f3c5a8c2d819074ecd7ab19?d=mp&s=160"},"body":">>>>> \"Nikolai\" == Nikolai Weibull <now@bitwi.se> writes:\n\nNikolai> We do require a POSIX-compliant version of sh already, right?\n\nOK, sorry for raising the flag.  I just know that writing portable shell\nis far trickier than writing portable Perl, so I get overly cautious\non anything that wasn't in Unix V7.\n\n-- \nRandal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095\n<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>\nPerl/Unix/security consulting, Technical writing, Comedy, etc. etc.\nSee PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!\n"},{"id":"32959","messageId":"86bqkidmcy.fsf@blue.stonehenge.com","threadId":"6572","inReplyTo":"epkq3v$66p$1@sea.gmane.org","subject":"Re: [PATCH] Replace perl code with pure shell code","fromName":"Randal L. Schwartz","fromEmail":"merlyn@stonehenge.com","sentAt":"2007-01-29T12:54:37Z","receivedAt":"2007-01-29T12:54:37Z","isPatch":true,"sender":{"key":"merlyn@stonehenge.com","avatar":"https://gravatar.com/avatar/dc528d210743ff0333e6213f9ee7b33b23f1b7bc1f3c5a8c2d819074ecd7ab19?d=mp&s=160"},"body":">>>>> \"Jakub\" == Jakub Narebski <jnareb@gmail.com> writes:\n\nJakub> Nevertheless Perl embedded in shell script is (a bit) horrible.\n\nI will agree with that.  Either all Perl, or all shell, unless there's\nan operation that begs for portability for which Perl can be an asset.\n\n-- \nRandal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095\n<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>\nPerl/Unix/security consulting, Technical writing, Comedy, etc. etc.\nSee PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!\n"},{"id":"32960","messageId":"dbfc82860701290517p739c78a1td05fd0900e280515@mail.gmail.com","threadId":"6572","inReplyTo":"86fy9udmf6.fsf@blue.stonehenge.com","subject":"Re: [PATCH] Replace perl code with pure shell code","fromName":"Nikolai Weibull","fromEmail":"now@bitwi.se","sentAt":"2007-01-29T13:17:43Z","receivedAt":"2007-01-29T13:17:43Z","isPatch":true,"sender":{"key":"now@bitwi.se","avatar":"https://gravatar.com/avatar/d9242f067845cf9a72be23e4213c3b6e53492178e5df97372088a441af846133?d=mp&s=160"},"body":"On 1/29/07, Randal L. Schwartz <merlyn@stonehenge.com> wrote:\n> >>>>> \"Nikolai\" == Nikolai Weibull <now@bitwi.se> writes:\n>\n> Nikolai> We do require a POSIX-compliant version of sh already, right?\n>\n> OK, sorry for raising the flag.  I just know that writing portable shell\n> is far trickier than writing portable Perl, so I get overly cautious\n> on anything that wasn't in Unix V7.\n\nNo problem; I wasn't sure on the current requirements myself :-).\nIt's too bad that not all the great stuff one can find in Bash and Zsh\nwere in the original...\n\n  nikolai\n"},{"id":"32961","messageId":"864pqadl4v.fsf@blue.stonehenge.com","threadId":"6572","inReplyTo":"dbfc82860701290517p739c78a1td05fd0900e280515@mail.gmail.com","subject":"Re: [PATCH] Replace perl code with pure shell code","fromName":"Randal L. Schwartz","fromEmail":"merlyn@stonehenge.com","sentAt":"2007-01-29T13:21:04Z","receivedAt":"2007-01-29T13:21:04Z","isPatch":true,"sender":{"key":"merlyn@stonehenge.com","avatar":"https://gravatar.com/avatar/dc528d210743ff0333e6213f9ee7b33b23f1b7bc1f3c5a8c2d819074ecd7ab19?d=mp&s=160"},"body":">>>>> \"Nikolai\" == Nikolai Weibull <now@bitwi.se> writes:\n\nNikolai> On 1/29/07, Randal L. Schwartz <merlyn@stonehenge.com> wrote:\n>> >>>>> \"Nikolai\" == Nikolai Weibull <now@bitwi.se> writes:\n>> \nNikolai> We do require a POSIX-compliant version of sh already, right?\n>> \n>> OK, sorry for raising the flag.  I just know that writing portable shell\n>> is far trickier than writing portable Perl, so I get overly cautious\n>> on anything that wasn't in Unix V7.\n\nNikolai> No problem; I wasn't sure on the current requirements myself :-).\nNikolai> It's too bad that not all the great stuff one can find in Bash and Zsh\nNikolai> were in the original...\n\nI'll probably seem like a traitor to my tribe for saying this, but if zsh or\ngnu awk had been around at the time Perl was created, we wouldn't have seen\nPerl.  Of course, Perl has gone far beyond the \"awk replacement\" as originally\nplanned, but who knows what might have happened next?\n\n-- \nRandal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095\n<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>\nPerl/Unix/security consulting, Technical writing, Comedy, etc. etc.\nSee PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!\n"},{"id":"33033","messageId":"7vlkjkzss9.fsf@assigned-by-dhcp.cox.net","threadId":"6572","inReplyTo":"86fy9udmf6.fsf@blue.stonehenge.com","subject":"Re: [PATCH] Replace perl code with pure shell code","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-01-30T10:57:10Z","receivedAt":"2007-01-30T10:57:10Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"merlyn@stonehenge.com (Randal L. Schwartz) writes:\n\n>>>>>> \"Nikolai\" == Nikolai Weibull <now@bitwi.se> writes:\n>\n> Nikolai> We do require a POSIX-compliant version of sh already, right?\n>\n> OK, sorry for raising the flag.  I just know that writing portable shell\n> is far trickier than writing portable Perl, so I get overly cautious\n> on anything that wasn't in Unix V7.\n\nYou seem to be as old fashioned as I am (I grew up with V7\nshell).  People complained often enough how antiquated my shell\nscript (hence many but not all git Porcelain-ish) style is.\n\nI have tried very hard to reject \"Hey, it's in POSIX -- we'll\nuse it and screw platforms that are not exactly POSIX\".  I only\nuse POSIX as a yardstick to decide what to stay away from, as in\n\"Let's not use ${parameter//pattern/string} -- it is not _even_\nin POSIX\".\n"}]}