<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/notes.c, branch v2.24.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.24.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.24.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2019-09-30T04:19:25Z</updated>
<entry>
<title>Merge branch 'mh/notes-duplicate-entries'</title>
<updated>2019-09-30T04:19:25Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-09-30T04:19:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=74a39b9bcc9086cf4405aa532bb6e02e3436d5e4'/>
<id>urn:sha1:74a39b9bcc9086cf4405aa532bb6e02e3436d5e4</id>
<content type='text'>
A few implementation fixes in the notes API.

* mh/notes-duplicate-entries:
  notes: avoid potential use-after-free during insertion
  notes: avoid leaking duplicate entries
</content>
</entry>
<entry>
<title>notes: avoid potential use-after-free during insertion</title>
<updated>2019-08-26T17:29:56Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2019-08-25T07:19:51Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=60fe477a0be2a3801e5ce3913e0be8e8e2e58e4f'/>
<id>urn:sha1:60fe477a0be2a3801e5ce3913e0be8e8e2e58e4f</id>
<content type='text'>
The note_tree_insert() function may free the leaf_node struct we pass in
(e.g., if it's a duplicate, or if it needs to be combined with an
existing note).

Most callers are happy with this, as they assume that ownership of the
struct is handed off. But in load_subtree(), if we see an error we'll
use the handed-off struct's key_oid to generate the die() message,
potentially accessing freed memory.

We can easily fix this by instead using the original oid that we copied
into the leaf_node struct.

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>notes: avoid leaking duplicate entries</title>
<updated>2019-08-26T17:29:38Z</updated>
<author>
<name>Mike Hommey</name>
<email>mh@glandium.org</email>
</author>
<published>2019-08-25T05:18:18Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=779ad6641b9a6443eaec75439b3374b1a7b8794c'/>
<id>urn:sha1:779ad6641b9a6443eaec75439b3374b1a7b8794c</id>
<content type='text'>
When add_note is called multiple times with the same key/value pair, the
leaf_node it creates is leaked by notes_tree_insert.

Signed-off-by: Mike Hommey &lt;mh@glandium.org&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>tree-walk.c: remove the_repo from get_tree_entry()</title>
<updated>2019-06-27T19:45:17Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2019-06-27T09:28:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=50ddb089ff68dfe1e3d9bd9a108d9015c176f761'/>
<id>urn:sha1:50ddb089ff68dfe1e3d9bd9a108d9015c176f761</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>tree-walk.c: remove the_repo from fill_tree_descriptor()</title>
<updated>2019-06-27T19:45:17Z</updated>
<author>
<name>Nguyễn Thái Ngọc Duy</name>
<email>pclouds@gmail.com</email>
</author>
<published>2019-06-27T09:28:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5e575807337d15dbecf88767e709df08304e3b94'/>
<id>urn:sha1:5e575807337d15dbecf88767e709df08304e3b94</id>
<content type='text'>
While at there, clean up the_repo usage in builtin/merge-tree.c a tiny
bit.

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>Merge branch 'en/merge-directory-renames'</title>
<updated>2019-05-08T15:37:22Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2019-05-08T15:37:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=96379f043f4d49de265c73430e74b8b6c7686e1c'/>
<id>urn:sha1:96379f043f4d49de265c73430e74b8b6c7686e1c</id>
<content type='text'>
"git merge-recursive" backend recently learned a new heuristics to
infer file movement based on how other files in the same directory
moved.  As this is inherently less robust heuristics than the one
based on the content similarity of the file itself (rather than
based on what its neighbours are doing), it sometimes gives an
outcome unexpected by the end users.  This has been toned down to
leave the renamed paths in higher/conflicted stages in the index so
that the user can examine and confirm the result.

* en/merge-directory-renames:
  merge-recursive: switch directory rename detection default
  merge-recursive: give callers of handle_content_merge() access to contents
  merge-recursive: track information associated with directory renames
  t6043: fix copied test description to match its purpose
  merge-recursive: switch from (oid,mode) pairs to a diff_filespec
  merge-recursive: cleanup handle_rename_* function signatures
  merge-recursive: track branch where rename occurred in rename struct
  merge-recursive: remove ren[12]_other fields from rename_conflict_info
  merge-recursive: shrink rename_conflict_info
  merge-recursive: move some struct declarations together
  merge-recursive: use 'ci' for rename_conflict_info variable name
  merge-recursive: rename locals 'o' and 'a' to 'obuf' and 'abuf'
  merge-recursive: rename diff_filespec 'one' to 'o'
  merge-recursive: rename merge_options argument from 'o' to 'opt'
  Use 'unsigned short' for mode, like diff_filespec does
</content>
</entry>
<entry>
<title>Use 'unsigned short' for mode, like diff_filespec does</title>
<updated>2019-04-08T07:02:07Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2019-04-05T15:00:12Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5ec1e72823735b5682389589b6bee774ae70fa49'/>
<id>urn:sha1:5ec1e72823735b5682389589b6bee774ae70fa49</id>
<content type='text'>
struct diff_filespec defines mode to be an 'unsigned short'.  Several
other places in the API which we'd like to interact with using a
diff_filespec used a plain unsigned (or unsigned int).  This caused
problems when taking addresses, so switch to unsigned short.

Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>notes: replace sha1_to_hex</title>
<updated>2019-04-01T02:57:38Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2019-02-19T00:05:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0dbc6462ee8853da1ecca7b50cd0c0c9bc62e25b'/>
<id>urn:sha1:0dbc6462ee8853da1ecca7b50cd0c0c9bc62e25b</id>
<content type='text'>
Replace the uses of sha1_to_hex in this function with hash_to_hex to
allow the use of SHA-256 as well.  Rename some variables since this code
is no longer limited to SHA-1.

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>notes: make hash size independent</title>
<updated>2019-04-01T02:57:38Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2019-02-19T00:05:01Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=dd43745131ca20f728746c37ffbbf1f8946052d1'/>
<id>urn:sha1:dd43745131ca20f728746c37ffbbf1f8946052d1</id>
<content type='text'>
Switch out various uses of the GIT_SHA1_* constants with GIT_MAX_*
constants for allocations and the_hash_algo for general parsing.  Update
a comment to no longer be SHA-1 specific.

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>tree-walk: store object_id in a separate member</title>
<updated>2019-01-15T17:57:41Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2019-01-15T00:39:44Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ea82b2a0857e3e0449bdce4e3987dee6adbc51ae'/>
<id>urn:sha1:ea82b2a0857e3e0449bdce4e3987dee6adbc51ae</id>
<content type='text'>
When parsing a tree, we read the object ID directly out of the tree
buffer. This is normally fine, but such an object ID cannot be used with
oidcpy, which copies GIT_MAX_RAWSZ bytes, because if we are using SHA-1,
there may not be that many bytes to copy.

Instead, store the object ID in a separate struct member. Since we can
no longer efficiently compute the path length, store that information as
well in struct name_entry. Ensure we only copy the object ID into the
new buffer if the path length is nonzero, as some callers will pass us
an empty path with no object ID following it, and we will not want to
read past the end of the buffer.

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
