<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/hex.c, branch v2.6.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.6.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.6.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2015-03-14T05:43:11Z</updated>
<entry>
<title>define utility functions for object IDs</title>
<updated>2015-03-14T05:43:11Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2015-03-13T23:39:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=aa1c6fdf478c023180e5ca5f1658b00a72592dc6'/>
<id>urn:sha1:aa1c6fdf478c023180e5ca5f1658b00a72592dc6</id>
<content type='text'>
There are several utility functions (hashcmp and friends) that are used
for comparing object IDs (SHA-1 values).  Using these functions, which
take pointers to unsigned char, with struct object_id requires tiresome
access to the sha1 member, which bloats code and violates the desired
encapsulation.  Provide wrappers around these functions for struct
object_id for neater, more maintainable code.  Use the new constants to
avoid the hard-coded 20s and 40s throughout the original functions.

These functions simply call the underlying pointer-to-unsigned-char
versions to ensure that any performance improvements will be passed
through to the new functions.

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>Merge branch 'sb/hex-object-name-is-at-most-41-bytes-long' into maint</title>
<updated>2015-03-05T21:12:55Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-03-05T21:12:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=552f6994d2650f5940b98ff52679ee63959027f9'/>
<id>urn:sha1:552f6994d2650f5940b98ff52679ee63959027f9</id>
<content type='text'>
Code clean-up.

* sb/hex-object-name-is-at-most-41-bytes-long:
  hex.c: reduce memory footprint of sha1_to_hex static buffers
</content>
</entry>
<entry>
<title>hex.c: reduce memory footprint of sha1_to_hex static buffers</title>
<updated>2015-02-13T21:42:17Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2015-02-13T21:18:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0b868f0eecf4a5b4f25b5876e731f0b5456edc89'/>
<id>urn:sha1:0b868f0eecf4a5b4f25b5876e731f0b5456edc89</id>
<content type='text'>
41 bytes is the exact number of bytes needed for having the returned
hex string represented. 50 seems to be an arbitrary number, such
that there are no benefits from alignment to certain address boundaries.

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>get_sha1_hex(): do not read past a NUL character</title>
<updated>2011-10-05T20:45:16Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2011-09-23T13:38:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d4e85a1afe0a3310a3c8336c2824775901cc27d7'/>
<id>urn:sha1:d4e85a1afe0a3310a3c8336c2824775901cc27d7</id>
<content type='text'>
Previously, get_sha1_hex() would read one character past the end of a
null-terminated string whose strlen was an even number less than 40.
Although the function correctly returned -1 in these cases, the extra
memory access might have been to uninitialized (or even, conceivably,
unallocated) memory.

Add a check to avoid reading past the end of a string.

This problem was discovered by Thomas Rast &lt;trast@student.ethz.ch&gt;
using valgrind.

Signed-off-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>slim down "git show-index"</title>
<updated>2010-01-22T04:03:45Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2010-01-21T23:25:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a5031214c4fe5f5d3fcf649d10769744cbc66fed'/>
<id>urn:sha1:a5031214c4fe5f5d3fcf649d10769744cbc66fed</id>
<content type='text'>
As the documentation says, this is primarily for debugging, and
in the longer term we should rename it to test-show-index or something.

In the meantime, just avoid xmalloc (which slurps in the rest of git), and
separating out the trivial hex functions into "hex.o".

This results in

  [torvalds@nehalem git]$ size git-show-index
       text    data     bss     dec     hex filename
     222818    2276  112688  337782   52776 git-show-index (before)
       5696     624    1264    7584    1da0 git-show-index (after)

which is a whole lot better.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
