{"thread":{"id":"34097","subject":"[PATCH 0/4] Janitorial work on hook templates","startedAt":"2013-06-10T18:35:59Z","lastAt":"2013-07-15T16:54:07Z","messageCount":35,"participants":["Richard Hartmann","Junio C Hamano","Jeff King","Jonathan Nieder"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"220346","messageId":"1370889365-6239-1-git-send-email-richih.mailinglist@gmail.com","threadId":"34097","inReplyTo":null,"subject":"[PATCH 0/4] Janitorial work on hook templates","fromName":"Richard Hartmann","fromEmail":"richih.mailinglist@gmail.com","sentAt":"2013-06-10T18:35:59Z","receivedAt":"2013-06-10T18:35:59Z","isPatch":true,"sender":{"key":"richih.mailinglist@gmail.com","avatar":"https://avatars.githubusercontent.com/u/754723?v=4"},"body":"Dear all,\n\nattached, you will find a series of small, obvious, and hopefully\nuncontroversial patches for the hook templates and the manpage.\nThey are all tiny, but I still decided to submit distinct patches\nto make modification/discussion easier.\n\nRichard Hartmann (6):\n  templates: Fewer subprocesses in pre-commit hook\n  templates: Reformat pre-commit hook's message\n  templates: Fix spelling in pre-commit hook\n  Documentation: Update manpage for pre-commit hook\n  templates: Fix ASCII art in pre-rebase hook\n  template: Fix comment indentation in pre-rebase hook\n\n Documentation/githooks.txt         |    3 ++-\n templates/hooks--pre-commit.sample |   26 ++++++++++++--------------\n templates/hooks--pre-rebase.sample |   26 +++++++++++++-------------\n 3 files changed, 27 insertions(+), 28 deletions(-)\n\n-- \n1.7.10.4\n"},{"id":"220351","messageId":"1370889365-6239-2-git-send-email-richih.mailinglist@gmail.com","threadId":"34097","inReplyTo":"1370889365-6239-1-git-send-email-richih.mailinglist@gmail.com","subject":"[PATCH 1/6] templates: Fewer subprocesses in pre-commit hook","fromName":"Richard Hartmann","fromEmail":"richih.mailinglist@gmail.com","sentAt":"2013-06-10T18:36:00Z","receivedAt":"2013-06-10T18:36:00Z","isPatch":true,"sender":{"key":"richih.mailinglist@gmail.com","avatar":"https://avatars.githubusercontent.com/u/754723?v=4"},"body":"Spawning a new subprocess for every line printed is inefficient.\nThus spawn only one instance of `echo`.\n\nSigned-off-by: Richard Hartmann <richih.mailinglist@gmail.com>\n---\n templates/hooks--pre-commit.sample |   24 ++++++++++++------------\n 1 file changed, 12 insertions(+), 12 deletions(-)\n\ndiff --git a/templates/hooks--pre-commit.sample b/templates/hooks--pre-commit.sample\nindex 18c4829..126ae13 100755\n--- a/templates/hooks--pre-commit.sample\n+++ b/templates/hooks--pre-commit.sample\n@@ -31,18 +31,18 @@ if [ \"$allownonascii\" != \"true\" ] &&\n \ttest $(git diff --cached --name-only --diff-filter=A -z $against |\n \t  LC_ALL=C tr -d '[ -~]\\0' | wc -c) != 0\n then\n-\techo \"Error: Attempt to add a non-ascii file name.\"\n-\techo\n-\techo \"This can cause problems if you want to work\"\n-\techo \"with people on other platforms.\"\n-\techo\n-\techo \"To be portable it is advisable to rename the file ...\"\n-\techo\n-\techo \"If you know what you are doing you can disable this\"\n-\techo \"check using:\"\n-\techo\n-\techo \"  git config hooks.allownonascii true\"\n-\techo\n+\techo 'Error: Attempt to add a non-ascii file name.\n+\n+This can cause problems if you want to work\n+with people on other platforms.\n+\n+To be portable it is advisable to rename the file.\n+\n+If you know what you are doing you can disable this\n+check using:\n+\n+  git config hooks.allownonascii true\n+'\n \texit 1\n fi\n \n-- \n1.7.10.4\n"},{"id":"220347","messageId":"1370889365-6239-3-git-send-email-richih.mailinglist@gmail.com","threadId":"34097","inReplyTo":"1370889365-6239-1-git-send-email-richih.mailinglist@gmail.com","subject":"[PATCH 2/6] templates: Reformat pre-commit hook's message","fromName":"Richard Hartmann","fromEmail":"richih.mailinglist@gmail.com","sentAt":"2013-06-10T18:36:01Z","receivedAt":"2013-06-10T18:36:01Z","isPatch":true,"sender":{"key":"richih.mailinglist@gmail.com","avatar":"https://avatars.githubusercontent.com/u/754723?v=4"},"body":"Now that the there's only one echo being spawned, the message can span\nthe full 80 chars.\n\nSigned-off-by: Richard Hartmann <richih.mailinglist@gmail.com>\n---\n templates/hooks--pre-commit.sample |    6 ++----\n 1 file changed, 2 insertions(+), 4 deletions(-)\n\ndiff --git a/templates/hooks--pre-commit.sample b/templates/hooks--pre-commit.sample\nindex 126ae13..7676c6e 100755\n--- a/templates/hooks--pre-commit.sample\n+++ b/templates/hooks--pre-commit.sample\n@@ -33,13 +33,11 @@ if [ \"$allownonascii\" != \"true\" ] &&\n then\n \techo 'Error: Attempt to add a non-ascii file name.\n \n-This can cause problems if you want to work\n-with people on other platforms.\n+This can cause problems if you want to work with people on other platforms.\n \n To be portable it is advisable to rename the file.\n \n-If you know what you are doing you can disable this\n-check using:\n+If you know what you are doing you can disable this check using:\n \n   git config hooks.allownonascii true\n '\n-- \n1.7.10.4\n"},{"id":"220348","messageId":"1370889365-6239-4-git-send-email-richih.mailinglist@gmail.com","threadId":"34097","inReplyTo":"1370889365-6239-1-git-send-email-richih.mailinglist@gmail.com","subject":"[PATCH 3/6] templates: Fix spelling in pre-commit hook","fromName":"Richard Hartmann","fromEmail":"richih.mailinglist@gmail.com","sentAt":"2013-06-10T18:36:02Z","receivedAt":"2013-06-10T18:36:02Z","isPatch":true,"sender":{"key":"richih.mailinglist@gmail.com","avatar":"https://avatars.githubusercontent.com/u/754723?v=4"},"body":"Signed-off-by: Richard Hartmann <richih.mailinglist@gmail.com>\n---\n templates/hooks--pre-commit.sample |    6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/templates/hooks--pre-commit.sample b/templates/hooks--pre-commit.sample\nindex 7676c6e..a982d99 100755\n--- a/templates/hooks--pre-commit.sample\n+++ b/templates/hooks--pre-commit.sample\n@@ -15,13 +15,13 @@ else\n \tagainst=4b825dc642cb6eb9a060e54bf8d69288fbee4904\n fi\n \n-# If you want to allow non-ascii filenames set this variable to true.\n+# If you want to allow non-ASCII filenames set this variable to true.\n allownonascii=$(git config hooks.allownonascii)\n \n # Redirect output to stderr.\n exec 1>&2\n \n-# Cross platform projects tend to avoid non-ascii filenames; prevent\n+# Cross platform projects tend to avoid non-ASCII filenames; prevent\n # them from being added to the repository. We exploit the fact that the\n # printable range starts at the space character and ends with tilde.\n if [ \"$allownonascii\" != \"true\" ] &&\n@@ -31,7 +31,7 @@ if [ \"$allownonascii\" != \"true\" ] &&\n \ttest $(git diff --cached --name-only --diff-filter=A -z $against |\n \t  LC_ALL=C tr -d '[ -~]\\0' | wc -c) != 0\n then\n-\techo 'Error: Attempt to add a non-ascii file name.\n+\techo 'Error: Attempt to add a non-ASCII file name.\n \n This can cause problems if you want to work with people on other platforms.\n \n-- \n1.7.10.4\n"},{"id":"220352","messageId":"1370889365-6239-5-git-send-email-richih.mailinglist@gmail.com","threadId":"34097","inReplyTo":"1370889365-6239-1-git-send-email-richih.mailinglist@gmail.com","subject":"[PATCH 4/6] Documentation: Update manpage for pre-commit hook","fromName":"Richard Hartmann","fromEmail":"richih.mailinglist@gmail.com","sentAt":"2013-06-10T18:36:03Z","receivedAt":"2013-06-10T18:36:03Z","isPatch":true,"sender":{"key":"richih.mailinglist@gmail.com","avatar":"https://avatars.githubusercontent.com/u/754723?v=4"},"body":"Signed-off-by: Richard Hartmann <richih.mailinglist@gmail.com>\n---\n Documentation/githooks.txt |    3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/githooks.txt b/Documentation/githooks.txt\nindex b9003fe..1276730 100644\n--- a/Documentation/githooks.txt\n+++ b/Documentation/githooks.txt\n@@ -80,7 +80,8 @@ causes the 'git commit' to abort.\n \n The default 'pre-commit' hook, when enabled, catches introduction\n of lines with trailing whitespaces and aborts the commit when\n-such a line is found.\n+such a line is found. It will also prevent addition of non-ASCII\n+file names.\n \n All the 'git commit' hooks are invoked with the environment\n variable `GIT_EDITOR=:` if the command will not bring up an editor\n-- \n1.7.10.4\n"},{"id":"220349","messageId":"1370889365-6239-6-git-send-email-richih.mailinglist@gmail.com","threadId":"34097","inReplyTo":"1370889365-6239-1-git-send-email-richih.mailinglist@gmail.com","subject":"[PATCH 5/6] templates: Fix ASCII art in pre-rebase hook","fromName":"Richard Hartmann","fromEmail":"richih.mailinglist@gmail.com","sentAt":"2013-06-10T18:36:04Z","receivedAt":"2013-06-10T18:36:04Z","isPatch":true,"sender":{"key":"richih.mailinglist@gmail.com","avatar":"https://avatars.githubusercontent.com/u/754723?v=4"},"body":"The example assumes 8-char wide tabs and breaks for people with\n4-char wide tabs.\n\nSigned-off-by: Richard Hartmann <richih.mailinglist@gmail.com>\n---\n templates/hooks--pre-rebase.sample |   16 ++++++++--------\n 1 file changed, 8 insertions(+), 8 deletions(-)\n\ndiff --git a/templates/hooks--pre-rebase.sample b/templates/hooks--pre-rebase.sample\nindex 053f111..b74cd1d 100755\n--- a/templates/hooks--pre-rebase.sample\n+++ b/templates/hooks--pre-rebase.sample\n@@ -132,14 +132,14 @@ With this workflow, you would want to know:\n \n Let's look at this example:\n \n-\t\t   o---o---o---o---o---o---o---o---o---o \"next\"\n-\t\t  /       /           /           /\n-\t\t /   a---a---b A     /           /\n-\t\t/   /               /           /\n-\t       /   /   c---c---c---c B         /\n-\t      /   /   /             \\         /\n-\t     /   /   /   b---b C     \\       /\n-\t    /   /   /   /             \\     /\n+                   o---o---o---o---o---o---o---o---o---o \"next\"\n+                  /       /           /           /\n+                 /   a---a---b A     /           /\n+                /   /               /           /\n+               /   /   c---c---c---c B         /\n+              /   /   /             \\         /\n+             /   /   /   b---b C     \\       /\n+            /   /   /   /             \\     /\n     ---o---o---o---o---o---o---o---o---o---o---o \"master\"\n \n \n-- \n1.7.10.4\n"},{"id":"220350","messageId":"1370889365-6239-7-git-send-email-richih.mailinglist@gmail.com","threadId":"34097","inReplyTo":"1370889365-6239-1-git-send-email-richih.mailinglist@gmail.com","subject":"[PATCH 6/6] template: Fix comment indentation in pre-rebase hook","fromName":"Richard Hartmann","fromEmail":"richih.mailinglist@gmail.com","sentAt":"2013-06-10T18:36:05Z","receivedAt":"2013-06-10T18:36:05Z","isPatch":true,"sender":{"key":"richih.mailinglist@gmail.com","avatar":"https://avatars.githubusercontent.com/u/754723?v=4"},"body":"The other hooks use two whitespace for indentation instead of tabs\nto signify code in the example/echo output.\nFollow the same layout in templates/hooks--pre-rebase.sample\n\nSigned-off-by: Richard Hartmann <richih.mailinglist@gmail.com>\n---\n templates/hooks--pre-rebase.sample |   10 +++++-----\n 1 file changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/templates/hooks--pre-rebase.sample b/templates/hooks--pre-rebase.sample\nindex b74cd1d..43426e0 100755\n--- a/templates/hooks--pre-rebase.sample\n+++ b/templates/hooks--pre-rebase.sample\n@@ -157,13 +157,13 @@ B to be deleted.\n \n To compute (1):\n \n-\tgit rev-list ^master ^topic next\n-\tgit rev-list ^master        next\n+  git rev-list ^master ^topic next\n+  git rev-list ^master        next\n \n-\tif these match, topic has not merged in next at all.\n+  if these match, topic has not merged in next at all.\n \n To compute (2):\n \n-\tgit rev-list master..topic\n+  git rev-list master..topic\n \n-\tif this is empty, it is fully merged to \"master\".\n+  if this is empty, it is fully merged to \"master\".\n-- \n1.7.10.4\n"},{"id":"220364","messageId":"7vy5ahg37y.fsf@alter.siamese.dyndns.org","threadId":"34097","inReplyTo":"1370889365-6239-2-git-send-email-richih.mailinglist@gmail.com","subject":"Re: [PATCH 1/6] templates: Fewer subprocesses in pre-commit hook","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-06-10T19:44:49Z","receivedAt":"2013-06-10T19:44:49Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Richard Hartmann <richih.mailinglist@gmail.com> writes:\n\n> Spawning a new subprocess for every line printed is inefficient.\n> Thus spawn only one instance of `echo`.\n>\n> Signed-off-by: Richard Hartmann <richih.mailinglist@gmail.com>\n> ---\n>  templates/hooks--pre-commit.sample |   24 ++++++++++++------------\n>  1 file changed, 12 insertions(+), 12 deletions(-)\n>\n> diff --git a/templates/hooks--pre-commit.sample b/templates/hooks--pre-commit.sample\n> index 18c4829..126ae13 100755\n> --- a/templates/hooks--pre-commit.sample\n> +++ b/templates/hooks--pre-commit.sample\n> @@ -31,18 +31,18 @@ if [ \"$allownonascii\" != \"true\" ] &&\n>  \ttest $(git diff --cached --name-only --diff-filter=A -z $against |\n>  \t  LC_ALL=C tr -d '[ -~]\\0' | wc -c) != 0\n>  then\n> -\techo \"Error: Attempt to add a non-ascii file name.\"\n> -\techo\n> -\techo \"This can cause problems if you want to work\"\n> -\techo \"with people on other platforms.\"\n> -\techo\n> -\techo \"To be portable it is advisable to rename the file ...\"\n> -\techo\n> -\techo \"If you know what you are doing you can disable this\"\n> -\techo \"check using:\"\n> -\techo\n> -\techo \"  git config hooks.allownonascii true\"\n> -\techo\n> +\techo 'Error: Attempt to add a non-ascii file name.\n> +\n> +This can cause problems if you want to work\n> +with people on other platforms.\n> +\n> +To be portable it is advisable to rename the file.\n> +\n> +If you know what you are doing you can disable this\n> +check using:\n> +\n> +  git config hooks.allownonascii true\n> +'\n>  \texit 1\n>  fi\n\nThanks.\nWriting it as a single here-text\n\n\tcat <<-EOF\n        Error: Attempt to...\n\n        the message body that is\n        multi-line\n        EOF\n\nmight make it easier for people who want to activate and customize\nthe message, but honestly this is a borderline \"Meh\" at least to me.\n\nWill take a look at other patches first before further commenting on\nthis.\n"},{"id":"220366","messageId":"7vtxl5g33k.fsf@alter.siamese.dyndns.org","threadId":"34097","inReplyTo":"1370889365-6239-3-git-send-email-richih.mailinglist@gmail.com","subject":"Re: [PATCH 2/6] templates: Reformat pre-commit hook's message","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-06-10T19:47:27Z","receivedAt":"2013-06-10T19:47:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Richard Hartmann <richih.mailinglist@gmail.com> writes:\n\n> Now that the there's only one echo being spawned, the message can span\n> the full 80 chars.\n>\n> Signed-off-by: Richard Hartmann <richih.mailinglist@gmail.com>\n> ---\n>  templates/hooks--pre-commit.sample |    6 ++----\n>  1 file changed, 2 insertions(+), 4 deletions(-)\n>\n> diff --git a/templates/hooks--pre-commit.sample b/templates/hooks--pre-commit.sample\n> index 126ae13..7676c6e 100755\n> --- a/templates/hooks--pre-commit.sample\n> +++ b/templates/hooks--pre-commit.sample\n> @@ -33,13 +33,11 @@ if [ \"$allownonascii\" != \"true\" ] &&\n>  then\n>  \techo 'Error: Attempt to add a non-ascii file name.\n>  \n> -This can cause problems if you want to work\n> -with people on other platforms.\n> +This can cause problems if you want to work with people on other platforms.\n>  \n>  To be portable it is advisable to rename the file.\n>  \n> -If you know what you are doing you can disable this\n> -check using:\n> +If you know what you are doing you can disable this check using:\n>  \n>    git config hooks.allownonascii true\n>  '\n\nOK.  Occupying 75-col feels like it is pushing a bit, but the result\ndoes look more readable.\n"},{"id":"220367","messageId":"7vppvtg2wo.fsf@alter.siamese.dyndns.org","threadId":"34097","inReplyTo":"1370889365-6239-6-git-send-email-richih.mailinglist@gmail.com","subject":"Re: [PATCH 5/6] templates: Fix ASCII art in pre-rebase hook","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-06-10T19:51:35Z","receivedAt":"2013-06-10T19:51:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Richard Hartmann <richih.mailinglist@gmail.com> writes:\n\n> The example assumes 8-char wide tabs and breaks for people with\n> 4-char wide tabs.\n\nEven though as far as this project is concerned, a tab stop is every\n8 columns, this is for consumption by end-users who use Git, not for\npeople who want to improve the code in Git (which this file is part\nof), so this \"untabify\" may make sense.\n\nThanks.\n\n> Signed-off-by: Richard Hartmann <richih.mailinglist@gmail.com>\n> ---\n>  templates/hooks--pre-rebase.sample |   16 ++++++++--------\n>  1 file changed, 8 insertions(+), 8 deletions(-)\n>\n> diff --git a/templates/hooks--pre-rebase.sample b/templates/hooks--pre-rebase.sample\n> index 053f111..b74cd1d 100755\n> --- a/templates/hooks--pre-rebase.sample\n> +++ b/templates/hooks--pre-rebase.sample\n> @@ -132,14 +132,14 @@ With this workflow, you would want to know:\n>  \n>  Let's look at this example:\n>  \n> -\t\t   o---o---o---o---o---o---o---o---o---o \"next\"\n> -\t\t  /       /           /           /\n> -\t\t /   a---a---b A     /           /\n> -\t\t/   /               /           /\n> -\t       /   /   c---c---c---c B         /\n> -\t      /   /   /             \\         /\n> -\t     /   /   /   b---b C     \\       /\n> -\t    /   /   /   /             \\     /\n> +                   o---o---o---o---o---o---o---o---o---o \"next\"\n> +                  /       /           /           /\n> +                 /   a---a---b A     /           /\n> +                /   /               /           /\n> +               /   /   c---c---c---c B         /\n> +              /   /   /             \\         /\n> +             /   /   /   b---b C     \\       /\n> +            /   /   /   /             \\     /\n>      ---o---o---o---o---o---o---o---o---o---o---o \"master\"\n"},{"id":"220368","messageId":"7vli6hg2ut.fsf@alter.siamese.dyndns.org","threadId":"34097","inReplyTo":"1370889365-6239-7-git-send-email-richih.mailinglist@gmail.com","subject":"Re: [PATCH 6/6] template: Fix comment indentation in pre-rebase hook","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-06-10T19:52:42Z","receivedAt":"2013-06-10T19:52:42Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Richard Hartmann <richih.mailinglist@gmail.com> writes:\n\n> The other hooks use two whitespace for indentation instead of tabs\n> to signify code in the example/echo output.\n> Follow the same layout in templates/hooks--pre-rebase.sample\n>\n> Signed-off-by: Richard Hartmann <richih.mailinglist@gmail.com>\n> ---\n>  templates/hooks--pre-rebase.sample |   10 +++++-----\n>  1 file changed, 5 insertions(+), 5 deletions(-)\n>\n> diff --git a/templates/hooks--pre-rebase.sample b/templates/hooks--pre-rebase.sample\n> index b74cd1d..43426e0 100755\n> --- a/templates/hooks--pre-rebase.sample\n> +++ b/templates/hooks--pre-rebase.sample\n> @@ -157,13 +157,13 @@ B to be deleted.\n>  \n>  To compute (1):\n>  \n> -\tgit rev-list ^master ^topic next\n> -\tgit rev-list ^master        next\n> +  git rev-list ^master ^topic next\n> +  git rev-list ^master        next\n>  \n> -\tif these match, topic has not merged in next at all.\n> +  if these match, topic has not merged in next at all.\n>  \n>  To compute (2):\n>  \n> -\tgit rev-list master..topic\n> +  git rev-list master..topic\n>  \n> -\tif this is empty, it is fully merged to \"master\".\n> +  if this is empty, it is fully merged to \"master\".\n\nI think offsetting the actual commands to the right is correct, but\n\"if these match\" and \"if this is empty\" should be flushed to left as\nthis patch shows.\n"},{"id":"220371","messageId":"CAD77+gTQQ4=gs85vnoZxvSWsPHu8-eK7DKpVvB9di_TjcPbeAA@mail.gmail.com","threadId":"34097","inReplyTo":"7vy5ahg37y.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 1/6] templates: Fewer subprocesses in pre-commit hook","fromName":"Richard Hartmann","fromEmail":"richih.mailinglist@gmail.com","sentAt":"2013-06-10T20:39:40Z","receivedAt":"2013-06-10T20:39:40Z","isPatch":true,"sender":{"key":"richih.mailinglist@gmail.com","avatar":"https://avatars.githubusercontent.com/u/754723?v=4"},"body":"Hi Junio,\n\nif you want a new patch, just say the word.\n\n\nRichard\n"},{"id":"220383","messageId":"20130610212502.GE13333@sigill.intra.peff.net","threadId":"34097","inReplyTo":"1370889365-6239-2-git-send-email-richih.mailinglist@gmail.com","subject":"Re: [PATCH 1/6] templates: Fewer subprocesses in pre-commit hook","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-06-10T21:25:02Z","receivedAt":"2013-06-10T21:25:02Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Jun 10, 2013 at 08:36:00PM +0200, Richard Hartmann wrote:\n\n> Spawning a new subprocess for every line printed is inefficient.\n> Thus spawn only one instance of `echo`.\n\nMost modern shells have \"echo\" as a built-in these days, and do not fork\nat all to run it. E.g., try \"strace sh -c 'echo foo'\" with your shell of\nchoice; neither dash nor bash will fork at all.\n\nIMHO the indentation issues make the end result of your patch less\nreadable (and here-doc with cat is more readable, but actually\n_increases_ the number of processes, since cat is not usually a\nbuilt-in). So I'd be in favor of keeping it as-is.\n\n-Peff\n"},{"id":"220384","messageId":"20130610212932.GF13333@sigill.intra.peff.net","threadId":"34097","inReplyTo":"1370889365-6239-6-git-send-email-richih.mailinglist@gmail.com","subject":"Re: [PATCH 5/6] templates: Fix ASCII art in pre-rebase hook","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-06-10T21:29:32Z","receivedAt":"2013-06-10T21:29:32Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Mon, Jun 10, 2013 at 08:36:04PM +0200, Richard Hartmann wrote:\n\n> The example assumes 8-char wide tabs and breaks for people with\n> 4-char wide tabs.\n\nIf you end up re-rolling, it might be worth saying \"Let's just convert\nall of the tabs to spaces\" in the commit message. I was curious what\nyour solution was (all spaces, or consistent start-tab indentation\nfollowed by spaces), and it was somewhat hard to see in the patch since\nthe changes were pure whitespace. :)\n\n-Peff\n"},{"id":"220390","messageId":"CAD77+gTv-x7ZKAR3PycDWNhqeWcnEFEhK290ndxeyqqkBfWfeQ@mail.gmail.com","threadId":"34097","inReplyTo":"7vli6hg2ut.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 6/6] template: Fix comment indentation in pre-rebase hook","fromName":"Richard Hartmann","fromEmail":"richih.mailinglist@gmail.com","sentAt":"2013-06-10T21:46:45Z","receivedAt":"2013-06-10T21:46:45Z","isPatch":true,"sender":{"key":"richih.mailinglist@gmail.com","avatar":"https://avatars.githubusercontent.com/u/754723?v=4"},"body":"On Mon, Jun 10, 2013 at 9:52 PM, Junio C Hamano <gitster@pobox.com> wrote:\n\n\n> I think offsetting the actual commands to the right is correct, but\n> \"if these match\" and \"if this is empty\" should be flushed to left as\n> this patch shows.\n\nI actually considered this and decided against it as it seemed to be\ndeliberate. Should I re-roll and re-send?\n\nI will gladly re-send the whole, or part of the, series once I know\nwhich patches are OK and which need more work.\n\n\nRichard\n"},{"id":"220397","messageId":"7vobbdefr7.fsf@alter.siamese.dyndns.org","threadId":"34097","inReplyTo":"CAD77+gTv-x7ZKAR3PycDWNhqeWcnEFEhK290ndxeyqqkBfWfeQ@mail.gmail.com","subject":"Re: [PATCH 6/6] template: Fix comment indentation in pre-rebase hook","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-06-10T22:57:00Z","receivedAt":"2013-06-10T22:57:00Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Richard Hartmann <richih.mailinglist@gmail.com> writes:\n\n> On Mon, Jun 10, 2013 at 9:52 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>\n>\n>> I think offsetting the actual commands to the right is correct, but\n>> \"if these match\" and \"if this is empty\" should be flushed to left as\n>> this patch shows.\n>\n> I actually considered this and decided against it as it seemed to be\n> deliberate. Should I re-roll and re-send?\n>\n> I will gladly re-send the whole, or part of the, series once I know\n> which patches are OK and which need more work.\n\n[PATCH 1/6] templates: Fewer subprocesses in pre-commit hook\n\n  I agree with Peff that \"less fork\" is a bad justification for this\n  change, and also\n\n                echo 'First line\n        second line\n        third lie'\n\n  looks somewhat bad.\n\n[PATCH 2/6] templates: Reformat pre-commit hook's message\n\n  I think it is a good thing to make the output short by widening.\n\n[PATCH 3/6] templates: Fix spelling in pre-commit hook\n\n  Good.\n\n[PATCH 4/6] Documentation: Update manpage for pre-commit hook\n\n  I debated myself if it should say \"The hook _by default_ prevents\n  addition of non-ASCII filenames\", hinting that it can be\n  configured out if it is unwanted.\n\n  Other than that, I think it is a good addition.\n\n[PATCH 5/6] templates: Fix ASCII art in pre-rebase hook\n\n  Good, but see Peff's comments on the explanation.\n\n[PATCH 6/6] template: Fix comment indentation in pre-rebase hook\n\n  After reading the original once again, it is fine as-is without\n  the change at all, I think.  Alternatively, \"if these match\" and\n  \"if this is empty\" lines can be flushed to the left, which also is\n  readable.\n\nThanks.\n"},{"id":"220398","messageId":"CAD77+gSX1ggBWHhGwxRUBPGQ6ONJd76SO-3tU05QT47iKCv9hg@mail.gmail.com","threadId":"34097","inReplyTo":"7vobbdefr7.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 6/6] template: Fix comment indentation in pre-rebase hook","fromName":"Richard Hartmann","fromEmail":"richih.mailinglist@gmail.com","sentAt":"2013-06-10T23:03:18Z","receivedAt":"2013-06-10T23:03:18Z","isPatch":true,"sender":{"key":"richih.mailinglist@gmail.com","avatar":"https://avatars.githubusercontent.com/u/754723?v=4"},"body":"On Tue, Jun 11, 2013 at 12:57 AM, Junio C Hamano <gitster@pobox.com> wrote:\n\n> [PATCH 1/6] templates: Fewer subprocesses in pre-commit hook\n>\n>   I agree with Peff that \"less fork\" is a bad justification for this\n>   change, and also\n>\n>                 echo 'First line\n>         second line\n>         third lie'\n>\n>   looks somewhat bad.\n\nThe repeated echo also looks bad, imo. Also, 2/6 depends on this to\nsave lines. Should I rewrite with EOF, keep as is, or drop?\n\n\n> [PATCH 2/6] templates: Reformat pre-commit hook's message\n>\n>   I think it is a good thing to make the output short by widening.\n\nAs I said, 2/6 depends on 1/6 to some extent.\n\n\n> [PATCH 4/6] Documentation: Update manpage for pre-commit hook\n>\n>   I debated myself if it should say \"The hook _by default_ prevents\n>   addition of non-ASCII filenames\", hinting that it can be\n>   configured out if it is unwanted.\n>\n>   Other than that, I think it is a good addition.\n\nWill update once I know the complete TODO.\n\n\n> [PATCH 5/6] templates: Fix ASCII art in pre-rebase hook\n>\n>   Good, but see Peff's comments on the explanation.\n\nOK.\n\n\n> [PATCH 6/6] template: Fix comment indentation in pre-rebase hook\n>\n>   After reading the original once again, it is fine as-is without\n>   the change at all, I think.  Alternatively, \"if these match\" and\n>   \"if this is empty\" lines can be flushed to the left, which also is\n>   readable.\n\nI think I will flush and capitalize, then.\n\n\nRichard\n"},{"id":"223330","messageId":"1373818879-1698-1-git-send-email-richih.mailinglist@gmail.com","threadId":"34097","inReplyTo":"CAD77+gSX1ggBWHhGwxRUBPGQ6ONJd76SO-3tU05QT47iKCv9hg@mail.gmail.com","subject":"[PATCH 0/6] Update to janitorial work on hook templates","fromName":"Richard Hartmann","fromEmail":"richih.mailinglist@gmail.com","sentAt":"2013-07-14T16:21:13Z","receivedAt":"2013-07-14T16:21:13Z","isPatch":true,"sender":{"key":"richih.mailinglist@gmail.com","avatar":"https://avatars.githubusercontent.com/u/754723?v=4"},"body":"Dear all,\n\nI worked Jeff's and Junio's feedback into this patch series, referencing\nthe old commits.\n\nAs stated earlier, you are welcome to drop 1/6, but 2/6 depends on it.\nYour choice, both is fine by me.\n\nThanks,\nRichard\n\nRichard Hartmann (6):\n  templates: Use heredoc in pre-commit hook\n  templates: Reformat pre-commit hook's message\n  templates: Fix spelling in pre-commit hook\n  Documentation: Update manpage for pre-commit hook\n  templates: Fix ASCII art in pre-rebase hook\n  template: Fix comment indentation in pre-rebase hook\n\n Documentation/githooks.txt         |    3 ++-\n templates/hooks--pre-commit.sample |   27 +++++++++++++--------------\n templates/hooks--pre-rebase.sample |   26 +++++++++++++-------------\n 3 files changed, 28 insertions(+), 28 deletions(-)\n\n-- \n1.7.10.4\n"},{"id":"223331","messageId":"1373818879-1698-2-git-send-email-richih.mailinglist@gmail.com","threadId":"34097","inReplyTo":"1373818879-1698-1-git-send-email-richih.mailinglist@gmail.com","subject":"[PATCH 1/6] templates: Use heredoc in pre-commit hook","fromName":"Richard Hartmann","fromEmail":"richih.mailinglist@gmail.com","sentAt":"2013-07-14T16:21:14Z","receivedAt":"2013-07-14T16:21:14Z","isPatch":true,"sender":{"key":"richih.mailinglist@gmail.com","avatar":"https://avatars.githubusercontent.com/u/754723?v=4"},"body":"Spawning a new subprocess for every line printed is inefficient.\nUse heredoc, instead.\n\nBased on 98770971aef8d1cbc78876d9023d10aa25df0526 in original patch\nseries from 2013-06-10.\n\nSigned-off-by: Richard Hartmann <richih.mailinglist@gmail.com>\n---\n templates/hooks--pre-commit.sample |   25 +++++++++++++------------\n 1 file changed, 13 insertions(+), 12 deletions(-)\n\ndiff --git a/templates/hooks--pre-commit.sample b/templates/hooks--pre-commit.sample\nindex 18c4829..889967c 100755\n--- a/templates/hooks--pre-commit.sample\n+++ b/templates/hooks--pre-commit.sample\n@@ -31,18 +31,19 @@ if [ \"$allownonascii\" != \"true\" ] &&\n \ttest $(git diff --cached --name-only --diff-filter=A -z $against |\n \t  LC_ALL=C tr -d '[ -~]\\0' | wc -c) != 0\n then\n-\techo \"Error: Attempt to add a non-ascii file name.\"\n-\techo\n-\techo \"This can cause problems if you want to work\"\n-\techo \"with people on other platforms.\"\n-\techo\n-\techo \"To be portable it is advisable to rename the file ...\"\n-\techo\n-\techo \"If you know what you are doing you can disable this\"\n-\techo \"check using:\"\n-\techo\n-\techo \"  git config hooks.allownonascii true\"\n-\techo\n+\tcat <<-EOF\n+Error: Attempt to add a non-ascii file name.\n+\n+This can cause problems if you want to work\n+with people on other platforms.\n+\n+To be portable it is advisable to rename the file.\n+\n+If you know what you are doing you can disable this\n+check using:\n+\n+  git config hooks.allownonascii true\n+EOF\n \texit 1\n fi\n \n-- \n1.7.10.4\n"},{"id":"223335","messageId":"1373818879-1698-3-git-send-email-richih.mailinglist@gmail.com","threadId":"34097","inReplyTo":"1373818879-1698-1-git-send-email-richih.mailinglist@gmail.com","subject":"[PATCH 2/6] templates: Reformat pre-commit hook's message","fromName":"Richard Hartmann","fromEmail":"richih.mailinglist@gmail.com","sentAt":"2013-07-14T16:21:15Z","receivedAt":"2013-07-14T16:21:15Z","isPatch":true,"sender":{"key":"richih.mailinglist@gmail.com","avatar":"https://avatars.githubusercontent.com/u/754723?v=4"},"body":"Now that we're using heredoc, the message can span the full 80 chars.\n\nVerbatim copy of 634709b489bb3db79f59127fd6bf79c5fd9b5ddf in original\npatch series from 2013-06-10.\n\nSigned-off-by: Richard Hartmann <richih.mailinglist@gmail.com>\n---\n templates/hooks--pre-commit.sample |    6 ++----\n 1 file changed, 2 insertions(+), 4 deletions(-)\n\ndiff --git a/templates/hooks--pre-commit.sample b/templates/hooks--pre-commit.sample\nindex 889967c..e09cf89 100755\n--- a/templates/hooks--pre-commit.sample\n+++ b/templates/hooks--pre-commit.sample\n@@ -34,13 +34,11 @@ then\n \tcat <<-EOF\n Error: Attempt to add a non-ascii file name.\n \n-This can cause problems if you want to work\n-with people on other platforms.\n+This can cause problems if you want to work with people on other platforms.\n \n To be portable it is advisable to rename the file.\n \n-If you know what you are doing you can disable this\n-check using:\n+If you know what you are doing you can disable this check using:\n \n   git config hooks.allownonascii true\n EOF\n-- \n1.7.10.4\n"},{"id":"223334","messageId":"1373818879-1698-4-git-send-email-richih.mailinglist@gmail.com","threadId":"34097","inReplyTo":"1373818879-1698-1-git-send-email-richih.mailinglist@gmail.com","subject":"[PATCH 3/6] templates: Fix spelling in pre-commit hook","fromName":"Richard Hartmann","fromEmail":"richih.mailinglist@gmail.com","sentAt":"2013-07-14T16:21:16Z","receivedAt":"2013-07-14T16:21:16Z","isPatch":true,"sender":{"key":"richih.mailinglist@gmail.com","avatar":"https://avatars.githubusercontent.com/u/754723?v=4"},"body":"Based on 0b9b01276553de8097442c3c996b7a49367dd234 in original patch\nseries.\n\nSigned-off-by: Richard Hartmann <richih.mailinglist@gmail.com>\n---\n templates/hooks--pre-commit.sample |    6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/templates/hooks--pre-commit.sample b/templates/hooks--pre-commit.sample\nindex e09cf89..78baef6 100755\n--- a/templates/hooks--pre-commit.sample\n+++ b/templates/hooks--pre-commit.sample\n@@ -15,13 +15,13 @@ else\n \tagainst=4b825dc642cb6eb9a060e54bf8d69288fbee4904\n fi\n \n-# If you want to allow non-ascii filenames set this variable to true.\n+# If you want to allow non-ASCII filenames set this variable to true.\n allownonascii=$(git config hooks.allownonascii)\n \n # Redirect output to stderr.\n exec 1>&2\n \n-# Cross platform projects tend to avoid non-ascii filenames; prevent\n+# Cross platform projects tend to avoid non-ASCII filenames; prevent\n # them from being added to the repository. We exploit the fact that the\n # printable range starts at the space character and ends with tilde.\n if [ \"$allownonascii\" != \"true\" ] &&\n@@ -32,7 +32,7 @@ if [ \"$allownonascii\" != \"true\" ] &&\n \t  LC_ALL=C tr -d '[ -~]\\0' | wc -c) != 0\n then\n \tcat <<-EOF\n-Error: Attempt to add a non-ascii file name.\n+Error: Attempt to add a non-ASCII file name.\n \n This can cause problems if you want to work with people on other platforms.\n \n-- \n1.7.10.4\n"},{"id":"223336","messageId":"1373818879-1698-5-git-send-email-richih.mailinglist@gmail.com","threadId":"34097","inReplyTo":"1373818879-1698-1-git-send-email-richih.mailinglist@gmail.com","subject":"[PATCH 4/6] Documentation: Update manpage for pre-commit hook","fromName":"Richard Hartmann","fromEmail":"richih.mailinglist@gmail.com","sentAt":"2013-07-14T16:21:17Z","receivedAt":"2013-07-14T16:21:17Z","isPatch":true,"sender":{"key":"richih.mailinglist@gmail.com","avatar":"https://avatars.githubusercontent.com/u/754723?v=4"},"body":"Verbatim copy of 4b8234b2693af634a77ea059331d1658e070f6d7 in original\npatch series from 2013-06-10.\n\nSigned-off-by: Richard Hartmann <richih.mailinglist@gmail.com>\n---\n Documentation/githooks.txt |    3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/githooks.txt b/Documentation/githooks.txt\nindex b9003fe..1276730 100644\n--- a/Documentation/githooks.txt\n+++ b/Documentation/githooks.txt\n@@ -80,7 +80,8 @@ causes the 'git commit' to abort.\n \n The default 'pre-commit' hook, when enabled, catches introduction\n of lines with trailing whitespaces and aborts the commit when\n-such a line is found.\n+such a line is found. It will also prevent addition of non-ASCII\n+file names.\n \n All the 'git commit' hooks are invoked with the environment\n variable `GIT_EDITOR=:` if the command will not bring up an editor\n-- \n1.7.10.4\n"},{"id":"223332","messageId":"1373818879-1698-6-git-send-email-richih.mailinglist@gmail.com","threadId":"34097","inReplyTo":"1373818879-1698-1-git-send-email-richih.mailinglist@gmail.com","subject":"[PATCH 5/6] templates: Fix ASCII art in pre-rebase hook","fromName":"Richard Hartmann","fromEmail":"richih.mailinglist@gmail.com","sentAt":"2013-07-14T16:21:18Z","receivedAt":"2013-07-14T16:21:18Z","isPatch":true,"sender":{"key":"richih.mailinglist@gmail.com","avatar":"https://avatars.githubusercontent.com/u/754723?v=4"},"body":"The example assumes 8-char wide tabs and breaks for people with\n4-char wide tabs. Convert all of those tabs to whitespace, instead.\n\nVerbatim copy of 11edd8a05778700382e6a21cfc0a6b5b72eff852 in original\npatch series from 2013-06-10.\n\nSigned-off-by: Richard Hartmann <richih.mailinglist@gmail.com>\n---\n templates/hooks--pre-rebase.sample |   16 ++++++++--------\n 1 file changed, 8 insertions(+), 8 deletions(-)\n\ndiff --git a/templates/hooks--pre-rebase.sample b/templates/hooks--pre-rebase.sample\nindex 053f111..b74cd1d 100755\n--- a/templates/hooks--pre-rebase.sample\n+++ b/templates/hooks--pre-rebase.sample\n@@ -132,14 +132,14 @@ With this workflow, you would want to know:\n \n Let's look at this example:\n \n-\t\t   o---o---o---o---o---o---o---o---o---o \"next\"\n-\t\t  /       /           /           /\n-\t\t /   a---a---b A     /           /\n-\t\t/   /               /           /\n-\t       /   /   c---c---c---c B         /\n-\t      /   /   /             \\         /\n-\t     /   /   /   b---b C     \\       /\n-\t    /   /   /   /             \\     /\n+                   o---o---o---o---o---o---o---o---o---o \"next\"\n+                  /       /           /           /\n+                 /   a---a---b A     /           /\n+                /   /               /           /\n+               /   /   c---c---c---c B         /\n+              /   /   /             \\         /\n+             /   /   /   b---b C     \\       /\n+            /   /   /   /             \\     /\n     ---o---o---o---o---o---o---o---o---o---o---o \"master\"\n \n \n-- \n1.7.10.4\n"},{"id":"223333","messageId":"1373818879-1698-7-git-send-email-richih.mailinglist@gmail.com","threadId":"34097","inReplyTo":"1373818879-1698-1-git-send-email-richih.mailinglist@gmail.com","subject":"[PATCH 6/6] template: Fix comment indentation in pre-rebase hook","fromName":"Richard Hartmann","fromEmail":"richih.mailinglist@gmail.com","sentAt":"2013-07-14T16:21:19Z","receivedAt":"2013-07-14T16:21:19Z","isPatch":true,"sender":{"key":"richih.mailinglist@gmail.com","avatar":"https://avatars.githubusercontent.com/u/754723?v=4"},"body":"The other hooks use two whitespace for indentation instead of tabs\nto signify code in the example/echo output.\nFollow the same layout in templates/hooks--pre-rebase.sample\n\nBased on d153a68bebfabc1db5241d02ee75fa5cb4538ab0 in original patch\nseries from 2013-06-10.\n\nSigned-off-by: Richard Hartmann <richih.mailinglist@gmail.com>\n---\n templates/hooks--pre-rebase.sample |   10 +++++-----\n 1 file changed, 5 insertions(+), 5 deletions(-)\n\ndiff --git a/templates/hooks--pre-rebase.sample b/templates/hooks--pre-rebase.sample\nindex b74cd1d..cec3474 100755\n--- a/templates/hooks--pre-rebase.sample\n+++ b/templates/hooks--pre-rebase.sample\n@@ -157,13 +157,13 @@ B to be deleted.\n \n To compute (1):\n \n-\tgit rev-list ^master ^topic next\n-\tgit rev-list ^master        next\n+  git rev-list ^master ^topic next\n+  git rev-list ^master        next\n \n-\tif these match, topic has not merged in next at all.\n+if these match, topic has not merged in next at all.\n \n To compute (2):\n \n-\tgit rev-list master..topic\n+  git rev-list master..topic\n \n-\tif this is empty, it is fully merged to \"master\".\n+if this is empty, it is fully merged to \"master\".\n-- \n1.7.10.4\n"},{"id":"223338","messageId":"20130714180916.GB1267@google.com","threadId":"34097","inReplyTo":"1373818879-1698-2-git-send-email-richih.mailinglist@gmail.com","subject":"Re: [PATCH 1/6] templates: Use heredoc in pre-commit hook","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2013-07-14T18:09:16Z","receivedAt":"2013-07-14T18:09:16Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\nRichard Hartmann wrote:\n\n> Spawning a new subprocess for every line printed is inefficient.\n> Use heredoc, instead.\n\nI think this makes sense as a code clarity, simplicity, and\ninternationalizability improvement, but don't like the precedent of\neliminating 'echo' for the sake of fork removal (unless we have\nmeasurements showing it's worthwhile, which would be included here).\n\nMaybe a simpler commit message could sidestep the issue?\n\n\tUse a heredoc instead of an \"echo\" for each line.\n\n> Based on 98770971aef8d1cbc78876d9023d10aa25df0526 in original patch\n> series from 2013-06-10.\n\nPlease don't include this.  The audience for the commit message\ndoesn't have that commit to compare to.\n\nIf you want to preserve the original date, the way to do that is\na \"Date:\" field at the top of the message body.\n\n\tDate: Fri, 28 Jun 2013 21:16:19 +0530\n\n\tSpawning a new subprocess for ...\n\n[...]\n> --- a/templates/hooks--pre-commit.sample\n> +++ b/templates/hooks--pre-commit.sample\n> @@ -31,18 +31,19 @@ if [ \"$allownonascii\" != \"true\" ] &&\n>  \ttest $(git diff --cached --name-only --diff-filter=A -z $against |\n>  \t  LC_ALL=C tr -d '[ -~]\\0' | wc -c) != 0\n>  then\n> -\techo \"Error: Attempt to add a non-ascii file name.\"\n> -\techo\n> -\techo \"This can cause problems if you want to work\"\n> -\techo \"with people on other platforms.\"\n> -\techo\n> -\techo\n> -\techo \"If you know what you are doing you can disable this\"\n> -\techo \"check using:\"\n> -\techo\n> -\techo \"  git config hooks.allownonascii true\"\n> -\techo\n> +\tcat <<-EOF\n> +Error: Attempt to add a non-ascii file name.\n\nUsing\n\n\tcat <<\\EOF\n\nwould make reading easier since the reader then doesn't have to worry\nabout whether the text being cat'ed is indented or uses variable\nsubstitutions.\n\n> -\techo \"To be portable it is advisable to rename the file ...\"\n> +To be portable it is advisable to rename the file.\n\nYes, nice.\n\nWith the above nits addressed, this change looks to be going in the\nright direction.  Thanks.\n\nHope that helps,\nJonathan\n"},{"id":"223339","messageId":"20130714184250.GA4381@google.com","threadId":"34097","inReplyTo":"1373818879-1698-3-git-send-email-richih.mailinglist@gmail.com","subject":"Re: [PATCH 2/6] templates: Reformat pre-commit hook's message","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2013-07-14T18:42:50Z","receivedAt":"2013-07-14T18:42:50Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Richard Hartmann wrote:\n\n> Now that we're using heredoc, the message can span the full 80 chars.\n\nThe output is going to a console and not an email, so makes sense. :)\n\n> Verbatim copy of 634709b489bb3db79f59127fd6bf79c5fd9b5ddf in original\n> patch series from 2013-06-10.\n\nAs in patch 1, please drop this.  I'll stop mentioning that for the\nlater patches, but the same comment applies there.\n\nThanks,\nJonathan\n"},{"id":"223340","messageId":"20130714185104.GB4381@google.com","threadId":"34097","inReplyTo":"1373818879-1698-5-git-send-email-richih.mailinglist@gmail.com","subject":"Re: [PATCH 4/6] Documentation: Update manpage for pre-commit hook","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2013-07-14T18:51:04Z","receivedAt":"2013-07-14T18:51:04Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Richard Hartmann wrote:\n\n> --- a/Documentation/githooks.txt\n> +++ b/Documentation/githooks.txt\n> @@ -80,7 +80,8 @@ causes the 'git commit' to abort.\n>  \n>  The default 'pre-commit' hook, when enabled, catches introduction\n>  of lines with trailing whitespaces and aborts the commit when\n> -such a line is found.\n> +such a line is found. It will also prevent addition of non-ASCII\n> +file names.\n\nThe tenses are inconsistent here (\"catches\" versus \"will also\").\n\nIt also seems odd to call the sample hooks \"default\" hooks, but that's\na wider problem and should probably be fixed by one commit all at once\n(maybe imitating the wording of the prepare-commit-message\ndescription).  Previously enabling them was a matter of a \"chmod +x\"\nand the wording made more sense.\n\nHow about:\n\n\tThe default 'pre-commit' hook, when enabled, prevents introduction\n\tof lines with trailing whitespace and prevents introduction of\n\tfiles with non-ASCII filenames unless the hooks.allowNonAscii\n\tconfiguration variable is true.\n"},{"id":"223341","messageId":"20130714185231.GC4381@google.com","threadId":"34097","inReplyTo":"1373818879-1698-6-git-send-email-richih.mailinglist@gmail.com","subject":"Re: [PATCH 5/6] templates: Fix ASCII art in pre-rebase hook","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2013-07-14T18:52:31Z","receivedAt":"2013-07-14T18:52:31Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Richard Hartmann wrote:\n\n> The example assumes 8-char wide tabs and breaks for people with\n> 4-char wide tabs. Convert all of those tabs to whitespace, instead.\n\nMakes sense --- we cannot assume much about the end-user's editor\nsetup used to look at sample hooks.\n\nThanks.\n"},{"id":"223343","messageId":"20130714185358.GD4381@google.com","threadId":"34097","inReplyTo":"1373818879-1698-7-git-send-email-richih.mailinglist@gmail.com","subject":"Re: [PATCH 6/6] template: Fix comment indentation in pre-rebase hook","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2013-07-14T18:53:58Z","receivedAt":"2013-07-14T18:53:58Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Richard Hartmann wrote:\n\n> The other hooks use two whitespace for indentation instead of tabs\n> to signify code in the example/echo output.\n> Follow the same layout in templates/hooks--pre-rebase.sample\n\nI don't understand the point of this one.  Is it just consistency for\nthe sake of consistency?  Aren't other parts of git inconsistent in\nthis area?\n"},{"id":"223345","messageId":"7v1u71gd7r.fsf@alter.siamese.dyndns.org","threadId":"34097","inReplyTo":"1373818879-1698-2-git-send-email-richih.mailinglist@gmail.com","subject":"Re: [PATCH 1/6] templates: Use heredoc in pre-commit hook","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-07-14T19:20:56Z","receivedAt":"2013-07-14T19:20:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Richard Hartmann <richih.mailinglist@gmail.com> writes:\n\n> Spawning a new subprocess for every line printed is inefficient.\n\nThis is not a valid justification at all, is it?  \n\nShells on modern distros and platforms have \"echo\" built-in, so this\npatch replaces series of writes internal to the shell with a fork to\ncat with heredoc (which often is implemented with a temporary file).\n\n\n\n\n> Use heredoc, instead.\n>\n> Based on 98770971aef8d1cbc78876d9023d10aa25df0526 in original patch\n> series from 2013-06-10.\n>\n> Signed-off-by: Richard Hartmann <richih.mailinglist@gmail.com>\n> ---\n>  templates/hooks--pre-commit.sample |   25 +++++++++++++------------\n>  1 file changed, 13 insertions(+), 12 deletions(-)\n>\n> diff --git a/templates/hooks--pre-commit.sample b/templates/hooks--pre-commit.sample\n> index 18c4829..889967c 100755\n> --- a/templates/hooks--pre-commit.sample\n> +++ b/templates/hooks--pre-commit.sample\n> @@ -31,18 +31,19 @@ if [ \"$allownonascii\" != \"true\" ] &&\n>  \ttest $(git diff --cached --name-only --diff-filter=A -z $against |\n>  \t  LC_ALL=C tr -d '[ -~]\\0' | wc -c) != 0\n>  then\n> -\techo \"Error: Attempt to add a non-ascii file name.\"\n> -\techo\n> -\techo \"This can cause problems if you want to work\"\n> -\techo \"with people on other platforms.\"\n> -\techo\n> -\techo \"To be portable it is advisable to rename the file ...\"\n> -\techo\n> -\techo \"If you know what you are doing you can disable this\"\n> -\techo \"check using:\"\n> -\techo\n> -\techo \"  git config hooks.allownonascii true\"\n> -\techo\n> +\tcat <<-EOF\n> +Error: Attempt to add a non-ascii file name.\n> +\n> +This can cause problems if you want to work\n> +with people on other platforms.\n> +\n> +To be portable it is advisable to rename the file.\n> +\n> +If you know what you are doing you can disable this\n> +check using:\n> +\n> +  git config hooks.allownonascii true\n> +EOF\n>  \texit 1\n>  fi\n"},{"id":"223346","messageId":"CAD77+gSE5GnTcrpoWO0bb2UysDE9t51EWJo3shdeffnaLxASfw@mail.gmail.com","threadId":"34097","inReplyTo":"7v1u71gd7r.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH 1/6] templates: Use heredoc in pre-commit hook","fromName":"Richard Hartmann","fromEmail":"richih.mailinglist@gmail.com","sentAt":"2013-07-14T20:12:09Z","receivedAt":"2013-07-14T20:12:09Z","isPatch":true,"sender":{"key":"richih.mailinglist@gmail.com","avatar":"https://avatars.githubusercontent.com/u/754723?v=4"},"body":"On Sun, Jul 14, 2013 at 9:20 PM, Junio C Hamano <gitster@pobox.com> wrote:\n\n> Shells on modern distros and platforms have \"echo\" built-in, so this\n> patch replaces series of writes internal to the shell with a fork to\n> cat with heredoc (which often is implemented with a temporary file).\n\nTrue; fwiw, I replaced my one single echo with heredoc as you\nsuggested I do that. I don't mind undoing that, or I can drop it from\nthis series altogether.\n\nGuidance would be appreciated. :)\n\n\nRichard\n"},{"id":"223347","messageId":"20130714202051.GC8564@google.com","threadId":"34097","inReplyTo":"CAD77+gSE5GnTcrpoWO0bb2UysDE9t51EWJo3shdeffnaLxASfw@mail.gmail.com","subject":"Re: [PATCH 1/6] templates: Use heredoc in pre-commit hook","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2013-07-14T20:20:51Z","receivedAt":"2013-07-14T20:20:51Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Richard Hartmann wrote:\n\n>       fwiw, I replaced my one single echo with heredoc as you\n> suggested I do that. I don't mind undoing that, or I can drop it from\n> this series altogether.\n>\n> Guidance would be appreciated. :)\n\nThanks for your work, and no problem.\n\nBoth Junio's and my responses were about the (confusing and false)\ncommit message.  Code is not the only thing that matters when\nsubmitting a patch --- commit messages become part of the product,\ntoo, and are especially important as documentation that guides future\ncontributors.\n\nSo my advice is to fix the commit message, prepare improvements to\nlater patches in the series with help from reviewers where needed,\nand then resubmit.\n\nMy review also included some advice about the code.  Naturally I\nwould be happy if that was of use, too. ;-)\n\nHope that helps,\nJonathan\n"},{"id":"223366","messageId":"7vwqosfqws.fsf@alter.siamese.dyndns.org","threadId":"34097","inReplyTo":"20130714180916.GB1267@google.com","subject":"Re: [PATCH 1/6] templates: Use heredoc in pre-commit hook","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-07-15T03:22:43Z","receivedAt":"2013-07-15T03:22:43Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jonathan Nieder <jrnieder@gmail.com> writes:\n\n>> Based on 98770971aef8d1cbc78876d9023d10aa25df0526 in original patch\n>> series from 2013-06-10.\n>\n> Please don't include this.  The audience for the commit message\n> doesn't have that commit to compare to.\n>\n> If you want to preserve the original date, the way to do that is\n> a \"Date:\" field at the top of the message body.\n>\n> \tDate: Fri, 28 Jun 2013 21:16:19 +0530\n\nAnd you generally should not do that, either.\n\nThe first date of the publication of _this_ version is recorded on\nthe Date: header of this message, not the \"original path series\"\nthat this round which is _based on_ (meaning, \"different from\") that\nold one.  We do not want to see the date of the old one, either.\n\n>\n> \tSpawning a new subprocess for ...\n>\n> [...]\n>> --- a/templates/hooks--pre-commit.sample\n>> +++ b/templates/hooks--pre-commit.sample\n>> @@ -31,18 +31,19 @@ if [ \"$allownonascii\" != \"true\" ] &&\n>>  \ttest $(git diff --cached --name-only --diff-filter=A -z $against |\n>>  \t  LC_ALL=C tr -d '[ -~]\\0' | wc -c) != 0\n>>  then\n>> -\techo \"Error: Attempt to add a non-ascii file name.\"\n>> -\techo\n>> -\techo \"This can cause problems if you want to work\"\n>> -\techo \"with people on other platforms.\"\n>> -\techo\n>> -\techo\n>> -\techo \"If you know what you are doing you can disable this\"\n>> -\techo \"check using:\"\n>> -\techo\n>> -\techo \"  git config hooks.allownonascii true\"\n>> -\techo\n>> +\tcat <<-EOF\n>> +Error: Attempt to add a non-ascii file name.\n>\n> Using\n>\n> \tcat <<\\EOF\n>\n> would make reading easier since the reader then doesn't have to worry\n> about whether the text being cat'ed is indented or uses variable\n> substitutions.\n>\n>> -\techo \"To be portable it is advisable to rename the file ...\"\n>> +To be portable it is advisable to rename the file.\n>\n> Yes, nice.\n>\n> With the above nits addressed, this change looks to be going in the\n> right direction.  Thanks.\n>\n> Hope that helps,\n> Jonathan\n"},{"id":"223448","messageId":"7vli57bwey.fsf@alter.siamese.dyndns.org","threadId":"34097","inReplyTo":"CAD77+gSE5GnTcrpoWO0bb2UysDE9t51EWJo3shdeffnaLxASfw@mail.gmail.com","subject":"Re: [PATCH 1/6] templates: Use heredoc in pre-commit hook","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-07-15T16:49:41Z","receivedAt":"2013-07-15T16:49:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Richard Hartmann <richih.mailinglist@gmail.com> writes:\n\n> On Sun, Jul 14, 2013 at 9:20 PM, Junio C Hamano <gitster@pobox.com> wrote:\n>\n>> Shells on modern distros and platforms have \"echo\" built-in, so this\n>> patch replaces series of writes internal to the shell with a fork to\n>> cat with heredoc (which often is implemented with a temporary file).\n>\n> True; fwiw, I replaced my one single echo with heredoc as you\n> suggested I do that. I don't mind undoing that, or I can drop it from\n> this series altogether.\n\nThe _real_ reason you wanted to do this change in the context of\nthis series is to make it easier to reword the messages and also\nhave the messages span the full width of the source line, to match\nthe expected output better, isn't it?  Git is not _only_ about\nperformance, so even if using \"cat <<here\" might make things slower\n(I do not think it is measurable), that reason \"this way, it is\neasier to see how the output given to the users would look like\" may\nwell justify this change.\n\nI just wanted to see the proposed log message state the real reason,\nnot a performance justification that can be invalidated.\n\nThanks.\n"},{"id":"223449","messageId":"7vhafvbw7k.fsf@alter.siamese.dyndns.org","threadId":"34097","inReplyTo":"1373818879-1698-5-git-send-email-richih.mailinglist@gmail.com","subject":"Re: [PATCH 4/6] Documentation: Update manpage for pre-commit hook","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-07-15T16:54:07Z","receivedAt":"2013-07-15T16:54:07Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Richard Hartmann <richih.mailinglist@gmail.com> writes:\n\n> Verbatim copy of 4b8234b2693af634a77ea059331d1658e070f6d7 in original\n> patch series from 2013-06-10.\n\nAs Jonathan said, this is not a commit log message.\n\nI've applied up to 3/6 with fixups, but will stop here for now.\n\n>\n> Signed-off-by: Richard Hartmann <richih.mailinglist@gmail.com>\n> ---\n>  Documentation/githooks.txt |    3 ++-\n>  1 file changed, 2 insertions(+), 1 deletion(-)\n>\n> diff --git a/Documentation/githooks.txt b/Documentation/githooks.txt\n> index b9003fe..1276730 100644\n> --- a/Documentation/githooks.txt\n> +++ b/Documentation/githooks.txt\n> @@ -80,7 +80,8 @@ causes the 'git commit' to abort.\n>  \n>  The default 'pre-commit' hook, when enabled, catches introduction\n>  of lines with trailing whitespaces and aborts the commit when\n> -such a line is found.\n> +such a line is found. It will also prevent addition of non-ASCII\n> +file names.\n>  \n>  All the 'git commit' hooks are invoked with the environment\n>  variable `GIT_EDITOR=:` if the command will not bring up an editor\n"}]}