<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/sha1-array.h, branch v2.16.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.16.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.16.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-03-31T15:33:56Z</updated>
<entry>
<title>Rename sha1_array to oid_array</title>
<updated>2017-03-31T15:33:56Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2017-03-31T01:40:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=910650d2f8755359ab7b1f0e2a2d576c06a68091'/>
<id>urn:sha1:910650d2f8755359ab7b1f0e2a2d576c06a68091</id>
<content type='text'>
Since this structure handles an array of object IDs, rename it to struct
oid_array.  Also rename the accessor functions and the initialization
constant.

This commit was produced mechanically by providing non-Documentation
files to the following Perl one-liners:

    perl -pi -E 's/struct sha1_array/struct oid_array/g'
    perl -pi -E 's/\bsha1_array_/oid_array_/g'
    perl -pi -E 's/SHA1_ARRAY_INIT/OID_ARRAY_INIT/g'

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>Convert sha1_array_for_each_unique and for_each_abbrev to object_id</title>
<updated>2017-03-31T15:33:55Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2017-03-31T01:39:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1b7ba794d21836f72e5888db63ab790077c04e1b'/>
<id>urn:sha1:1b7ba794d21836f72e5888db63ab790077c04e1b</id>
<content type='text'>
Make sha1_array_for_each_unique take a callback using struct object_id.
Since one of these callbacks is an argument to for_each_abbrev, convert
those as well.  Rename various functions, replacing "sha1" with "oid".

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>Convert sha1_array_lookup to take struct object_id</title>
<updated>2017-03-31T15:33:55Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2017-03-31T01:39:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5d3206d5010423b3bbf479e32567d0fddc7095e0'/>
<id>urn:sha1:5d3206d5010423b3bbf479e32567d0fddc7095e0</id>
<content type='text'>
Convert this function by changing the declaration and definition and
applying the following semantic patch to update the callers:

@@
expression E1, E2;
@@
- sha1_array_lookup(E1, E2.hash)
+ sha1_array_lookup(E1, &amp;E2)

@@
expression E1, E2;
@@
- sha1_array_lookup(E1, E2-&gt;hash)
+ sha1_array_lookup(E1, E2)

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>Make sha1_array_append take a struct object_id *</title>
<updated>2017-03-31T15:33:55Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2017-03-31T01:39:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=98a72ddc12e13231537150607f4a6a8ff8b43854'/>
<id>urn:sha1:98a72ddc12e13231537150607f4a6a8ff8b43854</id>
<content type='text'>
Convert the callers to pass struct object_id by changing the function
declaration and definition and applying the following semantic patch:

@@
expression E1, E2;
@@
- sha1_array_append(E1, E2.hash)
+ sha1_array_append(E1, &amp;E2)

@@
expression E1, E2;
@@
- sha1_array_append(E1, E2-&gt;hash)
+ sha1_array_append(E1, E2)

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>sha1-array: convert internal storage for struct sha1_array to object_id</title>
<updated>2017-03-28T16:59:34Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2017-03-26T16:01:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ee3051bd2307cdc0145aa9ed9dcacb8acfc08c40'/>
<id>urn:sha1:ee3051bd2307cdc0145aa9ed9dcacb8acfc08c40</id>
<content type='text'>
Make the internal storage for struct sha1_array use an array of struct
object_id internally.  Update the users of this struct which inspect its
internals.

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>sha1_array: let callbacks interrupt iteration</title>
<updated>2016-09-26T18:46:41Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-09-26T12:00:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=16ddcd403bdd74f47f3ae1a7e58a01e36e54a7d7'/>
<id>urn:sha1:16ddcd403bdd74f47f3ae1a7e58a01e36e54a7d7</id>
<content type='text'>
The callbacks for iterating a sha1_array must have a void
return.  This is unlike our usual for_each semantics, where
a callback may interrupt iteration and have its value
propagated. Let's switch it to the usual form, which will
enable its use in more places (e.g., where we are replacing
an existing iteration with a different data structure).

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>sha1-array.c: mark a private file-scope symbol as static</title>
<updated>2012-09-16T05:58:21Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2012-09-16T05:39:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=69850be47d1b629543a2c45e8dd254729c5676af'/>
<id>urn:sha1:69850be47d1b629543a2c45e8dd254729c5676af</id>
<content type='text'>
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>receive-pack: eliminate duplicate .have refs</title>
<updated>2011-05-20T03:02:31Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2011-05-19T21:34:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cff38a5e11217dc997c1ffae8d0856023e05554a'/>
<id>urn:sha1:cff38a5e11217dc997c1ffae8d0856023e05554a</id>
<content type='text'>
When receiving a push, we advertise ref tips from any
alternate repositories, in case that helps the client send a
smaller pack. Since these refs don't actually exist in the
destination repository, we don't transmit the real ref
names, but instead use the pseudo-ref ".have".

If your alternate has a large number of duplicate refs (for
example, because it is aggregating objects from many related
repositories, some of which will have the same tags and
branch tips), then we will send each ".have $sha1" line
multiple times. This is a pointless waste of bandwidth, as
we are simply repeating the same fact to the client over and
over.

This patch eliminates duplicate .have refs early on. It does
so efficiently by sorting the complete list and skipping
duplicates. This has the side effect of re-ordering the
.have lines by ascending sha1; this isn't a problem, though,
as the original order was meaningless.

There is a similar .have system in fetch-pack, but it
does not suffer from the same problem. For each alternate
ref we consider in fetch-pack, we actually open the object
and mark it with the SEEN flag, so duplicates are
automatically culled.

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>bisect: refactor sha1_array into a generic sha1 list</title>
<updated>2011-05-20T03:02:10Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2011-05-19T21:34:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=902bb3645160cae72fe43b5f7f5289968ac01617'/>
<id>urn:sha1:902bb3645160cae72fe43b5f7f5289968ac01617</id>
<content type='text'>
This is a generally useful abstraction, so let's let others
make use of it.  The refactoring is more or less a straight
copy; however, functions and struct members have had their
names changed to match string_list, which is the most
similar data structure.

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