<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/commit.c, branch v2.0.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.0.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.0.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2014-07-16T18:16:38Z</updated>
<entry>
<title>Merge branch 'jk/commit-buffer-length' into maint</title>
<updated>2014-07-16T18:16:38Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-07-16T18:16:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5c18fde0d96cfcbc321caad8f809028b0c63aaeb'/>
<id>urn:sha1:5c18fde0d96cfcbc321caad8f809028b0c63aaeb</id>
<content type='text'>
A handful of code paths had to read the commit object more than
once when showing header fields that are usually not parsed.  The
internal data structure to keep track of the contents of the commit
object has been updated to reduce the need for this double-reading,
and to allow the caller find the length of the object.

* jk/commit-buffer-length:
  reuse cached commit buffer when parsing signatures
  commit: record buffer length in cache
  commit: convert commit-&gt;buffer to a slab
  commit-slab: provide a static initializer
  use get_commit_buffer everywhere
  convert logmsg_reencode to get_commit_buffer
  use get_commit_buffer to avoid duplicate code
  use get_cached_commit_buffer where appropriate
  provide helpers to access the commit buffer
  provide a helper to set the commit buffer
  provide a helper to free commit buffer
  sequencer: use logmsg_reencode in get_message
  logmsg_reencode: return const buffer
  do not create "struct commit" with xcalloc
  commit: push commit_index update into alloc_commit_node
  alloc: include any-object allocations in alloc_report
  replace dangerous uses of strbuf_attach
  commit_tree: take a pointer/len pair rather than a const strbuf
</content>
</entry>
<entry>
<title>Merge branch 'jl/status-added-submodule-is-never-ignored' into maint</title>
<updated>2014-06-25T18:50:03Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-06-25T18:50:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=287a8701f6fe263696e9c74a3a2020f4cfbf4239'/>
<id>urn:sha1:287a8701f6fe263696e9c74a3a2020f4cfbf4239</id>
<content type='text'>
"git status" (and "git commit") behaved as if changes in a modified
submodule are not there if submodule.*.ignore configuration is set,
which was misleading.  The configuration is only to unclutter diff
output during the course of development, and should not to hide
changes in the "status" output to cause the users forget to commit
them.

* jl/status-added-submodule-is-never-ignored:
  commit -m: commit staged submodules regardless of ignore config
  status/commit: show staged submodules regardless of ignore config
</content>
</entry>
<entry>
<title>Merge branch 'jk/commit-C-pick-empty' into maint</title>
<updated>2014-06-25T18:46:54Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-06-25T18:46:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b659f8108562f931fcd0ecf900dd4da9ff831ce8'/>
<id>urn:sha1:b659f8108562f931fcd0ecf900dd4da9ff831ce8</id>
<content type='text'>
"git commit --allow-empty-message -C $commit" did not work when the
commit did not have any log message.

* jk/commit-C-pick-empty:
  commit: do not complain of empty messages from -C
</content>
</entry>
<entry>
<title>commit_tree: take a pointer/len pair rather than a const strbuf</title>
<updated>2014-06-12T17:29:41Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-06-10T21:36:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3ffefb54c0515308ceafb6ba071567d9fd379498'/>
<id>urn:sha1:3ffefb54c0515308ceafb6ba071567d9fd379498</id>
<content type='text'>
While strbufs are pretty common throughout our code, it is
more flexible for functions to take a pointer/len pair than
a strbuf. It's easy to turn a strbuf into such a pair (by
dereferencing its members), but less easy to go the other
way (you can strbuf_attach, but that has implications about
memory ownership).

This patch teaches commit_tree (and its associated callers
and sub-functions) to take such a pair for the commit
message rather than a strbuf.  This makes passing the buffer
around slightly more verbose, but means we can get rid of
some dangerous strbuf_attach calls in the next patch.

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: do not complain of empty messages from -C</title>
<updated>2014-04-28T16:58:09Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-04-25T23:11:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=076cbd6341182d296671cb101c75145eb3bfda0a'/>
<id>urn:sha1:076cbd6341182d296671cb101c75145eb3bfda0a</id>
<content type='text'>
When we pick another commit's message, we die() immediately
if we find that it's empty and we are not going to run an
editor (i.e., when running "-C" instead of "-c").  However,
this check is redundant and harmful.

It's redundant because we will already notice the empty
message later, after we would have run the editor, and die
there (just as we would for a regular, not "-C" case, where
the user provided an empty message in the editor).

