<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/refs, branch v2.13.2</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.13.2</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.13.2'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2017-04-26T06:39:13Z</updated>
<entry>
<title>Merge branch 'mh/separate-ref-cache'</title>
<updated>2017-04-26T06:39:13Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-04-26T06:39:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=77b34eaa0777020abb41096106e1c2f19b0a87c5'/>
<id>urn:sha1:77b34eaa0777020abb41096106e1c2f19b0a87c5</id>
<content type='text'>
The internals of the refs API around the cached refs has been
streamlined.

* mh/separate-ref-cache:
  do_for_each_entry_in_dir(): delete function
  files_pack_refs(): use reference iteration
  commit_packed_refs(): use reference iteration
  cache_ref_iterator_begin(): make function smarter
  get_loose_ref_cache(): new function
  get_loose_ref_dir(): function renamed from get_loose_refs()
  do_for_each_entry_in_dir(): eliminate `offset` argument
  refs: handle "refs/bisect/" in `loose_fill_ref_dir()`
  ref-cache: use a callback function to fill the cache
  refs: record the ref_store in ref_cache, not ref_dir
  ref-cache: introduce a new type, ref_cache
  refs: split `ref_cache` code into separate files
  ref-cache: rename `remove_entry()` to `remove_entry_from_dir()`
  ref-cache: rename `find_ref()` to `find_ref_entry()`
  ref-cache: rename `add_ref()` to `add_ref_entry()`
  refs_verify_refname_available(): use function in more places
  refs_verify_refname_available(): implement once for all backends
  refs_ref_iterator_begin(): new function
  refs_read_raw_ref(): new function
  get_ref_dir(): don't call read_loose_refs() for "refs/bisect"
</content>
</entry>
<entry>
<title>Merge branch 'rs/misc-cppcheck-fixes'</title>
<updated>2017-04-24T05:07:56Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2017-04-24T05:07:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f9096db54b29ed17afc6e3393f159ea55142b14c'/>
<id>urn:sha1:f9096db54b29ed17afc6e3393f159ea55142b14c</id>
<content type='text'>
Various small fixes.

* rs/misc-cppcheck-fixes:
  server-info: avoid calling fclose(3) twice in update_info_file()
  files_for_each_reflog_ent_reverse(): close stream and free strbuf on error
  am: close stream on error, but not stdin
</content>
</entry>
<entry>
<title>files_for_each_reflog_ent_reverse(): close stream and free strbuf on error</title>
<updated>2017-04-18T00:37:10Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2017-04-16T16:55:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=be686f03e0f4c4f14f1d4ae9b1b35836168a0a4b'/>
<id>urn:sha1:be686f03e0f4c4f14f1d4ae9b1b35836168a0a4b</id>
<content type='text'>
Exit the loop orderly through the cleanup code, instead of dashing out
with logfp still open and sb leaking.

Found with Cppcheck.

Signed-off-by: Rene Scharfe &lt;l.s.r@web.de&gt;
Reviewed-by: Jeff King &lt;peff@peff.net&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>do_for_each_entry_in_dir(): delete function</title>
<updated>2017-04-17T04:32:46Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2017-04-16T06:41:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f890db83ee426f4bda0458728e813e45cc8531a7'/>
<id>urn:sha1:f890db83ee426f4bda0458728e813e45cc8531a7</id>
<content type='text'>
Its only remaining caller was itself.

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>files_pack_refs(): use reference iteration</title>
<updated>2017-04-17T04:32:46Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2017-04-16T06:41:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=50c2d8555bbc5b29625452fbcc92d4e3395e7366'/>
<id>urn:sha1:50c2d8555bbc5b29625452fbcc92d4e3395e7366</id>
<content type='text'>
Use reference iteration rather than `do_for_each_entry_in_dir()` in
the definition of `files_pack_refs()`. This makes the code shorter and
easier to follow, because the logic can be inline rather than spread
between the main function and a callback function, and it removes the
need to use `pack_refs_cb_data` to preserve intermediate state.

