<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/notes.c, branch v2.9.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.9.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.9.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2016-04-25T21:23:42Z</updated>
<entry>
<title>struct name_entry: use struct object_id instead of unsigned char sha1[20]</title>
<updated>2016-04-25T21:23:42Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2016-04-17T23:10:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7d924c9139e33e7599d7aed0446e634c427a5f15'/>
<id>urn:sha1:7d924c9139e33e7599d7aed0446e634c427a5f15</id>
<content type='text'>
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 'jk/tighten-alloc'</title>
<updated>2016-02-26T21:37:16Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-02-26T21:37:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=11529ecec914d2f0d7575e6d443c2d5a6ff75424'/>
<id>urn:sha1:11529ecec914d2f0d7575e6d443c2d5a6ff75424</id>
<content type='text'>
Update various codepaths to avoid manually-counted malloc().

* jk/tighten-alloc: (22 commits)
  ewah: convert to REALLOC_ARRAY, etc
  convert ewah/bitmap code to use xmalloc
  diff_populate_gitlink: use a strbuf
  transport_anonymize_url: use xstrfmt
  git-compat-util: drop mempcpy compat code
  sequencer: simplify memory allocation of get_message
  test-path-utils: fix normalize_path_copy output buffer size
  fetch-pack: simplify add_sought_entry
  fast-import: simplify allocation in start_packfile
  write_untracked_extension: use FLEX_ALLOC helper
  prepare_{git,shell}_cmd: use argv_array
  use st_add and st_mult for allocation size computation
  convert trivial cases to FLEX_ARRAY macros
  use xmallocz to avoid size arithmetic
  convert trivial cases to ALLOC_ARRAY
  convert manual allocations to argv_array
  argv-array: add detach function
  add helpers for allocating flex-array structs
  harden REALLOC_ARRAY and xcalloc against size_t overflow
  tree-diff: catch integer overflow in combine_diff_path allocation
  ...
</content>
</entry>
<entry>
<title>convert trivial cases to ALLOC_ARRAY</title>
<updated>2016-02-22T22:51:09Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-02-22T22:44:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b32fa95fd8293ebfecb2b7b6c8d460579318f9fe'/>
<id>urn:sha1:b32fa95fd8293ebfecb2b7b6c8d460579318f9fe</id>
<content type='text'>
Each of these cases can be converted to use ALLOC_ARRAY or
REALLOC_ARRAY, which has two advantages:

  1. It automatically checks the array-size multiplication
     for overflow.

  2. It always uses sizeof(*array) for the element-size,
     so that it can never go out of sync with the declared
     type of the array.

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>Merge branch 'jk/notes-merge-from-anywhere'</title>
<updated>2016-02-03T22:15:59Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2016-02-03T22:15:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1cb3ed308dcfaa6084b8aed075c772aeb9e57243'/>
<id>urn:sha1:1cb3ed308dcfaa6084b8aed075c772aeb9e57243</id>
<content type='text'>
"git notes merge" used to limit the source of the merged notes tree
to somewhere under refs/notes/ hierarchy, which was too limiting
when inventing a workflow to exchange notes with remote
repositories using remote-tracking notes trees (located in e.g.
refs/remote-notes/ or somesuch).

* jk/notes-merge-from-anywhere:
  notes: allow merging from arbitrary references
</content>
</entry>
<entry>
<title>notes: allow merging from arbitrary references</title>
<updated>2016-01-17T21:59:01Z</updated>
<author>
<name>Jacob Keller</name>
<email>jacob.keller@gmail.com</email>
</author>
<published>2015-12-29T22:40:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b3715b75226668e26f1f2abe7e2f93cdbbf6e2f5'/>
<id>urn:sha1:b3715b75226668e26f1f2abe7e2f93cdbbf6e2f5</id>
<content type='text'>
Create a new expansion function, expand_loose_notes_ref which will first
check whether the ref can be found using get_sha1. If it can't be found
then it will fallback to using expand_notes_ref. The content of the
strbuf will not be changed if the notes ref can be located using
get_sha1. Otherwise, it may be updated as done by expand_notes_ref.

Since we now support merging from non-notes refs, remove the test case
associated with that behavior. Add a test case for merging from a
non-notes ref.

Signed-off-by: Jacob Keller &lt;jacob.keller@gmail.com&gt;
Reviewed-by: Johan Herland &lt;johan@herland.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>notes: allow treeish expressions as notes ref</title>
<updated>2016-01-12T23:10:01Z</updated>
<author>
<name>Mike Hommey</name>
<email>mh@glandium.org</email>
</author>
<published>2015-10-08T02:54:43Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ee76f92fe883305c1260952f5b325b0503311fc9'/>
<id>urn:sha1:ee76f92fe883305c1260952f5b325b0503311fc9</id>
<content type='text'>
init_notes() is the main point of entry to the notes API. It ensures
that the input can be used as ref, because it needs a ref to update to
store notes tree after modifying it.

There however are many use cases where notes tree is only read, e.g.
"git log --notes=...".  Any notes-shaped treeish could be used for such
purpose, but it is not allowed due to existing restriction.

Allow treeish expressions to be used in the case the notes tree is going
to be used without write "permissions".  Add a flag to distinguish
whether the notes tree is intended to be used read-only, or will be
updated.

With this change, operations that use notes read-only can be fed any
notes-shaped tree-ish can be used, e.g. git log --notes=notes@{1}.

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>notes: document length of fanout path with a constant</title>
<updated>2015-10-05T18:08:05Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-09-24T21:08:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=02e32b7debbcbe5910c11a515801751b349577d7'/>
<id>urn:sha1:02e32b7debbcbe5910c11a515801751b349577d7</id>
<content type='text'>
We know that a fanned-out sha1 in a notes tree cannot be
more than "aa/bb/cc/...", and we have an assert() to confirm
that. But let's factor out that length into a constant so we
can be sure it is used consistently. And even though we
assert() earlier, let's replace a strcpy with xsnprintf, so
it is clear to a reader that all cases are covered.

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>Sync with 2.4.9</title>
<updated>2015-09-04T17:43:23Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-09-04T17:43:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3d3caf0b78106c390fc5daceb95ee968312765dd'/>
<id>urn:sha1:3d3caf0b78106c390fc5daceb95ee968312765dd</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Sync with 2.2.3</title>
<updated>2015-09-04T17:29:28Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-09-04T17:29:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8267cd11d677f1a5f8441ac2880f5e9d48dba60b'/>
<id>urn:sha1:8267cd11d677f1a5f8441ac2880f5e9d48dba60b</id>
<content type='text'>
</content>
</entry>
<entry>
<title>notes: use a strbuf in add_non_note</title>
<updated>2015-09-04T16:36:28Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2015-08-19T18:12:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c29edfefb6f6a3fef80172c16bcc34c826d417b0'/>
<id>urn:sha1:c29edfefb6f6a3fef80172c16bcc34c826d417b0</id>
<content type='text'>
When we are loading a notes tree into our internal hash
table, we also collect any files that are clearly non-notes.
We format the name of the file into a PATH_MAX buffer, but
unlike true notes (which cannot be larger than a fanned-out
sha1 hash), these tree entries can be arbitrarily long,
overflowing our buffer.

We can fix this by switching to a strbuf. It doesn't even
cost us an extra allocation, as we can simply hand ownership
of the buffer over to the non-note struct.

This is of moderate security interest, as you might fetch
notes trees from an untrusted remote. However, we do not do
so by default, so you would have to manually fetch into the
notes namespace.

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