<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/notes.c, 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-11-09T05:31:27Z</updated>
<entry>
<title>Merge branch 'rs/hex-to-bytes-cleanup'</title>
<updated>2017-11-09T05:31:27Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-11-09T05:31:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bde13700105a1c945819578ce8d5c0627d52c741'/>
<id>urn:sha1:bde13700105a1c945819578ce8d5c0627d52c741</id>
<content type='text'>
Code cleanup.

* rs/hex-to-bytes-cleanup:
  sha1_file: use hex_to_bytes()
  http-push: use hex_to_bytes()
  notes: move hex_to_bytes() to hex.c and export it
</content>
</entry>
<entry>
<title>notes: move hex_to_bytes() to hex.c and export it</title>
<updated>2017-11-01T01:35:35Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2017-10-31T13:46:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0ec218656a02ea48e173262f7b80513feeb7f263'/>
<id>urn:sha1:0ec218656a02ea48e173262f7b80513feeb7f263</id>
<content type='text'>
Make the function for converting pairs of hexadecimal digits to binary
available to other call sites.

Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs: convert read_ref and read_ref_full to object_id</title>
<updated>2017-10-16T02:05:50Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2017-10-15T22:06:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=34c290a6fc8b1f6705d2646d726df2260927da0f'/>
<id>urn:sha1:34c290a6fc8b1f6705d2646d726df2260927da0f</id>
<content type='text'>
All but two of the call sites already have parameters using the hash
parameter of struct object_id, so convert them to take a pointer to the
struct directly.  Also convert refs_read_refs_full, the underlying
implementation.

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 'mh/notes-cleanup'</title>
<updated>2017-09-19T01:47:52Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-09-19T01:47:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=30675f7021f92b0e830fdb3c96370826d8f6723f'/>
<id>urn:sha1:30675f7021f92b0e830fdb3c96370826d8f6723f</id>
<content type='text'>
Code clean-up.

* mh/notes-cleanup:
  load_subtree(): check that `prefix_len` is in the expected range
  load_subtree(): declare some variables to be `size_t`
  hex_to_bytes(): simpler replacement for `get_oid_hex_segment()`
  get_oid_hex_segment(): don't pad the rest of `oid`
  load_subtree(): combine some common code
  get_oid_hex_segment(): return 0 on success
  load_subtree(): only consider blobs to be potential notes
  load_subtree(): check earlier whether an internal node is a tree entry
  load_subtree(): separate logic for internal vs. terminal entries
  load_subtree(): fix incorrect comment
  load_subtree(): reduce the scope of some local variables
  load_subtree(): remove unnecessary conditional
  notes: make GET_NIBBLE macro more robust
</content>
</entry>
<entry>
<title>load_subtree(): check that `prefix_len` is in the expected range</title>
<updated>2017-09-08T18:16:13Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2017-09-08T16:10:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=396428152413f431cac18f68a7190827b4acb3b6'/>
<id>urn:sha1:396428152413f431cac18f68a7190827b4acb3b6</id>
<content type='text'>
This value, which is stashed in the last byte of an object_id hash,
gets handed around a lot. So add a sanity check before using it in
`load_subtree()`.

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>load_subtree(): declare some variables to be `size_t`</title>
<updated>2017-08-26T16:21:01Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2017-08-26T08:28:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=06cfa75675ac605577c9a42154a9042bfd451937'/>
<id>urn:sha1:06cfa75675ac605577c9a42154a9042bfd451937</id>
<content type='text'>
* `prefix_len`
* `path_len`
* `i`

It's good hygiene.

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>hex_to_bytes(): simpler replacement for `get_oid_hex_segment()`</title>
<updated>2017-08-26T16:21:01Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2017-08-26T08:28:11Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=cfdc88f1a34ccb8e59899501b0ede875afac0d83'/>
<id>urn:sha1:cfdc88f1a34ccb8e59899501b0ede875afac0d83</id>
<content type='text'>
Now that `get_oid_hex_segment()` does less, it makes sense to rename
it and simplify its semantics:

* Instead of a `hex_len` parameter, which was the number of hex
  characters (and had to be even), use a `len` parameter, which is the
  number of resulting bytes. This removes then need for the check that
  `hex_len` is even and to divide it by two to determine the number of
  bytes. For good hygiene, declare the `len` parameter to be `size_t`
  instead of `unsigned int`.

* Change the order of the arguments to the more traditional (dst,
  src, len).

* Rename the function to `hex_to_bytes()`.

* Remove a loop variable: just count `len` down instead.

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>get_oid_hex_segment(): don't pad the rest of `oid`</title>
<updated>2017-08-26T16:21:01Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2017-08-26T08:28:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d49852d6f89bfde3cb20b6ca5866f67f6c04a894'/>
<id>urn:sha1:d49852d6f89bfde3cb20b6ca5866f67f6c04a894</id>
<content type='text'>
Remove the feature of `get_oid_hex_segment()` that it pads the rest of
the `oid` argument with zeros. Instead, do this at the caller who
needs it.

This makes the functionality of this function more coherent and
removes the need for its `oid_len` argument.

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>load_subtree(): combine some common code</title>
<updated>2017-08-26T16:21:01Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2017-08-26T08:28:09Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4ebef533d75a197f660b38d615489ad8a233bba1'/>
<id>urn:sha1:4ebef533d75a197f660b38d615489ad8a233bba1</id>
<content type='text'>
Write the length into `object_oid` (before copying) rather than
`l-&gt;key_oid` (after copying). Then combine some code from the two `if`
blocks.

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>get_oid_hex_segment(): return 0 on success</title>
<updated>2017-08-26T16:21:01Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2017-08-26T08:28:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=67c9b422513ac601c68c191a026af968a2838ae1'/>
<id>urn:sha1:67c9b422513ac601c68c191a026af968a2838ae1</id>
<content type='text'>
Nobody cares about the return value of get_oid_hex_segment() except to
check whether it failed. So just return 0 on success.

And while we're updating its docstring, update it for some argument
renaming that happened a while ago.

Signed-off-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
