<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/commit.c, branch v2.12.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.12.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.12.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-01-31T18:09:00Z</updated>
<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>
<entry>
<title>commit: remove 'Clever' message for --only --amend</title>
<updated>2016-12-09T18:52:46Z</updated>
<author>
<name>Andreas Krey</name>
<email>a.krey@gmx.de</email>
</author>
<published>2016-12-09T04:10:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=beb635ca9ced5cd8f0eb5d2def9468f14bd243bc'/>
<id>urn:sha1:beb635ca9ced5cd8f0eb5d2def9468f14bd243bc</id>
<content type='text'>
The behavior is now documented; more importantly, rewarding the user
with a "Wow, you are clever" praise afterwards is not an effective
way to advertise the feature--at that point the user already knows.

Signed-off-by: Andreas Krey &lt;a.krey@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>hold_locked_index(): align error handling with hold_lockfile_for_update()</title>
<updated>2016-12-07T19:31:59Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-12-07T18:33:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b3e83cc752e905e063d0930c682a06de5034074f'/>
<id>urn:sha1:b3e83cc752e905e063d0930c682a06de5034074f</id>
<content type='text'>
Callers of the hold_locked_index() function pass 0 when they want to
prepare to write a new version of the index file without wishing to
die or emit an error message when the request fails (e.g. somebody
else already held the lock), and pass 1 when they want the call to
die upon failure.

This option is called LOCK_DIE_ON_ERROR by the underlying lockfile
API, and the hold_locked_index() function translates the paramter to
LOCK_DIE_ON_ERROR when calling the hold_lock_file_for_update().

Replace these hardcoded '1' with LOCK_DIE_ON_ERROR and stop
translating.  Callers other than the ones that are replaced with
this change pass '0' to the function; no behaviour change is
intended with this patch.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
---

Among the callers of hold_locked_index() that passes 0:

 - diff.c::refresh_index_quietly() at the end of "git diff" is an
   opportunistic update; it leaks the lockfile structure but it is
   just before the program exits and nobody should care.

 - builtin/describe.c::cmd_describe(),
   builtin/commit.c::cmd_status(),
   sequencer.c::read_and_refresh_cache() are all opportunistic
   updates and they are OK.

 - builtin/update-index.c::cmd_update_index() takes a lock upfront
   but we may end up not needing to update the index (i.e. the
   entries may be fully up-to-date), in which case we do not need to
   issue an error upon failure to acquire the lock.  We do diagnose
   and die if we indeed need to update, so it is OK.

 - wt-status.c::require_clean_work_tree() IS BUGGY.  It asks
   silence, does not check the returned value.  Compare with
   callsites like cmd_describe() and cmd_status() to notice that it
   is wrong to call update_index_if_able() unconditionally.
</content>
</entry>
<entry>
<title>commit: make --only --allow-empty work without paths</title>
<updated>2016-12-05T20:41:06Z</updated>
<author>
<name>Andreas Krey</name>
<email>a.krey@gmx.de</email>
</author>
<published>2016-12-02T22:15:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=319d835240b752b94ccb67f6515759824955937b'/>
<id>urn:sha1:319d835240b752b94ccb67f6515759824955937b</id>
<content type='text'>
--only is implied when paths are present, and required
them unless --amend. But with --allow-empty it should
be allowed as well - it is the only way to create an
empty commit in the presence of staged changes.

Signed-off-by: Andreas Krey &lt;a.krey@gmx.de&gt;
Reviewed-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>commit: make ignore_non_trailer take buf/len</title>
<updated>2016-11-29T22:22:18Z</updated>
<author>
<name>Jonathan Tan</name>
<email>jonathantanmy@google.com</email>
</author>
<published>2016-11-02T17:29:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=710714aaa822acbad14f1b7100fa2776d2bc8ce6'/>
<id>urn:sha1:710714aaa822acbad14f1b7100fa2776d2bc8ce6</id>
<content type='text'>
Make ignore_non_trailer take a buf/len pair instead of struct strbuf.

Signed-off-by: Jonathan Tan &lt;jonathantanmy@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'rs/commit-pptr-simplify'</title>
<updated>2016-10-31T20:15:25Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-10-31T20:15:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2f445c17e59bb1fa49ad9197a4155f878f50d5f5'/>
<id>urn:sha1:2f445c17e59bb1fa49ad9197a4155f878f50d5f5</id>
<content type='text'>
Code simplification.

* rs/commit-pptr-simplify:
  commit: simplify building parents list
</content>
</entry>
<entry>
<title>commit: simplify building parents list</title>
<updated>2016-10-30T23:03:25Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2016-10-29T12:55:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=de9f7fa3b08ae0554e57f6a6f5de2559d5bcb871'/>
<id>urn:sha1:de9f7fa3b08ae0554e57f6a6f5de2559d5bcb871</id>
<content type='text'>
Push pptr down into the FROM_MERGE branch of the if/else statement,
where it's actually used, and call commit_list_append() for appending
elements instead of playing tricks with commit_list_insert().  Call
copy_commit_list() in the amend branch instead of open-coding it.  Don't
bother setting pptr in the final branch as it's not used thereafter.

Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
