{"thread":{"id":"27542","subject":"pre-commit hook to reject whitespace","startedAt":"2011-06-03T23:31:26Z","lastAt":"2011-06-04T00:23:44Z","messageCount":4,"participants":["Neal Kreitzinger","John Szakmeister"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"169284","messageId":"isbqsf$vh8$1@dough.gmane.org","threadId":"27542","inReplyTo":null,"subject":"pre-commit hook to reject whitespace","fromName":"Neal Kreitzinger","fromEmail":"neal@rsss.com","sentAt":"2011-06-03T23:31:26Z","receivedAt":"2011-06-03T23:31:26Z","isPatch":false,"sender":{"key":"neal@rsss.com","avatar":null},"body":"The reference manuals state in the hooks documentation that the pre-commit \nhook sample will reject whitespace only changes.  However, the \npre-commit.sample in the 1.7.1 and 1.7.5.4 downloads do not appear to do \nthis (I'm new to linux scripts).  The appear to only reject non-ascii \nfilenames.  Does someone have a pre-commit hook example I can use to reject \nwhitespace-only changes?  Thanks!\n\nv/r,\nneal \n"},{"id":"169288","messageId":"isbsf8$6id$1@dough.gmane.org","threadId":"27542","inReplyTo":"isbqsf$vh8$1@dough.gmane.org","subject":"Re: pre-commit hook to reject whitespace","fromName":"Neal Kreitzinger","fromEmail":"nkreitzinger@gmail.com","sentAt":"2011-06-03T23:58:31Z","receivedAt":"2011-06-03T23:58:31Z","isPatch":false,"sender":{"key":"nkreitzinger@gmail.com","avatar":null},"body":"On 6/3/2011 6:31 PM, Neal Kreitzinger wrote:\n> The reference manuals state in the hooks documentation that the pre-commit\n> hook sample will reject whitespace only changes.  However, the\n> pre-commit.sample in the 1.7.1 and 1.7.5.4 downloads do not appear to do\n> this (I'm new to linux scripts).  The appear to only reject non-ascii\n> filenames.  Does someone have a pre-commit hook example I can use to reject\n> whitespace-only changes?  Thanks!\n>\nAs someone kindly pointed out, the documentation actually says:\n\"The default 'pre-commit' hook, when enabled, catches introduction of \nlines with trailing whitespaces and aborts the commit when such a line \nis found.\"\n\nI'm not seeing this functionality in the pre-commit.sample for 1.7.1 or \n1.7.5.4.\n\nv/r,\nneal\n"},{"id":"169294","messageId":"BANLkTi=Gh9CStVkgp5gBs7XzG-dCXB+oUw@mail.gmail.com","threadId":"27542","inReplyTo":"isbsf8$6id$1@dough.gmane.org","subject":"Re: pre-commit hook to reject whitespace","fromName":"John Szakmeister","fromEmail":"john@szakmeister.net","sentAt":"2011-06-04T00:12:45Z","receivedAt":"2011-06-04T00:12:45Z","isPatch":false,"sender":{"key":"john@szakmeister.net","avatar":"https://avatars.githubusercontent.com/u/448087?v=4"},"body":"On Fri, Jun 3, 2011 at 7:58 PM, Neal Kreitzinger <nkreitzinger@gmail.com> wrote:\n> On 6/3/2011 6:31 PM, Neal Kreitzinger wrote:\n>>\n>> The reference manuals state in the hooks documentation that the pre-commit\n>> hook sample will reject whitespace only changes.  However, the\n>> pre-commit.sample in the 1.7.1 and 1.7.5.4 downloads do not appear to do\n>> this (I'm new to linux scripts).  The appear to only reject non-ascii\n>> filenames.  Does someone have a pre-commit hook example I can use to\n>> reject\n>> whitespace-only changes?  Thanks!\n>>\n> As someone kindly pointed out, the documentation actually says:\n> \"The default 'pre-commit' hook, when enabled, catches introduction of lines\n> with trailing whitespaces and aborts the commit when such a line is found.\"\n>\n> I'm not seeing this functionality in the pre-commit.sample for 1.7.1 or\n> 1.7.5.4.\n\nI've never tried that hook script myself, but it appears to be on the last line:\n   exec git diff-index --check --cached $against --\n\nIn particular, the --check option says:\n    Warn if changes introduce trailing whitespace or an indent that\nuses a space before a tab. Exits with non-zero status if problems are\nfound. Not compatible with --exit-code.\n\nHTH!\n\n-John\n"},{"id":"169295","messageId":"4DE97B10.8080006@gmail.com","threadId":"27542","inReplyTo":"BANLkTi=Gh9CStVkgp5gBs7XzG-dCXB+oUw@mail.gmail.com","subject":"Re: pre-commit hook to reject whitespace","fromName":"Neal Kreitzinger","fromEmail":"nkreitzinger@gmail.com","sentAt":"2011-06-04T00:23:44Z","receivedAt":"2011-06-04T00:23:44Z","isPatch":false,"sender":{"key":"nkreitzinger@gmail.com","avatar":null},"body":"On 6/3/2011 7:12 PM, John Szakmeister wrote:\n> On Fri, Jun 3, 2011 at 7:58 PM, Neal Kreitzinger<nkreitzinger@gmail.com>  wrote:\n>> On 6/3/2011 6:31 PM, Neal Kreitzinger wrote:\n>>>\n>>> The reference manuals state in the hooks documentation that the pre-commit\n>>> hook sample will reject whitespace only changes.  However, the\n>>> pre-commit.sample in the 1.7.1 and 1.7.5.4 downloads do not appear to do\n>>> this (I'm new to linux scripts).  The appear to only reject non-ascii\n>>> filenames.  Does someone have a pre-commit hook example I can use to\n>>> reject\n>>> whitespace-only changes?  Thanks!\n>>>\n>> As someone kindly pointed out, the documentation actually says:\n>> \"The default 'pre-commit' hook, when enabled, catches introduction of lines\n>> with trailing whitespaces and aborts the commit when such a line is found.\"\n>>\n>> I'm not seeing this functionality in the pre-commit.sample for 1.7.1 or\n>> 1.7.5.4.\n>\n> I've never tried that hook script myself, but it appears to be on the last line:\n>     exec git diff-index --check --cached $against --\n>\n> In particular, the --check option says:\n>      Warn if changes introduce trailing whitespace or an indent that\n> uses a space before a tab. Exits with non-zero status if problems are\n> found. Not compatible with --exit-code.\n>\nAh ha!  Thanks!\n\nv/r,\nneal\n"}]}