<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/t/t7505-prepare-commit-msg-hook.sh, branch v2.3.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.3.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.3.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2014-03-18T18:26:06Z</updated>
<entry>
<title>merge hook tests: fix and update tests</title>
<updated>2014-03-18T18:26:06Z</updated>
<author>
<name>Benoit Pierre</name>
<email>benoit.pierre@gmail.com</email>
</author>
<published>2014-03-18T10:00:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1fc4f97d570c97471202ff561c7e3697e2faee6a'/>
<id>urn:sha1:1fc4f97d570c97471202ff561c7e3697e2faee6a</id>
<content type='text'>
- update 'no editor' hook test and add 'editor' hook test
- make sure the tree is reset to a clean state after running a test
  (using test_when_finished) so later tests are not impacted

Signed-off-by: Benoit Pierre &lt;benoit.pierre@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>merge hook tests: use 'test_must_fail' instead of '!'</title>
<updated>2014-03-11T20:57:43Z</updated>
<author>
<name>Benoit Pierre</name>
<email>benoit.pierre@gmail.com</email>
</author>
<published>2014-03-10T18:49:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b7ae14148fc44223b4ffaff5ccbf3227a0af8f3c'/>
<id>urn:sha1:b7ae14148fc44223b4ffaff5ccbf3227a0af8f3c</id>
<content type='text'>
Signed-off-by: Benoit Pierre &lt;benoit.pierre@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>merge hook tests: fix missing '&amp;&amp;' in test</title>
<updated>2014-03-11T20:57:39Z</updated>
<author>
<name>Benoit Pierre</name>
<email>benoit.pierre@gmail.com</email>
</author>
<published>2014-03-10T18:49:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3219bad94422084184987c9660361f3245d69f04'/>
<id>urn:sha1:3219bad94422084184987c9660361f3245d69f04</id>
<content type='text'>
Signed-off-by: Benoit Pierre &lt;benoit.pierre@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>merge: Honor prepare-commit-msg return code</title>
<updated>2013-01-03T17:10:11Z</updated>
<author>
<name>Antoine Pelisse</name>
<email>apelisse@gmail.com</email>
</author>
<published>2013-01-02T18:42:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3e4141d08c8dc1964d53c2ce13de8876d29e6436'/>
<id>urn:sha1:3e4141d08c8dc1964d53c2ce13de8876d29e6436</id>
<content type='text'>
65969d4 (merge: honor prepare-commit-msg hook, 2011-02-14) tried to
make "git commit" and "git merge" consistent, because a merge that
required user assistance has to be concluded with "git commit", but
back then only "git commit" triggered prepare-commit-msg hook.

When it added a call to run the prepare-commit-msg hook, however, it
forgot to check the exit code from the hook like "git commit" does,
and ended up replacing one inconsistency with another.

When prepare-commit-msg hook that is run from "git merge" exits with
a non-zero status, abort the commit.

Signed-off-by: Antoine Pelisse &lt;apelisse@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>merge: honor prepare-commit-msg hook</title>
<updated>2011-02-15T21:35:35Z</updated>
<author>
<name>Jay Soffian</name>
<email>jaysoffian@gmail.com</email>
</author>
<published>2011-02-15T01:07:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=65969d43d10512a44f5e7248e4404b946d1d0d9f'/>
<id>urn:sha1:65969d43d10512a44f5e7248e4404b946d1d0d9f</id>
<content type='text'>
When a merge is stopped due to conflicts or --no-commit, the
subsequent commit calls the prepare-commit-msg hook. However,
it is not called after a clean merge. Fix this inconsistency
by invoking the hook after clean merges as well.

Signed-off-by: Jay Soffian &lt;jaysoffian@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>tests: use "git xyzzy" form (t7200 - t9001)</title>
<updated>2008-09-03T21:51:48Z</updated>
<author>
<name>Nanako Shiraishi</name>
<email>nanako3@lavabit.com</email>
</author>
<published>2008-09-03T08:59:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=47a528ad24185133867ebb5bb7692db2cb8bef39'/>
<id>urn:sha1:47a528ad24185133867ebb5bb7692db2cb8bef39</id>
<content type='text'>
Converts tests between t7201-t9001.

Signed-off-by: Nanako Shiraishi &lt;nanako3@lavabit.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Fix tests breaking when checkout path contains shell metacharacters</title>
<updated>2008-05-05T21:37:02Z</updated>
<author>
<name>Bryan Donlan</name>
<email>bdonlan@fushizen.net</email>
</author>
<published>2008-05-04T05:37:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f69e836fab2b634281d92a0d304de4d768e479cc'/>
<id>urn:sha1:f69e836fab2b634281d92a0d304de4d768e479cc</id>
<content type='text'>
This fixes the remainder of the issues where the test script itself is at
fault for failing when the git checkout path contains whitespace or other
shell metacharacters.

The majority of git svn tests used the idiom

  test_expect_success "title" "test script using $svnrepo"

These were changed to have the test script in single-quotes:

  test_expect_success "title" 'test script using "$svnrepo"'

which unfortunately makes the patch appear larger than it really is.

One consequence of this change is that in the verbose test output the
value of $svnrepo (and in some cases other variables, too) is no
longer expanded, i.e. previously we saw

  * expecting success:
	test script using /path/to/git/t/trash/svnrepo

but now it is:

  * expecting success:
	test script using "$svnrepo"

Signed-off-by: Bryan Donlan &lt;bdonlan@fushizen.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>t7505: use SHELL_PATH in hook</title>
<updated>2008-03-13T07:57:53Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2008-03-12T21:42:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=462f8caf248178121ef705dd1b6980eb3b846833'/>
<id>urn:sha1:462f8caf248178121ef705dd1b6980eb3b846833</id>
<content type='text'>
The hook doesn't run properly under Solaris /bin/sh. Let's
use the SHELL_PATH the user told us about already instead.

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>git-commit: add a prepare-commit-msg hook</title>
<updated>2008-02-06T10:26:55Z</updated>
<author>
<name>Paolo Bonzini</name>
<email>bonzini@gnu.org</email>
</author>
<published>2008-02-05T07:04:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8089c85bcba89464b9b2a32fa948ed85eb367e70'/>
<id>urn:sha1:8089c85bcba89464b9b2a32fa948ed85eb367e70</id>
<content type='text'>
The prepare-commit-msg hook is run whenever a "fresh" commit message
is prepared, just before it is shown in the editor (if it is).
Its purpose is to modify the commit message in-place.

It takes one to three parameters.  The first is the name of the file that
the commit log message.  The second is the source of the commit message,
and can be: "message" (if a -m or -F option was given); "template" (if a
-t option was given or the configuration option commit.template is set);
"merge" (if the commit is a merge or a .git/MERGE_MSG file exists);
"squash" (if a .git/SQUASH_MSG file exists); or "commit", followed by
a commit SHA1 as the third parameter (if a -c, -C or --amend option
was given).

If its exit status is non-zero, git-commit will abort.  The hook is
not suppressed by the --no-verify option, so it should not be used
as a replacement for the pre-commit hook.

The sample prepare-commit-msg comments out the `Conflicts:` part of
a merge's commit message; other examples are commented out, including
adding a Signed-off-by line at the bottom of the commit messsage,
that the user can then edit or discard altogether.

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