It's harmful for a few reasons:

  1. It does not respect --allow-empty-message. As a result,
     a "git rebase -i" cannot "pick" such a commit. So you
     cannot even go back in time to fix it with a "reword"
     or "edit" instruction.

  2. It does not take into account other ways besides the
     editor to modify the message. For example, "git commit
     -C empty-commit -m foo" could take the author
     information from empty-commit, but add a message to it.
     There's more to do to make that work correctly (and
     right now we explicitly forbid "-C with -m"), but this
     removes one roadblock.

  3. The existing check is not enough to prevent segfaults.
     We try to find the "\n\n" header/body boundary in the
     commit. If it is at the end of the string (i.e., no
     body), _or_ if we cannot find it at all (i.e., a
     truncated commit object), we consider the message
     empty. With "-C", that's OK; we die in either case. But
     with "-c", we continue on, and in the case of a
     truncated commit may end up dereferencing NULL+2.

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 'jl/nor-or-nand-and'</title>
<updated>2014-04-08T19:00:28Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-04-08T19:00:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d59c12d7ad39f942fc60578ba1e934822f40445b'/>
<id>urn:sha1:d59c12d7ad39f942fc60578ba1e934822f40445b</id>
<content type='text'>
Eradicate mistaken use of "nor" (that is, essentially "nor" used
not in "neither A nor B" ;-)) from in-code comments, command output
strings, and documentations.

* jl/nor-or-nand-and:
  code and test: fix misuses of "nor"
  comments: fix misuses of "nor"
  contrib: fix misuses of "nor"
  Documentation: fix misuses of "nor"
</content>
</entry>
<entry>
<title>Merge branch 'jc/rev-parse-argh-dashed-multi-words'</title>
<updated>2014-04-08T18:59:27Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-04-08T18:59:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b5a52fa6c694c891a259233b29eb0ef4a47db57b'/>
<id>urn:sha1:b5a52fa6c694c891a259233b29eb0ef4a47db57b</id>
<content type='text'>
Make sure that the help text given to describe the "&lt;param&gt;" part
of the "git cmd --option=&lt;param&gt;" does not contain SP or _,
e.g. "--gpg-sign=&lt;key-id&gt;" option for "git commit" is not spelled
as "--gpg-sign=&lt;key id&gt;".

* jc/rev-parse-argh-dashed-multi-words:
  parse-options: make sure argh string does not have SP or _
  update-index: teach --cacheinfo a new syntax "mode,sha1,path"
  parse-options: multi-word argh should use dash to separate words
</content>
</entry>
<entry>
<title>commit -m: commit staged submodules regardless of ignore config</title>
<updated>2014-04-07T17:42:35Z</updated>
<author>
<name>Jens Lehmann</name>
<email>Jens.Lehmann@web.de</email>
</author>
<published>2014-04-05T16:59:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c215d3d2826c882feb819e5743287ec74d9ff693'/>
<id>urn:sha1:c215d3d2826c882feb819e5743287ec74d9ff693</id>
<content type='text'>
The previous commit fixed the problem that the staged but that ignored
submodules did not show up in the status output of the commit command and
weren't committed afterwards either. But when commit doesn't generate the
status output (e.g. when used in a script with '-m') the ignored submodule
will still not be committed. This is because in that case a different code
path is taken which calls index_differs_from() instead of calling the
wt_status functions.

Fix that by calling index_differs_from() from builtin/commit.c with a
diff_options argument value that tells it not ignore any submodule changes
unless the '--ignore-submodules' option is used. Even though this option
isn't yet implemented for cmd_commit() but only for cmd_status() this
prepares cmd_commit() to correctly handle the '--ignore-submodules' option
later. As status and commit share the same ignore_submodule_arg variable
this makes the code more robust against accidental breakage and documents
how to correctly call index_differs_from().

Change the expected result of the test documenting this problem from
failure to success.

Signed-off-by: Jens Lehmann &lt;Jens.Lehmann@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>code and test: fix misuses of "nor"</title>
<updated>2014-03-31T22:29:33Z</updated>
<author>
<name>Justin Lebar</name>
<email>jlebar@google.com</email>
</author>
<published>2014-03-31T22:11:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=235e8d591480d7e1378c27fe65c5529625d4b5be'/>
<id>urn:sha1:235e8d591480d7e1378c27fe65c5529625d4b5be</id>
<content type='text'>
Signed-off-by: Justin Lebar &lt;jlebar@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'bp/commit-p-editor'</title>
<updated>2014-03-28T20:51:11Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-03-28T20:51:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9abf65d23ce8700c290fa4f7d834a10ec5b3e327'/>
<id>urn:sha1:9abf65d23ce8700c290fa4f7d834a10ec5b3e327</id>
<content type='text'>
When it is not necessary to edit a commit log message (e.g. "git
commit -m" is given a message without specifying "-e"), we used to
disable the spawning of the editor by overriding GIT_EDITOR, but
this means all the uses of the editor, other than to edit the
commit log message, are also affected.

* bp/commit-p-editor:
  run-command: mark run_hook_with_custom_index as deprecated
  merge hook tests: fix and update tests
  merge: fix GIT_EDITOR override for commit hook
  commit: fix patch hunk editing with "commit -p -m"
  test patch hunk editing with "commit -p -m"
  merge hook tests: use 'test_must_fail' instead of '!'
  merge hook tests: fix missing '&amp;&amp;' in test
</content>
</entry>
</feed>
