<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/commit.c, branch v2.13.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.13.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.13.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-05-18T06:00:48Z</updated>
<entry>
<title>interpret-trailers: honor the cut line</title>
<updated>2017-05-18T06:00:48Z</updated>
<author>
<name>Brian Malehorn</name>
<email>bmalehorn@gmail.com</email>
</author>
<published>2017-05-16T06:06:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d76650b8d16c9e5e7b6ee94e6922a3b99be74746'/>
<id>urn:sha1:d76650b8d16c9e5e7b6ee94e6922a3b99be74746</id>
<content type='text'>
If a commit message is edited with the "verbose" option, the buffer
will have a cut line and diff after the log message, like so:

    my subject

    # ------------------------ &gt;8 ------------------------
    # Do not touch the line above.
    # Everything below will be removed.
    diff --git a/foo.txt b/foo.txt
    index 5716ca5..7601807 100644
    --- a/foo.txt
    +++ b/foo.txt
    @@ -1 +1 @@
    -bar
    +baz

"git interpret-trailers" is unaware of the cut line, and assumes the
trailer block would be at the end of the whole thing.  This can easily
be seen with:

     $ GIT_EDITOR='git interpret-trailers --in-place --trailer Acked-by:me' \
       git commit --amend -v

Teach "git interpret-trailers" to notice the cut-line and ignore the
remainder of the input when looking for a place to add new trailer
block.  This makes it consistent with how "git commit -v -s" inserts a
new Signed-off-by: line.

This can be done by the same logic as the existing helper function,
wt_status_truncate_message_at_cut_line(), uses, but it wants the caller
to pass a strbuf to it.  Because the function ignore_non_trailer() used
by the command takes a &lt;pointer, length&gt; pair, not a strbuf, steal the
logic from wt_status_truncate_message_at_cut_line() to create a new
wt_status_locate_end() helper function that takes &lt;pointer, length&gt;
pair, and make ignore_non_trailer() call it to help "interpret-trailers".

Since there is only one caller of wt_status_truncate_message_at_cut_line()
in cmd_commit(), rewrite it to call wt_status_locate_end() helper instead
and remove the old helper that no longer has any caller.

Signed-off-by: Brian Malehorn &lt;bmalehorn@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jk/war-on-git-path'</title>
<updated>2017-04-26T06:39:08Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-04-26T06:39:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b80f629f5bcf798a3c9b37651d2369ad555e7382'/>
<id>urn:sha1:b80f629f5bcf798a3c9b37651d2369ad555e7382</id>
<content type='text'>
While handy, "git_path()" is a dangerous function to use as a
callsite that uses it safely one day can be broken by changes
to other code that calls it.  Reduction of its use continues.

* jk/war-on-git-path:
  am: drop "dir" parameter from am_state_init
  replace strbuf_addstr(git_path()) with git_path_buf()
  replace xstrdup(git_path(...)) with git_pathdup(...)
  use git_path_* helper functions
  branch: add edit_description() helper
  bisect: add git_path_bisect_terms helper
</content>
</entry>
<entry>
<title>Merge branch 'nd/conditional-config-include'</title>
<updated>2017-04-24T05:07:46Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-04-24T05:07:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a2e2c046833be53e7599ee7fed5c45f16580ab37'/>
<id>urn:sha1:a2e2c046833be53e7599ee7fed5c45f16580ab37</id>
<content type='text'>
$GIT_DIR may in some cases be normalized with all symlinks resolved
while "gitdir" path expansion in the pattern does not receive the
same treatment, leading to incorrect mismatch.  This has been fixed.

* nd/conditional-config-include:
  config: resolve symlinks in conditional include's patterns
  path.c: and an option to call real_path() in expand_user_path()