This removes the last callers of `entry_resolves_to_object()` and
`get_loose_ref_dir()`, so delete those functions.

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>commit_packed_refs(): use reference iteration</title>
<updated>2017-04-17T04:32:46Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2017-04-16T06:41:40Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=1710fbafb699a651243ea1af9d21a8b571a66965'/>
<id>urn:sha1:1710fbafb699a651243ea1af9d21a8b571a66965</id>
<content type='text'>
Use reference iteration rather than do_for_each_entry_in_dir() in the
definition of commit_packed_refs().

Note that an internal consistency check that was previously done in
`write_packed_entry_fn()` is not there anymore. This is actually an
improvement:

The old error message was emitted when there is an entry in the
packed-ref cache that is not `REF_KNOWS_PEELED`, and when we attempted
to peel the reference, the result was `PEEL_INVALID`,
`PEEL_IS_SYMREF`, or `PEEL_BROKEN`. Since a packed ref cannot be a
symref, `PEEL_IS_SYMREF` and `PEEL_BROKEN` can be ruled out. So we're
left with `PEEL_INVALID`.

An entry without `REF_KNOWS_PEELED` can get into the packed-refs cache
in the following two ways:

* The reference was read from a `packed-refs` file that didn't have
  the `fully-peeled` attribute. In that case, we *don't want* to emit
  an error, because the broken value is presumably a stale value of
  the reference that is now masked by a loose version of the same
  reference (which we just don't happen to be packing this time). This
  is a perfectly legitimate situation and doesn't indicate that the
  repository is corrupt. The old code incorrectly emits an error
  message in this case. (It was probably never reported as a bug
  because this scenario is rare.)

* The reference was a loose reference that was just added to the
  packed ref cache by `files_packed_refs()` via
  `pack_if_possible_fn()` in preparation for being packed. The latter
  function refuses to pack a reference for which
  `entry_resolves_to_object()` returns false, and otherwise calls
  `peel_entry()` itself and checks the return value. So an entry added
  this way should always have `REF_KNOWS_PEELED` and shouldn't trigger
  the error message in either the old code or the new.

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>cache_ref_iterator_begin(): make function smarter</title>
<updated>2017-04-17T04:32:46Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2017-04-16T06:41:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=059ae35a4871428f49500a22fd0b3eb6e1b424c3'/>
<id>urn:sha1:059ae35a4871428f49500a22fd0b3eb6e1b424c3</id>
<content type='text'>
Change `cache_ref_iterator_begin()` to take two new arguments:

* `prefix` -- to iterate only over references with the specified
  prefix.

* `prime_dir` -- to "prime" (i.e., pre-load) the cache before starting
  the iteration.

The new functionality makes it possible for
`files_ref_iterator_begin()` to be made more ignorant of the internals
of `ref_cache`, and `find_containing_dir()` and `prime_ref_dir()` to
be made private.

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_loose_ref_cache(): new function</title>
<updated>2017-04-17T04:32:46Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2017-04-16T06:41:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a714b19ca81607e53ddbde41eb9082b435148e73'/>
<id>urn:sha1:a714b19ca81607e53ddbde41eb9082b435148e73</id>
<content type='text'>
Extract a new function, `get_loose_ref_cache()`, from
get_loose_ref_dir(). The function returns the `ref_cache` for the
loose refs of a `files_ref_store`.

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_loose_ref_dir(): function renamed from get_loose_refs()</title>
<updated>2017-04-17T04:32:46Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2017-04-16T06:41:37Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=86f423584bd2332580de8baa19d6b661bb3d330c'/>
<id>urn:sha1:86f423584bd2332580de8baa19d6b661bb3d330c</id>
<content type='text'>
The new name is more analogous to `get_packed_ref_dir()`.

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>do_for_each_entry_in_dir(): eliminate `offset` argument</title>
<updated>2017-04-17T04:32:46Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2017-04-16T06:41:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5c7bba77b261f0b5979bacf3cb2516baf211d6f5'/>
<id>urn:sha1:5c7bba77b261f0b5979bacf3cb2516baf211d6f5</id>
<content type='text'>
It was never used.

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>
