<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/templates/hooks--pre-commit.sample, branch v2.6.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.6.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.6.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2013-09-24T19:26:49Z</updated>
<entry>
<title>sample pre-commit hook: use --bool when retrieving config var</title>
<updated>2013-09-24T19:26:49Z</updated>
<author>
<name>Johan Herland</name>
<email>johan@herland.net</email>
</author>
<published>2013-09-24T07:52:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=af1748b31eb68643f1b8d9d918f43611cf96d257'/>
<id>urn:sha1:af1748b31eb68643f1b8d9d918f43611cf96d257</id>
<content type='text'>
Currently if you set

	[hooks]
		allowNonAscii

(or allownonascii = 1, or = yes) in your .git/config then the sample
pre-commit misinterprets the value as "false" and rejects non-ASCII
filenames.  Use "git config --bool" to get the usual nicer boolean
handling.

Signed-off-by: Johan Herland &lt;johan@herland.net&gt;
Signed-off-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
</content>
</entry>
<entry>
<title>templates: spell ASCII in uppercase in pre-commit hook</title>
<updated>2013-07-15T16:52:57Z</updated>
<author>
<name>Richard Hartmann</name>
<email>richih.mailinglist@gmail.com</email>
</author>
<published>2013-07-14T16:21:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7b3742fa466401574a2ff380d5d121b2ac5cea45'/>
<id>urn:sha1:7b3742fa466401574a2ff380d5d121b2ac5cea45</id>
<content type='text'>
The name of the encoding is ASCII, not ascii.

Signed-off-by: Richard Hartmann &lt;richih.mailinglist@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>templates: Reformat pre-commit hook's message</title>
<updated>2013-07-15T16:52:52Z</updated>
<author>
<name>Richard Hartmann</name>
<email>richih.mailinglist@gmail.com</email>
</author>
<published>2013-07-14T16:21:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b1d5a570fc0176c77a52896e3b59174baa95e8bf'/>
<id>urn:sha1:b1d5a570fc0176c77a52896e3b59174baa95e8bf</id>
<content type='text'>
Now that we're using heredoc, the message can span the full 80 chars.

Signed-off-by: Richard Hartmann &lt;richih.mailinglist@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>templates: Use heredoc in pre-commit hook</title>
<updated>2013-07-15T16:51:16Z</updated>
<author>
<name>Richard Hartmann</name>
<email>richih.mailinglist@gmail.com</email>
</author>
<published>2013-07-14T16:21:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=27b6e17a6d84a18861f05fd7c684ab443bf15244'/>
<id>urn:sha1:27b6e17a6d84a18861f05fd7c684ab443bf15244</id>
<content type='text'>
This way, it is easier to see how the text we give the end users
would look like, and it will allow us to use (near) full width
of the source file.

Signed-off-by: Richard Hartmann &lt;richih.mailinglist@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>make the sample pre-commit hook script reject names with newlines, too</title>
<updated>2011-10-26T21:31:14Z</updated>
<author>
<name>Jim Meyering</name>
<email>jim@meyering.net</email>
</author>
<published>2011-10-22T17:44:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c14daa4845ff2ec0d27807fa50f9fac1ca4d6462'/>
<id>urn:sha1:c14daa4845ff2ec0d27807fa50f9fac1ca4d6462</id>
<content type='text'>
The sample pre-commit hook script would fail to reject a file name like
"a\nb" because of the way newlines are handled in "$(...)".  Adjust the
test to count filtered bytes and require there be 0.  Also print all
diagnostics to standard error, not stdout, so they will actually be seen.

Signed-off-by: Jim Meyering &lt;meyering@redhat.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Modernize git calling conventions in hook templates</title>
<updated>2010-03-20T16:04:38Z</updated>
<author>
<name>Ben Walton</name>
<email>bwalton@artsci.utoronto.ca</email>
</author>
<published>2010-03-20T14:48:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=100e762a60a691a4978434f1cd5532e19cad39fc'/>
<id>urn:sha1:100e762a60a691a4978434f1cd5532e19cad39fc</id>
<content type='text'>
The hook templates were still using/referencing 'git-foo' instead of
'git foo.'  This patch updates the sample hooks to use the modern
conventions instead.

Signed-off-by: Ben Walton &lt;bwalton@artsci.utoronto.ca&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pre-commit.sample: Diff against the empty tree when HEAD is invalid</title>
<updated>2009-11-07T07:48:09Z</updated>
<author>
<name>Björn Steinbrink</name>
<email>B.Steinbrink@gmx.de</email>
</author>
<published>2009-11-05T10:57:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c30eb852e281d55b04465b7814e00396893f74f3'/>
<id>urn:sha1:c30eb852e281d55b04465b7814e00396893f74f3</id>
<content type='text'>
This was already the case for the old "diff --check" call, but the new
one that checks whether there are any non-ascii file names was missing
it, making that check fail for root commits.

Signed-off-by: Björn Steinbrink &lt;B.Steinbrink@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pre-commit.sample: add comment re tr portability; fix grammar</title>
<updated>2009-09-22T19:15:42Z</updated>
<author>
<name>Jim Meyering</name>
<email>meyering@redhat.com</email>
</author>
<published>2009-09-21T11:00:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f1e3156e627fa66714deea665c8f3585088b9695'/>
<id>urn:sha1:f1e3156e627fa66714deea665c8f3585088b9695</id>
<content type='text'>
Add a comment explaining why square brackets around a tr range
are not only ok, but actually required in this case.
Correct spelling and grammar.

Signed-off-by: Jim Meyering &lt;meyering@redhat.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Extend sample pre-commit hook to check for non ascii filenames</title>
<updated>2009-05-20T07:04:37Z</updated>
<author>
<name>Heiko Voigt</name>
<email>hvoigt@hvoigt.net</email>
</author>
<published>2009-05-19T20:01:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d00e364de99d51bb76e437820e23cfa820417ec5'/>
<id>urn:sha1:d00e364de99d51bb76e437820e23cfa820417ec5</id>
<content type='text'>
At the moment non-ascii encodings of filenames are not portably
converted between different filesystems by git. This will most likely
change in the future but to allow repositories to be portable among
different file/operating systems this check is enabled by default.

Signed-off-by: Heiko Voigt &lt;hvoigt@hvoigt.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pre-commit.sample: don't print incidental SHA1</title>
<updated>2009-05-16T18:57:17Z</updated>
<author>
<name>Jim Meyering</name>
<email>jim@meyering.net</email>
</author>
<published>2009-05-16T10:21:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c646217e1366b0397552fad8c32acb47fbe8977d'/>
<id>urn:sha1:c646217e1366b0397552fad8c32acb47fbe8977d</id>
<content type='text'>
Make the sample pre-commit hook script discard
all git-rev-parse output, not just stderr.
Otherwise, it would print an SHA1.

Signed-off-by: Jim Meyering &lt;meyering@redhat.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
