<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/commit.c, 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>2013-02-19T17:30:50Z</updated>
<entry>
<title>git-commit: only append a newline to -m mesg if necessary</title>
<updated>2013-02-19T17:30:50Z</updated>
<author>
<name>Brandon Casey</name>
<email>drafnel@gmail.com</email>
</author>
<published>2013-02-19T04:17:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a24a41ea9a928ccde2db074ab0835c4817223c9d'/>
<id>urn:sha1:a24a41ea9a928ccde2db074ab0835c4817223c9d</id>
<content type='text'>
Currently, git will append two newlines to every message supplied via
the -m switch.  The purpose of this is to allow -m to be supplied
multiple times and have each supplied string become a paragraph in the
resulting commit message.

Normally, this does not cause a problem since any trailing newlines will
be removed by the cleanup operation.  If cleanup=verbatim for example,
then the trailing newlines will not be removed and will survive into the
resulting commit message.

Instead, let's ensure that the string supplied to -m is newline terminated,
but only append a second newline when appending additional messages.

Fixes the test in t7502.

Signed-off-by: Brandon Casey &lt;drafnel@gmail.com&gt;
Reviewed-by: Jonathan Nieder &lt;jrnieder@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'maint'</title>
<updated>2013-02-12T20:23:12Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-02-12T20:23:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5bf72ed2e7ef82d5ef7a35c978dc72576fdb0efc'/>
<id>urn:sha1:5bf72ed2e7ef82d5ef7a35c978dc72576fdb0efc</id>
<content type='text'>
* maint:
  Replace filepattern with pathspec for consistency
</content>
</entry>
<entry>
<title>Replace filepattern with pathspec for consistency</title>
<updated>2013-02-12T18:05:38Z</updated>
<author>
<name>Matthieu Moy</name>
<email>Matthieu.Moy@imag.fr</email>
</author>
<published>2013-02-12T09:24:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d32805dce7bdc45a3e4045e999fc5d56e3b46a82'/>
<id>urn:sha1:d32805dce7bdc45a3e4045e999fc5d56e3b46a82</id>
<content type='text'>
pathspec is the most widely used term, and is the one defined in
gitglossary.txt. &lt;filepattern&gt; was used only in the synopsys for git-add
and git-commit, and in git-add.txt. Get rid of it.

This patch is obtained with by running:

  perl -pi -e 's/filepattern/pathspec/' `git grep -l filepattern`

Signed-off-by: Matthieu Moy &lt;Matthieu.Moy@imag.fr&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/read-commit-buffer-data-after-free'</title>
<updated>2013-02-04T18:25:18Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-02-04T18:25:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d5365b43274779246665416caf1a51af5a29f776'/>
<id>urn:sha1:d5365b43274779246665416caf1a51af5a29f776</id>
<content type='text'>
Clarify the ownership rule for commit-&gt;buffer field, which some
callers incorrectly accessed without making sure it is populated.

* jk/read-commit-buffer-data-after-free:
  logmsg_reencode: lazily load missing commit buffers
  logmsg_reencode: never return NULL
  commit: drop useless xstrdup of commit message
</content>
</entry>
<entry>
<title>Merge branch 'jc/custom-comment-char'</title>
<updated>2013-02-04T18:23:49Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-02-04T18:23:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=149a4211a4b8d8bbcdd72685d538d6ac7365e29e'/>
<id>urn:sha1:149a4211a4b8d8bbcdd72685d538d6ac7365e29e</id>
<content type='text'>
Allow a configuration variable core.commentchar to customize the
character used to comment out the hint lines in the edited text from
the default '#'.

* jc/custom-comment-char:
  Allow custom "comment char"
</content>
</entry>
<entry>
<title>logmsg_reencode: never return NULL</title>
<updated>2013-01-26T21:28:21Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2013-01-26T09:44:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dd0d388c44c28ebc021a24eeddc60287d4ea249c'/>
<id>urn:sha1:dd0d388c44c28ebc021a24eeddc60287d4ea249c</id>
<content type='text'>
The logmsg_reencode function will return the reencoded
commit buffer, or NULL if reencoding failed or no reencoding
was necessary. Since every caller then ends up checking for NULL
and just using the commit's original buffer, anyway, we can
be a bit more helpful and just return that buffer when we
would have returned NULL.