</content>
</entry>
<entry>
<title>use git_path_* helper functions</title>
<updated>2017-04-21T04:03:51Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2017-04-20T21:08:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ca03e0670c3ba71400b0f5ed199b045481efdb1e'/>
<id>urn:sha1:ca03e0670c3ba71400b0f5ed199b045481efdb1e</id>
<content type='text'>
Long ago we added functions like git_path_merge_msg() to
replace the more dangerous git_path("MERGE_MSG"). Over time
some new calls to the latter have crept it. Let's convert
them to use the safer form.

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>path.c: and an option to call real_path() in expand_user_path()</title>
<updated>2017-04-15T06:51:38Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2017-04-05T10:24:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4aad2f1627bb74948874c0f31e8ce256bf236aa6'/>
<id>urn:sha1:4aad2f1627bb74948874c0f31e8ce256bf236aa6</id>
<content type='text'>
In the next patch we need the ability to expand '~' to
real_path($HOME). But we can't do that from outside because '~' is part
of a pattern, not a true path. Add an option to expand_user_path() to do
so.

Signed-off-by: Nguyễn Thái Ngọc Duy &lt;pclouds@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>builtin/commit: convert to struct object_id</title>
<updated>2017-02-20T09:11:26Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2017-02-20T00:10:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8066df4194a1b108d2a7200008c39a1dcfebd8df'/>
<id>urn:sha1:8066df4194a1b108d2a7200008c39a1dcfebd8df</id>
<content type='text'>
Convert most leaf functions to use struct object_id.

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>builtin/commit.c: switch to strbuf, instead of snprintf()</title>
<updated>2017-01-31T18:09:00Z</updated>
<author>
<name>Elia Pinto</name>
<email>gitter.spiros@gmail.com</email>
</author>
<published>2017-01-31T13:45:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4a5281917b2b84affa9942c991419115088aec0e'/>
<id>urn:sha1:4a5281917b2b84affa9942c991419115088aec0e</id>
<content type='text'>
Switch to dynamic allocation with strbuf, so we can avoid dealing
with magic numbers in the code and reduce the cognitive burden from
the programmers.  The original code is correct, but programmers no
longer have to count bytes needed for static allocation to know that.

As a side effect of this change, we also reduce the snprintf()
calls, that may silently truncate results if the programmer is not
careful.

Helped-by: René Scharfe &lt;l.s.r@web.de&gt;
Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Helped-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Elia Pinto &lt;gitter.spiros@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>builtin/commit.c: remove the PATH_MAX limitation via dynamic allocation</title>
<updated>2017-01-13T19:22:18Z</updated>
<author>
<name>Elia Pinto</name>
<email>gitter.spiros@gmail.com</email>
</author>
<published>2017-01-13T17:58:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8d7aa4ba6a00b3ff69261e88b4842c0df5662125'/>
<id>urn:sha1:8d7aa4ba6a00b3ff69261e88b4842c0df5662125</id>
<content type='text'>
Remove the PATH_MAX limitation from the environment setting that
points to a filename by switching to dynamic allocation.

As a side effect of this change, we also reduce the snprintf()
calls, that may silently truncate results if the programmer is not
careful.

Helped-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Helped-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Elia Pinto &lt;gitter.spiros@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jc/lock-report-on-error'</title>
<updated>2016-12-19T22:45:35Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-12-19T22:45:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=95713ff4fb858c4f2e7c339cfc503c0cf152e071'/>
<id>urn:sha1:95713ff4fb858c4f2e7c339cfc503c0cf152e071</id>
<content type='text'>
Git 2.11 had a minor regression in "merge --ff-only" that competed
with another process that simultanously attempted to update the
index. We used to explain what went wrong with an error message,
but the new code silently failed.  The error message has been
resurrected.

* jc/lock-report-on-error:
  lockfile: LOCK_REPORT_ON_ERROR
  hold_locked_index(): align error handling with hold_lockfile_for_update()
  wt-status: implement opportunisitc index update correctly
</content>
</entry>
<entry>
<title>Merge branch 'ak/commit-only-allow-empty'</title>
<updated>2016-12-19T22:45:34Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-12-19T22:45:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3aead1cad7a9a35534b86763bbe8c97dfd3f1a03'/>
<id>urn:sha1:3aead1cad7a9a35534b86763bbe8c97dfd3f1a03</id>
<content type='text'>
"git commit --allow-empty --only" (no pathspec) with dirty index
ought to be an acceptable way to create a new commit that does not
change any paths, but it was forbidden, perhaps because nobody
needed it so far.

* ak/commit-only-allow-empty:
  commit: remove 'Clever' message for --only --amend
  commit: make --only --allow-empty work without paths
</content>
</entry>
</feed>
