{"thread":{"id":"4860","subject":"remove perl from git-commit.sh","startedAt":"2006-07-12T11:15:03Z","lastAt":"2006-07-13T08:30:43Z","messageCount":9,"participants":["Alex Riesen","Nikolai Weibull","Petr Baudis","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"23700","messageId":"81b0412b0607120415g243f2160tf42c40e52b8bc9ac@mail.gmail.com","threadId":"4860","inReplyTo":null,"subject":"remove perl from git-commit.sh","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2006-07-12T11:15:03Z","receivedAt":"2006-07-12T11:15:03Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"It is really annoying when the essentials do not work.\nI think we could improve at  least them, by minimizing\ntheir dependencies to external tools.\n\n---\n\ngit-commit.sh has only ohne place where perl is used\nand it can actually quite trivially be done in sh.\ngit-ls-files without \"-z\" produces quoted output, even if\nis different from that produced by perl code it could be\nenough. Otherwise I'd better suggest to add another\nquoting style (replacing only \\t, \\n and backslash) than\nhaving to constantly patch git-commit.sh for binmode\nor perl path (Windows has no stable tool set, and perl\nfor instance often resides \"somewhere\").\n\n\nFrom 69bf41df4ef69d0f1e4ab52942c59bb3fd568cb8 Mon Sep 17 00:00:00 2001\nFrom: Alex Riesen <raa.lkml@gmail.com>\nDate: Wed, 12 Jul 2006 13:02:23 +0200\nSubject: remove perl from git-commit.sh\n---\n git-commit.sh |   32 +++++++++++++-------------------\n 1 files changed, 13 insertions(+), 19 deletions(-)\n\ndiff --git a/git-commit.sh b/git-commit.sh\nindex 802dd72..4cf3fab 100755\n--- a/git-commit.sh\n+++ b/git-commit.sh\n@@ -138,32 +138,26 @@ #'\n         if test -z \"$untracked_files\"; then\n             option=\"--directory --no-empty-directory\"\n         fi\n+\thdr_shown=\n \tif test -f \"$GIT_DIR/info/exclude\"\n \tthen\n-\t    git-ls-files -z --others $option \\\n+\t    git-ls-files --others $option \\\n \t\t--exclude-from=\"$GIT_DIR/info/exclude\" \\\n \t\t--exclude-per-directory=.gitignore\n \telse\n-\t    git-ls-files -z --others $option \\\n+\t    git-ls-files --others $option \\\n \t\t--exclude-per-directory=.gitignore\n \tfi |\n-\t@@PERL@@ -e '$/ = \"\\0\";\n-\t    my $shown = 0;\n-\t    while (<>) {\n-\t\tchomp;\n-\t\ts|\\\\|\\\\\\\\|g;\n-\t\ts|\\t|\\\\t|g;\n-\t\ts|\\n|\\\\n|g;\n-\t\ts/^/#\t/;\n-\t\tif (!$shown) {\n-\t\t    print \"#\\n# Untracked files:\\n\";\n-\t\t    print \"#   (use \\\"git add\\\" to add to commit)\\n\";\n-\t\t    print \"#\\n\";\n-\t\t    $shown = 1;\n-\t\t}\n-\t\tprint \"$_\\n\";\n-\t    }\n-\t'\n+\twhile read line; do\n+\t    if [ -z \"$hdr_shown\" ]; then\n+\t\techo '#'\n+\t\techo '# Untracked files:'\n+\t\techo '#   (use \"git add\" to add to commit)'\n+\t\techo '#'\n+\t\thdr_shown=1\n+\t    fi\n+\t    echo \"#\t$line\"\n+\tdone\n \n \tif test -n \"$verbose\" -a -z \"$IS_INITIAL\"\n \tthen\n-- \n1.4.1.gb4adf\n\n"},{"id":"23701","messageId":"dbfc82860607120417m19c0ecefydb4b3f4cf60d646a@mail.gmail.com","threadId":"4860","inReplyTo":"81b0412b0607120415g243f2160tf42c40e52b8bc9ac@mail.gmail.com","subject":"Re: remove perl from git-commit.sh","fromName":"Nikolai Weibull","fromEmail":"now@bitwi.se","sentAt":"2006-07-12T11:17:52Z","receivedAt":"2006-07-12T11:17:52Z","isPatch":false,"sender":{"key":"now@bitwi.se","avatar":"https://gravatar.com/avatar/d9242f067845cf9a72be23e4213c3b6e53492178e5df97372088a441af846133?d=mp&s=160"},"body":"On 7/12/06, Alex Riesen <raa.lkml@gmail.com> wrote:\n> Otherwise I'd better suggest to add another\n> quoting style (replacing only \\t, \\n and backslash)\n\nOne could always do the quoting with sed, or am I missing something?\n\n  nikolai\n"},{"id":"23702","messageId":"81b0412b0607120423q8c75ecl7d42dfd67f99a549@mail.gmail.com","threadId":"4860","inReplyTo":"dbfc82860607120417m19c0ecefydb4b3f4cf60d646a@mail.gmail.com","subject":"Re: remove perl from git-commit.sh","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2006-07-12T11:23:04Z","receivedAt":"2006-07-12T11:23:04Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On 7/12/06, Nikolai Weibull <now@bitwi.se> wrote:\n> > Otherwise I'd better suggest to add another\n> > quoting style (replacing only \\t, \\n and backslash)\n>\n> One could always do the quoting with sed, or am I missing something?\n>\n\nNo, but if look closely at this list you'll find a lot of incompatibilities\nin sed too. So the less, the better\n"},{"id":"23703","messageId":"dbfc82860607120435v5482ce31pdf002f049c51669a@mail.gmail.com","threadId":"4860","inReplyTo":"81b0412b0607120423q8c75ecl7d42dfd67f99a549@mail.gmail.com","subject":"Re: remove perl from git-commit.sh","fromName":"Nikolai Weibull","fromEmail":"now@bitwi.se","sentAt":"2006-07-12T11:35:18Z","receivedAt":"2006-07-12T11:35:18Z","isPatch":false,"sender":{"key":"now@bitwi.se","avatar":"https://gravatar.com/avatar/d9242f067845cf9a72be23e4213c3b6e53492178e5df97372088a441af846133?d=mp&s=160"},"body":"On 7/12/06, Alex Riesen <raa.lkml@gmail.com> wrote:\n\n> On 7/12/06, Nikolai Weibull <now@bitwi.se> wrote:\n\n> > > Otherwise I'd better suggest to add another\n> > > quoting style (replacing only \\t, \\n and backslash)\n\n> > One could always do the quoting with sed, or am I missing something?\n\n> No, but if look closely at this list you'll find a lot of incompatibilities\n> in sed too. So the less, the better\n\nWell, that's true, of course, but something as \"simple\" as what is\nneeded in this case should be possible.  Anyway, I was just wondering\nwhat the motives were, not questioning them ;-).\n\n  nikolai\n"},{"id":"23704","messageId":"81b0412b0607120441x310f0631i6b0043cf8d28c50c@mail.gmail.com","threadId":"4860","inReplyTo":"dbfc82860607120435v5482ce31pdf002f049c51669a@mail.gmail.com","subject":"Re: remove perl from git-commit.sh","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2006-07-12T11:41:02Z","receivedAt":"2006-07-12T11:41:02Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On 7/12/06, Nikolai Weibull <now@bitwi.se> wrote:\n> Anyway, I was just wondering\n> what the motives were, not questioning them ;-).\n\nBeing forced to use ActiveState Perl on a W2K in a\ncorporate environment.\n"},{"id":"23705","messageId":"20060712114805.GD13776@pasky.or.cz","threadId":"4860","inReplyTo":"81b0412b0607120415g243f2160tf42c40e52b8bc9ac@mail.gmail.com","subject":"Re: remove perl from git-commit.sh","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-07-12T11:48:05Z","receivedAt":"2006-07-12T11:48:05Z","isPatch":false,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Wed, Jul 12, 2006 at 01:15:03PM CEST, I got a letter\nwhere Alex Riesen <raa.lkml@gmail.com> said that...\n> ---\n\nBTW, why people so often want to keep stuff like the following from\ncommit messages?\n\n> git-commit.sh has only ohne place where perl is used\n> and it can actually quite trivially be done in sh.\n> git-ls-files without \"-z\" produces quoted output, even if\n> is different from that produced by perl code it could be\n> enough. Otherwise I'd better suggest to add another\n> quoting style (replacing only \\t, \\n and backslash)\n\nOf course getting rid of Perl from the \"essentials\" is an option...\n\n> than having to constantly patch git-commit.sh for binmode\n> or perl path (Windows has no stable tool set, and perl\n> for instance often resides \"somewhere\").\n\n...but I would prefer much better if we could actually fix the problem.\nI'm not sure what \"patching for binmode\" takes but it sounds that we\nshould do it for the other Perl scripts anyway. If Cygwin usually really\ndoesn't have stable Perl path, you could special-case PERL_PATH in\nMakefile for Cygwin to be just \"perl\" (or perhaps that's the issue only\nfor non-source packages so you might want to simply set PERL_PATH to\nperl when building those).\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nSnow falling on Perl. White noise covering line noise.\nHides all the bugs too. -- J. Putnam\n"},{"id":"23706","messageId":"81b0412b0607120523t34cfb92bs872f6d45b1b48759@mail.gmail.com","threadId":"4860","inReplyTo":"20060712114805.GD13776@pasky.or.cz","subject":"Re: remove perl from git-commit.sh","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2006-07-12T12:23:07Z","receivedAt":"2006-07-12T12:23:07Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"On 7/12/06, Petr Baudis <pasky@suse.cz> wrote:\n> BTW, why people so often want to keep stuff like the following from\n> commit messages?\n\nWell, strictly speaking it isn't the description of what the patch does.\n\n> > than having to constantly patch git-commit.sh for binmode\n> > or perl path (Windows has no stable tool set, and perl\n> > for instance often resides \"somewhere\").\n>\n> ...but I would prefer much better if we could actually fix the problem.\n> I'm not sure what \"patching for binmode\" takes but it sounds that we\n\nActiveState Perl normally replaces \\n in the output with \\r\\n, which is\nannoying, as the rest of git does output \\n verbatim.\n\n> should do it for the other Perl scripts anyway. If Cygwin usually really\n> doesn't have stable Perl path, you could special-case PERL_PATH in\n\nIt's not cygwin. It's an organization typical for windows environements:\nstinky trash can.\n\n> Makefile for Cygwin to be just \"perl\" (or perhaps that's the issue only\n> for non-source packages so you might want to simply set PERL_PATH to\n> perl when building those).\n\nI did. I didn't mention it because the patch was about the binmode.\nsh is from cygwin here, so just removing this one dependency helps\na lot. I will change other scripts as soon as they get problematic.\n\nAnother small problem is with windows pathnames (activestate perl\nexpects _windows_ path, but allows forward slashes in it: c:/a/b/c).\nI have calls to cygpath (converts cygwin path to windows and vice\nversa) all over (not everywhere, just clone, rerere, mv, shortlog and\nfmt-merge-msg. The tools that were important to me) just to deal\nwith this. It's a horribly unstable and poorly tested and breaks from\ntime to time but it mostly works. As I saw no complaints here about\nthe same problem I have never submitted the changes. Maybe I am\njust unlucky to have to deal with windows so often.\n"},{"id":"23736","messageId":"7v3bd6xgnz.fsf@assigned-by-dhcp.cox.net","threadId":"4860","inReplyTo":"81b0412b0607120415g243f2160tf42c40e52b8bc9ac@mail.gmail.com","subject":"Re: remove perl from git-commit.sh","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-07-13T04:38:56Z","receivedAt":"2006-07-13T04:38:56Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Alex Riesen\" <raa.lkml@gmail.com> writes:\n\n> It is really annoying when the essentials do not work.\n> I think we could improve at  least them, by minimizing\n> their dependencies to external tools.\n>\n> ---\n>\n> git-commit.sh has only ohne place where perl is used\n> and it can actually quite trivially be done in sh.\n> git-ls-files without \"-z\" produces quoted output, even if\n> is different from that produced by perl code it could be\n> enough. Otherwise I'd better suggest to add another\n> quoting style (replacing only \\t, \\n and backslash) than\n> having to constantly patch git-commit.sh for binmode\n> or perl path (Windows has no stable tool set, and perl\n> for instance often resides \"somewhere\").\n\n(1) Sign-off?\n\n(2) I think the cover letter comment talks more apporpirate\n    things than your proposed commit message.  The commit log is\n    not a place to vent your frustration.  It's where you\n    justify why that change was needed for people who will want\n    to figure out why your patch broke their workflow later.\n\nI do not think anybody parses git-status output to figure out\nthe list of paths that are touched/untracked/etc., so I am not\nopposed to this change itself.\n"},{"id":"23751","messageId":"81b0412b0607130130n52a25d91wd8476ad8d018623f@mail.gmail.com","threadId":"4860","inReplyTo":"7v3bd6xgnz.fsf@assigned-by-dhcp.cox.net","subject":"remove perl from git-commit.sh","fromName":"Alex Riesen","fromEmail":"raa.lkml@gmail.com","sentAt":"2006-07-13T08:30:43Z","receivedAt":"2006-07-13T08:30:43Z","isPatch":false,"sender":{"key":"raa.lkml@gmail.com","avatar":"https://avatars.githubusercontent.com/u/324101?v=4"},"body":"git-commit.sh has the only one place where perl is used\nand there it can quite trivially be done in sh.\n\ngit-ls-files without \"-z\" produces quoted output, even if\nis different from that produced by perl code it could be\nenough. Otherwise I'd better suggest to add another\nquoting style (replacing only \\t, \\n and backslash).\n\nThis system is an ugly combination of cygwin and\nactivestate perl. The combination has some quirks\n(like the perl producing \\r\\n by default, expecting\nwindows pathnames instead of cygwin fakes, or\nignoring environment variables under some hard to\nreproduce circumstances), so reducing number of\nthis interactions reduces number of hacks one has\nto put in core code to make things work. I used to\npatch git-commit.sh to put binmode in perl output,\nand git-clone.sh still has these calls to cygpath.\n\nSigned-off-by: Alex Riesen <raa.lkml@gmail.com>\n\n---\n\nIt is really annoying when the essentials do not work.\nI think we could improve at  least them, by minimizing\ntheir dependencies to external tools.\n\nJunio C Hamano wrote:\n> (1) Sign-off?\n\ndone\n\n> (2) I think the cover letter comment talks more apporpirate\n>    things than your proposed commit message.  The commit log is\n>    not a place to vent your frustration.  It's where you\n>    justify why that change was needed for people who will want\n>    to figure out why your patch broke their workflow later.\n\ndone.\n\n\nFrom 69bf41df4ef69d0f1e4ab52942c59bb3fd568cb8 Mon Sep 17 00:00:00 2001\nFrom: Alex Riesen <raa.lkml@gmail.com>\nDate: Wed, 12 Jul 2006 13:02:23 +0200\nSubject: remove perl from git-commit.sh\n---\n git-commit.sh |   32 +++++++++++++-------------------\n 1 files changed, 13 insertions(+), 19 deletions(-)\n\ndiff --git a/git-commit.sh b/git-commit.sh\nindex 802dd72..4cf3fab 100755\n--- a/git-commit.sh\n+++ b/git-commit.sh\n@@ -138,32 +138,26 @@ #'\n         if test -z \"$untracked_files\"; then\n             option=\"--directory --no-empty-directory\"\n         fi\n+\thdr_shown=\n \tif test -f \"$GIT_DIR/info/exclude\"\n \tthen\n-\t    git-ls-files -z --others $option \\\n+\t    git-ls-files --others $option \\\n \t\t--exclude-from=\"$GIT_DIR/info/exclude\" \\\n \t\t--exclude-per-directory=.gitignore\n \telse\n-\t    git-ls-files -z --others $option \\\n+\t    git-ls-files --others $option \\\n \t\t--exclude-per-directory=.gitignore\n \tfi |\n-\t@@PERL@@ -e '$/ = \"\\0\";\n-\t    my $shown = 0;\n-\t    while (<>) {\n-\t\tchomp;\n-\t\ts|\\\\|\\\\\\\\|g;\n-\t\ts|\\t|\\\\t|g;\n-\t\ts|\\n|\\\\n|g;\n-\t\ts/^/#\t/;\n-\t\tif (!$shown) {\n-\t\t    print \"#\\n# Untracked files:\\n\";\n-\t\t    print \"#   (use \\\"git add\\\" to add to commit)\\n\";\n-\t\t    print \"#\\n\";\n-\t\t    $shown = 1;\n-\t\t}\n-\t\tprint \"$_\\n\";\n-\t    }\n-\t'\n+\twhile read line; do\n+\t    if [ -z \"$hdr_shown\" ]; then\n+\t\techo '#'\n+\t\techo '# Untracked files:'\n+\t\techo '#   (use \"git add\" to add to commit)'\n+\t\techo '#'\n+\t\thdr_shown=1\n+\t    fi\n+\t    echo \"#\t$line\"\n+\tdone\n \n \tif test -n \"$verbose\" -a -z \"$IS_INITIAL\"\n \tthen\n-- \n1.4.1.gb4adf\n\n"}]}