<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/commit.h, branch v2.2.2</title>
<subtitle>Fork of git SCM with my patches.</subtitle>
<id>http://git.kilabit.info/git/atom?h=v2.2.2</id>
<link rel='self' href='http://git.kilabit.info/git/atom?h=v2.2.2'/>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/'/>
<updated>2014-09-19T18:38:35Z</updated>
<entry>
<title>Merge branch 'da/styles'</title>
<updated>2014-09-19T18:38:35Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-09-19T18:38:35Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=83510ef3fda0df6acd6680410698a1762042a8af'/>
<id>urn:sha1:83510ef3fda0df6acd6680410698a1762042a8af</id>
<content type='text'>
* da/styles:
  stylefix: asterisks stick to the variable, not the type
</content>
</entry>
<entry>
<title>Merge branch 'jk/commit-author-parsing'</title>
<updated>2014-09-19T18:38:33Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-09-19T18:38:33Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=9ff700ebacffc8fb8cf80daabfb6503cb24dca0b'/>
<id>urn:sha1:9ff700ebacffc8fb8cf80daabfb6503cb24dca0b</id>
<content type='text'>
Code clean-up.

* jk/commit-author-parsing:
  determine_author_info(): copy getenv output
  determine_author_info(): reuse parsing functions
  date: use strbufs in date-formatting functions
  record_author_date(): use find_commit_header()
  record_author_date(): fix memory leak on malformed commit
  commit: provide a function to find a header in a buffer
</content>
</entry>
<entry>
<title>Merge branch 'jk/name-decoration-alloc'</title>
<updated>2014-09-11T17:33:36Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-09-11T17:33:36Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=1ebe6a825a1ff12e12905e28265aa30e269700d6'/>
<id>urn:sha1:1ebe6a825a1ff12e12905e28265aa30e269700d6</id>
<content type='text'>
The API to allocate the structure to keep track of commit
decoration was cumbersome to use, inviting lazy code to
overallocate memory.

* jk/name-decoration-alloc:
  log-tree: use FLEX_ARRAY in name_decoration
  log-tree: make name_decoration hash static
  log-tree: make add_name_decoration a public function
</content>
</entry>
<entry>
<title>stylefix: asterisks stick to the variable, not the type</title>
<updated>2014-09-02T18:33:32Z</updated>
<author>
<name>David Aguilar</name>
<email>davvid@gmail.com</email>
</author>
<published>2014-08-31T20:11:31Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=24d36f1472794ba95ddc81ba8afb45fe30d1f35c'/>
<id>urn:sha1:24d36f1472794ba95ddc81ba8afb45fe30d1f35c</id>
<content type='text'>
Signed-off-by: David Aguilar &lt;davvid@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>commit: provide a function to find a header in a buffer</title>
<updated>2014-08-27T17:25:28Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-08-27T07:56:01Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=fe6eb7f2c506190c817407accf27834005a57f2b'/>
<id>urn:sha1:fe6eb7f2c506190c817407accf27834005a57f2b</id>
<content type='text'>
Usually when we parse a commit, we read it line by line and
handle each individual line (e.g., parse_commit and
parse_commit_header).  Sometimes, however, we only care
about extracting a single header. Code in this situation is
stuck doing an ad-hoc parse of the commit buffer.

Let's provide a reusable function to locate a header within
the commit.  The code is modeled after pretty.c's
get_header, which is used to extract the encoding.

Since some callers may not have the "struct commit" to go
along with the buffer, we drop that parameter.  The only
thing lost is a warning for truncated commits, but that's
OK.  This shouldn't happen in practice, and even if it does,
there's no particular reason that this function needs to
complain about it. It either finds the header it was asked
for, or it doesn't (and in the latter case, the caller will
typically complain).

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>log-tree: use FLEX_ARRAY in name_decoration</title>
<updated>2014-08-27T14:44:27Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-08-26T10:24:20Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=2e3dfb216991974b60fdb1933eb3331e03383e61'/>
<id>urn:sha1:2e3dfb216991974b60fdb1933eb3331e03383e61</id>
<content type='text'>
We are already using the flex-array technique; let's
annotate it with our usual FLEX_ARRAY macro. Besides being
more readable, this is slightly more efficient on compilers
that understand flex-arrays.

