<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/mailmap.c, branch v2.9.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.9.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.9.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2016-05-17T21:38:28Z</updated>
<entry>
<title>Merge branch 'nd/error-errno'</title>
<updated>2016-05-17T21:38:28Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-05-17T21:38:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=40cfc95856594ddd04ae6ef3bfd041346c4854ec'/>
<id>urn:sha1:40cfc95856594ddd04ae6ef3bfd041346c4854ec</id>
<content type='text'>
The code for warning_errno/die_errno has been refactored and a new
error_errno() reporting helper is introduced.

* nd/error-errno: (41 commits)
  wrapper.c: use warning_errno()
  vcs-svn: use error_errno()
  upload-pack.c: use error_errno()
  unpack-trees.c: use error_errno()
  transport-helper.c: use error_errno()
  sha1_file.c: use {error,die,warning}_errno()
  server-info.c: use error_errno()
  sequencer.c: use error_errno()
  run-command.c: use error_errno()
  rerere.c: use error_errno() and warning_errno()
  reachable.c: use error_errno()
  mailmap.c: use error_errno()
  ident.c: use warning_errno()
  http.c: use error_errno() and warning_errno()
  grep.c: use error_errno()
  gpg-interface.c: use error_errno()
  fast-import.c: use error_errno()
  entry.c: use error_errno()
  editor.c: use error_errno()
  diff-no-index.c: use error_errno()
  ...
</content>
</entry>
<entry>
<title>mailmap.c: use error_errno()</title>
<updated>2016-05-09T19:29:08Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2016-05-08T09:47:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=60901e4c220e565518c87b1349108ac7dfec0ba0'/>
<id>urn:sha1:60901e4c220e565518c87b1349108ac7dfec0ba0</id>
<content type='text'>
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>mailmap: do not resolve blobs in a non-repository</title>
<updated>2016-03-07T01:19:11Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-03-05T22:13:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5735dc5a0df5de12b28237ff2c41df6df5f67b81'/>
<id>urn:sha1:5735dc5a0df5de12b28237ff2c41df6df5f67b81</id>
<content type='text'>
The mailmap code may be triggered outside of a repository by
git-shortlog. There is no point in looking up a name like
"HEAD:.mailmap" there; without a repository, we have no
refs.

This is unlikely to matter much in practice for the current
code, as we would simply fail to find the ref. But as the
refs code learns about new backends, this is more important;
without a repository, we do not even know which backend to
look at.

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>mailmap: replace strcpy with xstrdup</title>
<updated>2015-09-25T17:18:18Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-09-24T21:07:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c978610dc841efe300bf4d1ee61b24d78b13c4f4'/>
<id>urn:sha1:c978610dc841efe300bf4d1ee61b24d78b13c4f4</id>
<content type='text'>
We want to make a copy of a string without any leading
whitespace. To do so, we allocate a buffer large enough to
hold the original, skip past the whitespace, then copy that.
It's much simpler to just allocate after we've skipped, in
which case we can just copy the remainder of the string,
leaving no question of whether "len" is large enough.

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>mailmap: use higher level string list functions</title>
<updated>2014-12-04T23:10:21Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2014-11-25T03:44:14Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=63226218ba39e971c8a75d9419a7668b075ad85e'/>
<id>urn:sha1:63226218ba39e971c8a75d9419a7668b075ad85e</id>
<content type='text'>
No functional changes intended. This commit makes use of higher level
and better documented functions of the string list API, so the code is
more understandable.

Note that also the required computational amount should not change
in principal as we need to look up the item no matter if it is already
part of the list or not. Once looked up, insertion comes for free.

Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'jc/strcasecmp-pure-inline'</title>
<updated>2013-09-25T06:28:13Z</updated>
<author>
<name>Jonathan Nieder</name>
<email>jrnieder@gmail.com</email>
</author>
<published>2013-09-25T06:28:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a301889980237b4d1cba9d07e48bdaf67064af83'/>
<id>urn:sha1:a301889980237b4d1cba9d07e48bdaf67064af83</id>
<content type='text'>
* jc/strcasecmp-pure-inline:
  mailmap: work around implementations with pure inline strcasecmp
</content>
</entry>
<entry>
<title>mailmap: work around implementations with pure inline strcasecmp</title>
<updated>2013-09-12T19:05:48Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-09-12T15:37:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=de2f95ebed260b5fb31942d6315994829fb6fc63'/>
<id>urn:sha1:de2f95ebed260b5fb31942d6315994829fb6fc63</id>
<content type='text'>
On some systems (e.g. MinGW 4.0), string.h has only inline
definition of strcasecmp and no non-inline implementation is
supplied anywhere, which is, eh, "unusual".  We cannot take an
address of such a function to store it in namemap.cmp.

Work it around by introducing our own level of indirection.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'sb/mailmap-freeing-NULL-is-ok'</title>
<updated>2013-09-11T22:00:43Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-09-11T22:00:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e5229b6a61fefcacd63d11afd49f0cdafaa60801'/>
<id>urn:sha1:e5229b6a61fefcacd63d11afd49f0cdafaa60801</id>
<content type='text'>
* sb/mailmap-freeing-NULL-is-ok:
  mailmap: remove redundant check for freeing memory
</content>
</entry>
<entry>
<title>Merge branch 'jk/mailmap-incomplete-line'</title>
<updated>2013-09-09T21:50:41Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2013-09-09T21:50:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=af226bf01e99043f5f3d8bc09ad302d17e0de757'/>
<id>urn:sha1:af226bf01e99043f5f3d8bc09ad302d17e0de757</id>
<content type='text'>
* jk/mailmap-incomplete-line:
  mailmap: handle mailmap blobs without trailing newlines
</content>
</entry>
<entry>
<title>mailmap: handle mailmap blobs without trailing newlines</title>
<updated>2013-08-28T19:33:32Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2013-08-28T01:41:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f972a1658a30809db113a3c486b1fe95b56633bf'/>
<id>urn:sha1:f972a1658a30809db113a3c486b1fe95b56633bf</id>
<content type='text'>
The read_mailmap_buf function reads each line of the mailmap
using strchrnul, like:

    const char *end = strchrnul(buf, '\n');
    unsigned long linelen = end - buf + 1;

But that's off-by-one when we actually hit the NUL byte; our
line does not have a terminator, and so is only "end - buf"
bytes long. As a result, when we subtract the linelen from
the total len, we end up with (unsigned long)-1 bytes left
in the buffer, and we start reading random junk from memory.

We could fix it with:

    unsigned long linelen = end - buf + !!*end;

but let's take a step back for a moment. It's questionable
in the first place for a function that takes a buffer and
length to be using strchrnul. But it works because we only
have one caller (and are only likely to ever have this one),
which is handing us data from read_sha1_file. Which means
that it's always NUL-terminated.

Instead of tightening the assumptions to make the
buffer/length pair work for a caller that doesn't actually
exist, let's let loosen the assumptions to what the real
caller has: a modifiable, NUL-terminated string.

This makes the code simpler and shorter (because we don't
have to correlate strchrnul with the length calculation),
correct (because the code with the off-by-one just goes
away), and more efficient (we can drop the extra allocation
we needed to create NUL-terminated strings for each line,
and just terminate in place).

Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
