<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/templates/hooks--pre-commit.sample, branch v1.8.2.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v1.8.2.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v1.8.2.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2011-10-26T21:31:14Z</updated>
<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>
<entry>
<title>Update sample pre-commit hook to use "diff --check"</title>
<updated>2008-06-27T05:08:25Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2008-06-26T23:08:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=03e2b630f05b88da5ff43f194fed25755de44e8b'/>
<id>urn:sha1:03e2b630f05b88da5ff43f194fed25755de44e8b</id>
<content type='text'>
Now "diff --check" can detect not just whitespace errors but also notices
leftover conflict marker lines, we can use it in the sample pre-commit
hook script.

These days the object layer knows about the empty tree object without
actually having one in the repository, so we can run the test even for the
initial commit.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Ship sample hooks with .sample suffix</title>
<updated>2008-06-25T02:06:22Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2008-06-25T01:45:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f98f8cbac01e0d5dbb30660d7ea70af6a1439dfd'/>
<id>urn:sha1:f98f8cbac01e0d5dbb30660d7ea70af6a1439dfd</id>
<content type='text'>
We used to mark hooks we ship as samples by making them unexecutable, but
some filesystems cannot tell what is executable and what is not.

This makes it much more explicit.  The hooks are suffixed with .sample
(but now are made executable), so enabling it is still one step operation
(instead of "chmod +x $hook", you would do "mv $hook.sample $hook") but
now they won't get accidentally enabled on systems without executable bit.

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