<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/templates/hooks--pre-push.sample, branch v2.26.1</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.26.1</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.26.1'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2014-12-22T18:27:42Z</updated>
<entry>
<title>pre-push.sample: remove unnecessary and misleading IFS=' '</title>
<updated>2014-12-22T18:27:42Z</updated>
<author>
<name>Jim Hill</name>
<email>gjthill@gmail.com</email>
</author>
<published>2014-12-21T19:26:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3af74cfb153e20277a1d22414f04249d90d34d5c'/>
<id>urn:sha1:3af74cfb153e20277a1d22414f04249d90d34d5c</id>
<content type='text'>
The sample hook explicitly sets IFS to SP and nothing else so that
the "read" used in the per-ref while loop that iterates over
"&lt;localref&gt; SP &lt;localsha1&gt; SP &lt;remoteref&gt; SP &lt;remotesha&gt;" records,
where we know refs and sha1s will not have SPs, would split them
correctly.

While this is not wrong per-se, it is not necessary; because we know
these fields do not contain HT or LF, either, we can simply leave
IFS the default.

This will also prevent those who cut and paste from this sample from
getting bitten when they write things in the per-ref loop that need
splitting with the default $IFS (e.g. use $(git rev-list ...) to
produce one-record-per-line output).

Signed-off-by: Jim Hill &lt;gjthill@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pre-push.sample: Write error message to stderr</title>
<updated>2014-09-11T22:26:35Z</updated>
<author>
<name>W. Trevor King</name>
<email>wking@tremily.us</email>
</author>
<published>2014-09-11T20:35:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1a947ba3a3eebea80be6a6d1000614884807bc8b'/>
<id>urn:sha1:1a947ba3a3eebea80be6a6d1000614884807bc8b</id>
<content type='text'>
githooks(5) suggests:

  Information about why the push is rejected may be sent to the user
  by writing to standard error.

So follow that advice in the sample.

Signed-off-by: W. Trevor King &lt;wking@tremily.us&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fix shell syntax error in template</title>
<updated>2013-08-30T16:56:30Z</updated>
<author>
<name>Thorsten Glaser</name>
<email>t.glaser@tarent.de</email>
</author>
<published>2013-08-30T10:40:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6897a64b652d83e477389ec1a248b47b8d821db6'/>
<id>urn:sha1:6897a64b652d83e477389ec1a248b47b8d821db6</id>
<content type='text'>
An if clause must not be empty; add a "colon" command.

Signed-off-by: Thorsten Glaser &lt;t.glaser@tarent.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>pre-push.sample: Make the script executable</title>
<updated>2013-06-11T18:22:00Z</updated>
<author>
<name>Wieland Hoffmann</name>
<email>themineo@gmail.com</email>
</author>
<published>2013-06-11T12:14:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3ea59412e83065b38b52cb8d7b8432e0f516de6c'/>
<id>urn:sha1:3ea59412e83065b38b52cb8d7b8432e0f516de6c</id>
<content type='text'>
githooks(5) says that "[...]the .sample files are executable by default"
which was not true.

Signed-off-by: Wieland Hoffmann &lt;themineo@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Add sample pre-push hook script</title>
<updated>2013-01-18T19:13:22Z</updated>
<author>
<name>Aaron Schrab</name>
<email>aaron@schrab.com</email>
</author>
<published>2013-01-13T05:17:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=87c86dd14abe8db7d00b0df5661ef8cf147a72a3'/>
<id>urn:sha1:87c86dd14abe8db7d00b0df5661ef8cf147a72a3</id>
<content type='text'>
Create a sample of a script for a pre-push hook.  The main purpose is to
illustrate how a script may parse the information which is supplied to
such a hook.  The script may also be useful to some people as-is for
avoiding to push commits which are marked as a work in progress.

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