Since the resulting string may or may not need to be freed,
we introduce a logmsg_free, which checks whether the buffer
came from the commit object or not (callers either
implemented the same check already, or kept two separate
pointers, one to mark the buffer to be used, and one for the
to-be-freed string).

Pushing this logic into logmsg_* simplifies the callers, and
will let future patches lazily load the commit buffer in a
single place.

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>commit: drop useless xstrdup of commit message</title>
<updated>2013-01-26T21:28:19Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2013-01-26T09:42:45Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=200ebe362cda2a520219f998d4b2c44767992bdb'/>
<id>urn:sha1:200ebe362cda2a520219f998d4b2c44767992bdb</id>
<content type='text'>
When git-commit is asked to reuse a commit message via "-c",
we call read_commit_message, which looks up the commit and
hands back either the re-encoded result, or a copy of the
original. We make a copy in the latter case so that the
ownership semantics of the return value are clear (in either
case, it can be freed).

However, since we return a "const char *", and since the
resulting buffer's lifetime is the same as that of the whole
program, we never bother to free it at all.

Let's just drop the copy. That saves us a copy in the common
case. While it does mean we leak in the re-encode case, it
doesn't matter, since we are relying on program exit to free
the memory anyway.

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>Merge branch 'as/pre-push-hook'</title>
<updated>2013-01-24T05:19:25Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-01-24T05:19:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bb9a69694f27aa299777c679979f75bdef75735d'/>
<id>urn:sha1:bb9a69694f27aa299777c679979f75bdef75735d</id>
<content type='text'>
Add an extra hook so that "git push" that is run without making
sure what is being pushed is sane can be checked and rejected (as
opposed to the user deciding not pushing).

* as/pre-push-hook:
  Add sample pre-push hook script
  push: Add support for pre-push hooks
  hooks: Add function to check if a hook exists
</content>
</entry>
<entry>
<title>Allow custom "comment char"</title>
<updated>2013-01-16T20:48:22Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-01-16T19:18:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=eff80a9fd990de3605063050dae32f969ef18ba8'/>
<id>urn:sha1:eff80a9fd990de3605063050dae32f969ef18ba8</id>
<content type='text'>
Some users do want to write a line that begin with a pound sign, #,
in their commit log message.  Many tracking system recognise
a token of #&lt;bugid&gt; form, for example.

The support we offer these use cases is not very friendly to the end
users.  They have a choice between

 - Don't do it.  Avoid such a line by rewrapping or indenting; and

 - Use --cleanup=whitespace but remove all the hint lines we add.

Give them a way to set a custom comment char, e.g.

    $ git -c core.commentchar="%" commit

so that they do not have to do either of the two workarounds.

[jc: although I started the topic, all the tests and documentation
updates, many of the call sites of the new strbuf_add_commented_*()
functions, and the change to git-submodule.sh scripted Porcelain are
from Ralf.]

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Ralf Thielow &lt;ralf.thielow@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>hooks: Add function to check if a hook exists</title>
<updated>2013-01-14T17:25:40Z</updated>
<author>
<name>Aaron Schrab</name>
<email>aaron@schrab.com</email>
</author>
<published>2013-01-13T05:17:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5a7da2dca166fab74f4514697e26dd80e79933f5'/>
<id>urn:sha1:5a7da2dca166fab74f4514697e26dd80e79933f5</id>
<content type='text'>
Create find_hook() function to determine if a given hook exists and is
executable.  If it is, the path to the script will be returned,
otherwise NULL is returned.

This encapsulates the tests that are used to check for the existence of
a hook in one place, making it easier to modify those checks if that is
found to be necessary.  This also makes it simple for places that can
use a hook to check if a hook exists before doing, possibly lengthy,
setup work which would be pointless if no such hook is present.

The returned value is left as a static value from get_pathname() rather
than a duplicate because it is anticipated that the return value will
either be used as a boolean, immediately added to an argv_array list
which would result in it being duplicated at that point, or used to
actually run the command without much intervening work.  Callers which
need to hold onto the returned value for a longer time are expected to
duplicate the return value themselves.

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