<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/refs.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-10T18:35:41Z</updated>
<entry>
<title>refs: move resolve_ref_unsafe into common code</title>
<updated>2016-04-10T18:35:41Z</updated>
<author>
<name>David Turner</name>
<email>dturner@twopensource.com</email>
</author>
<published>2016-04-07T19:03:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2d0663b21661f2677bce5742204ccdd73745a062'/>
<id>urn:sha1:2d0663b21661f2677bce5742204ccdd73745a062</id>
<content type='text'>
Now that resolve_ref_unsafe's only interaction with the backend is
through read_raw_ref, we can move it into the common code. Later,
we'll replace read_raw_ref with a backend function.

Signed-off-by: David Turner &lt;dturner@twopensource.com&gt;
Reviewed-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs: move for_each_*ref* functions into common code</title>
<updated>2016-04-10T18:34:55Z</updated>
<author>
<name>David Turner</name>
<email>dturner@twopensource.com</email>
</author>
<published>2016-04-07T19:02:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=937705901b83737a35996f62dbfbfefd8e5c8d7f'/>
<id>urn:sha1:937705901b83737a35996f62dbfbfefd8e5c8d7f</id>
<content type='text'>
Make do_for_each_ref take a submodule as an argument instead of a
ref_cache.  Since all for_each_*ref* functions are defined in terms of
do_for_each_ref, we can then move them into the common code.

Later, we can simply make do_for_each_ref into a backend function.

Signed-off-by: David Turner &lt;dturner@twopensource.com&gt;
Reviewed-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>refs: move head_ref{,_submodule} to the common code</title>
<updated>2016-04-10T18:34:41Z</updated>
<author>
<name>David Turner</name>
<email>dturner@twopensource.com</email>
</author>
<published>2016-04-07T19:02:48Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2bf68ed5aa79fcccba6ea4c021b15e51c019a85e'/>
<id>urn:sha1:2bf68ed5aa79fcccba6ea4c021b15e51c019a85e</id>
<content type='text'>
These don't use any backend-specific functions.  These were previously
defined in terms of the do_head_ref helper function, but since they
are otherwise identical, we don't need that function.

Signed-off-by: David Turner &lt;dturner@twopensource.com&gt;
Reviewed-by: Michael Haggerty &lt;mhagger@alum.mit.edu&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>use st_add and st_mult for allocation size computation</title>
<updated>2016-02-22T22:51:09Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-02-22T22:44:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=50a6c8efa2bbeddf46ca34c7765024108202e04b'/>
<id>urn:sha1:50a6c8efa2bbeddf46ca34c7765024108202e04b</id>
<content type='text'>
If our size computation overflows size_t, we may allocate a
much smaller buffer than we expected and overflow it. It's
probably impossible to trigger an overflow in most of these
sites in practice, but it is easy enough convert their
additions and multiplications into overflow-checking
variants. This may be fixing real bugs, and it makes
auditing the code easier.

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>convert trivial cases to FLEX_ARRAY macros</title>
<updated>2016-02-22T22:51:09Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-02-22T22:44:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=96ffc06f72f693d80f05059a1f0e5ca9007d5f1b'/>
<id>urn:sha1:96ffc06f72f693d80f05059a1f0e5ca9007d5f1b</id>
<content type='text'>
Using FLEX_ARRAY macros reduces the amount of manual
computation size we have to do. It also ensures we don't
overflow size_t, and it makes sure we write the same number
of bytes that we allocated.

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>use xmallocz to avoid size arithmetic</title>
<updated>2016-02-22T22:51:09Z</updated>
<author>
<name>Jeff King</name>
<email>peff@peff.net</email>
</author>
<published>2016-02-22T22:44:28Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3733e6946465d4a3a1d89026a5ec911d3af339ab'/>
<id>urn:sha1:3733e6946465d4a3a1d89026a5ec911d3af339ab</id>
<content type='text'>
We frequently allocate strings as xmalloc(len + 1), where
the extra 1 is for the NUL terminator. This can be done more
simply with xmallocz, which also checks for integer
overflow.

There's no case where switching xmalloc(n+1) to xmallocz(n)
is wrong; the result is the same length, and malloc made no
guarantees about what was in the buffer anyway. But in some
cases, we can stop manually placing NUL at the end of the
allocated buffer. But that's only safe if it's clear that
the contents will always fill the buffer.

In each case where this patch does so, I manually examined
the control flow, and I tried to err on the side of caution.

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 'bc/object-id'</title>
<updated>2015-12-10T20:36:13Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-12-10T20:36:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=844a9ce47208de173341525c15a4c8c689dd278e'/>
<id>urn:sha1:844a9ce47208de173341525c15a4c8c689dd278e</id>
<content type='text'>
More transition from "unsigned char[40]" to "struct object_id".

This needed a few merge fixups, but is mostly disentangled from other
topics.

* bc/object-id:
  remote: convert functions to struct object_id
  Remove get_object_hash.
  Convert struct object to object_id
  Add several uses of get_object_hash.
  object: introduce get_object_hash macro.
  ref_newer: convert to use struct object_id
  push_refs_with_export: convert to struct object_id
  get_remote_heads: convert to struct object_id
  parse_fetch: convert to use struct object_id
  add_sought_entry_mem: convert to struct object_id
  Convert struct ref to use object_id.
  sha1_file: introduce has_object_file helper.
</content>
</entry>
<entry>
<title>Merge branch 'dt/refs-backend-pre-vtable'</title>
<updated>2015-12-08T22:14:49Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2015-12-08T22:14:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=b1cda70fff238aa8947dc8b527dc4a5f6bd4ede0'/>
<id>urn:sha1:b1cda70fff238aa8947dc8b527dc4a5f6bd4ede0</id>
<content type='text'>
Code preparation for pluggable ref backends.

* dt/refs-backend-pre-vtable:
  refs: break out ref conflict checks
  files_log_ref_write: new function
  initdb: make safe_create_dir public
  refs: split filesystem-based refs code into a new file
  refs/refs-internal.h: new header file
  refname_is_safe(): improve docstring
  pack_if_possible_fn(): use ref_type() instead of is_per_worktree_ref()
  copy_msg(): rename to copy_reflog_msg()
  verify_refname_available(): new function
  verify_refname_available(): rename function
</content>
</entry>
<entry>
<title>Remove get_object_hash.</title>
<updated>2015-11-20T13:02:05Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2015-11-10T02:22:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ed1c9977cb1b63e4270ad8bdf967a2d02580aa08'/>
<id>urn:sha1:ed1c9977cb1b63e4270ad8bdf967a2d02580aa08</id>
<content type='text'>
Convert all instances of get_object_hash to use an appropriate reference
to the hash member of the oid member of struct object.  This provides no
functional change, as it is essentially a macro substitution.

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Jeff King &lt;peff@peff.net&gt;
</content>
</entry>
<entry>
<title>Add several uses of get_object_hash.</title>
<updated>2015-11-20T13:02:05Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2015-11-10T02:22:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7999b2cf772956466baa8925491d6fb1b0963292'/>
<id>urn:sha1:7999b2cf772956466baa8925491d6fb1b0963292</id>
<content type='text'>
Convert most instances where the sha1 member of struct object is
dereferenced to use get_object_hash.  Most instances that are passed to
functions that have versions taking struct object_id, such as
get_sha1_hex/get_oid_hex, or instances that can be trivially converted
to use struct object_id instead, are not converted.

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Jeff King &lt;peff@peff.net&gt;
</content>
</entry>
</feed>