Note that we need to bump the allocation in add_name_decoration,
which did not explicitly add one byte for the NUL terminator
of the string we are putting into the flex-array (it did not
need to before, because the struct itself was over-allocated
by one byte).

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>log-tree: make name_decoration hash static</title>
<updated>2014-08-26T17:34:26Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-08-26T10:23:54Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=2608c24940c80bf379937e4cefee75e2db79e008'/>
<id>urn:sha1:2608c24940c80bf379937e4cefee75e2db79e008</id>
<content type='text'>
In the previous commit, we made add_name_decoration global
so that adders would not have to access the hash directly.
We now make the hash itself static so that callers _have_ to
add through our function, making sure that all additions go
through a single point.  To do this, we have to add one more
accessor function: a way to lookup entries in the hash.

Since the only caller doesn't actually look at the returned
value, but rather only asks whether there is a decoration or
not, we could provide only a boolean "has_name_decoration".
That would allow us to make "struct name_decoration" local
to log-tree, as well.

However, it's unlikely to cause any maintainability harm
making the actual data public, and this interface is more
flexible if we need to look at decorations from other parts
of the code in the future.

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>log-tree: make add_name_decoration a public function</title>
<updated>2014-08-26T17:33:01Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-08-26T10:23:36Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=662174d299a2221016a8756d35d485b576ebcec2'/>
<id>urn:sha1:662174d299a2221016a8756d35d485b576ebcec2</id>
<content type='text'>
The log-tree code keeps a "struct decoration" hash to show
text decorations for each commit during log traversals. It
makes this available to other files by providing global
access to the hash. This can result in other code adding
entries that do not conform to what log-tree expects.

For example, the bisect code adds its own "dist"
decorations to be shown. Originally the bisect code was
correct, but when the name_decoration code grew a new field
in eb3005e (commit.h: add 'type' to struct name_decoration,
2010-06-19), the bisect code was not updated. As a result,
the log-tree code can access uninitialized memory and even
segfault.

We can fix this by making name_decoration's adding function
public. If all callers use it, then any changes to struct
initialization only need to happen in one place (and because
the members come in as parameters, the compiler can notice a
caller who does not supply enough information).

As a bonus, this also means that the decoration hashes
created by the bisect code will use less memory (previously
we over-allocated space for the distance integer, but now we
format it into a temporary buffer and copy it to the final
flex-array).

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>pretty: make empty userformats truly empty</title>
<updated>2014-07-30T19:30:08Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2014-07-29T17:56:48Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=b9c7d6e4330e3dcdb3b3e5f013e5667e47555c95'/>
<id>urn:sha1:b9c7d6e4330e3dcdb3b3e5f013e5667e47555c95</id>
<content type='text'>
If the user provides an empty format with "--format=", we
end up putting in extra whitespace that the user cannot
prevent. This comes from two places:

  1. If the format is missing a terminating newline, we add
     one automatically. This makes sense for --format=%h, but
     not for a truly empty format.

  2. We add an extra newline between the pretty-printed
     format and a diff or diffstat. If the format is empty,
     there's no point in doing so if there's nothing to
     separate.

With this patch, one can get a diff with no other cruft out
of "diff-tree --format= $commit".

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 'cc/replace-graft'</title>
<updated>2014-07-27T22:14:18Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-07-27T22:14:18Z</published>
<link rel='alternate' type='text/html' href='http://git.kilabit.info/git/commit/?id=16737445a94cb9b18378fff973129d974c7cdf8a'/>
<id>urn:sha1:16737445a94cb9b18378fff973129d974c7cdf8a</id>
<content type='text'>
"git replace" learned a "--graft" option to rewrite parents of a
commit.

* cc/replace-graft:
  replace: add test for --graft with a mergetag
  replace: check mergetags when using --graft
  replace: add test for --graft with signed commit
  replace: remove signature when using --graft
  contrib: add convert-grafts-to-replace-refs.sh
  Documentation: replace: add --graft option
  replace: add test for --graft
  replace: add --graft option
  replace: cleanup redirection style in tests
</content>
</entry>
</feed>
