<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/git.git/decorate.c, branch v2.6.1</title>
<subtitle>Git
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v2.6.1</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/atom?h=v2.6.1'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/'/>
<updated>2014-07-07T20:56:24Z</updated>
<entry>
<title>hashmap: factor out getting a hash code from a SHA1</title>
<updated>2014-07-07T20:56:24Z</updated>
<author>
<name>Karsten Blees</name>
<email>karsten.blees@gmail.com</email>
</author>
<published>2014-07-02T22:20:20Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=039dc71a7cb824300e242f8abc0fcb19dac93641'/>
<id>urn:sha1:039dc71a7cb824300e242f8abc0fcb19dac93641</id>
<content type='text'>
Copying the first bytes of a SHA1 is duplicated in six places,
however, the implications (the actual value would depend on the
endianness of the platform) is documented only once.

Add a properly documented API for this.

Signed-off-by: Karsten Blees &lt;blees@dcon.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>decorate.c: compact table when growing</title>
<updated>2013-05-16T18:51:08Z</updated>
<author>
<name>Kevin Bracey</name>
<email>kevin@bracey.fi</email>
</author>
<published>2013-05-16T15:32:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=83f0412f3fff3b4108e7f05c30f3e861d148f5f2'/>
<id>urn:sha1:83f0412f3fff3b4108e7f05c30f3e861d148f5f2</id>
<content type='text'>
When growing the table, take the opportunity to "compact" it by removing
entries with NULL decoration.

Users may have "removed" decorations by passing NULL to
insert_decoration. An object's table entry can't actually be removed
during normal operation, as it would break the linear hash collision
search. But we can remove NULL decoration entries when rebuilding the
table.

Signed-off-by: Kevin Bracey &lt;kevin@bracey.fi&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Unify signedness in hashing calls</title>
<updated>2009-05-20T07:02:24Z</updated>
<author>
<name>Dan McGee</name>
<email>dpmcgee@gmail.com</email>
</author>
<published>2009-05-19T04:34:02Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=91fe2f909154c5cda3b40c68e72c3172a7f137f6'/>
<id>urn:sha1:91fe2f909154c5cda3b40c68e72c3172a7f137f6</id>
<content type='text'>
Our hash_obj and hashtable_index calls and functions were doing a lot of
funny things with signedness. Unify all of it to 'unsigned int'.

Signed-off-by: Dan McGee &lt;dpmcgee@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Fix type-punning issues</title>
<updated>2009-05-17T05:41:18Z</updated>
<author>
<name>Dan McGee</name>
<email>dpmcgee@gmail.com</email>
</author>
<published>2009-05-12T01:17:38Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=b867d324ceb7e5c4f14a04c6b55d69498812d24b'/>
<id>urn:sha1:b867d324ceb7e5c4f14a04c6b55d69498812d24b</id>
<content type='text'>
In these two places we are casting part of our unsigned char sha1 array into
an unsigned int, which violates GCCs strict-aliasing rules (and probably
other compilers).

Signed-off-by: Dan McGee &lt;dpmcgee@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>decorate: allow const objects to be decorated</title>
<updated>2008-08-20T20:30:49Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2008-08-20T17:55:33Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=54988bdad7dc3f09e40752221c144bf470d73aa7'/>
<id>urn:sha1:54988bdad7dc3f09e40752221c144bf470d73aa7</id>
<content type='text'>
We don't actually modify the struct object, so there is no
reason not to accept const versions (and this allows other
callsites, like the next patch, to use the decoration
machinery).

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>fast-export --export-marks: fix off by one error</title>
<updated>2008-07-03T07:34:59Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2008-07-03T07:25:23Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=6991357513bf8bfbb71a4675e271b386cc273476'/>
<id>urn:sha1:6991357513bf8bfbb71a4675e271b386cc273476</id>
<content type='text'>
The export_marks() function iterated over a (potentially sparsely
populated) hashtable, but it accessed it starting from offset 1 and one
element beyond the end.

Noticed by SungHyun Nam.

Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Fix a copy-n-paste bug in the object decorator code.</title>
<updated>2007-04-21T02:16:12Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2007-04-21T01:30:06Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=2a1a3dce3333950d16f78caf34b3bb2ac46ab4d4'/>
<id>urn:sha1:2a1a3dce3333950d16f78caf34b3bb2ac46ab4d4</id>
<content type='text'>
Duh.

When I did the object decorator thing, I made the "loop over the hash"
function use the same logic for updating the hash, ie made them use

	if (++j &gt;= size)
		j = 0;

for both the hash update for both "insert" and "lookup"

HOWEVER.

For some inexplicable reason I had an extraneous

	j++;

in the insert path (probably just from the fact that the old code there
used

	j++;
	if (j &gt;= size)
		j = 0;

and when I made them use the same logic I just didn't remove the old
extraneous line properly.

This fixes it.

Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Junio C Hamano &lt;junkio@cox.net&gt;
</content>
</entry>
<entry>
<title>Add a generic "object decorator" interface, and make object refs use it</title>
<updated>2007-04-16T23:51:09Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2007-04-16T23:03:15Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/git.git/commit/?id=a59b276e18f3d4a548caf549e05188cb1bd3a709'/>
<id>urn:sha1:a59b276e18f3d4a548caf549e05188cb1bd3a709</id>
<content type='text'>
This allows you to add an arbitrary "decoration" of your choice to any
object.  It's a space- and time-efficient way to add information to
arbitrary objects, especially if most objects probably do not have the
decoration.

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