<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/refs/ref-cache.h, 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-09-25T09:02:46Z</updated>
<entry>
<title>ref_cache: remove support for storing peeled values</title>
<updated>2017-09-25T09:02:46Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2017-09-25T08:00:16Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a6e19bcdadf782079cf88609b928519c2dee3378'/>
<id>urn:sha1:a6e19bcdadf782079cf88609b928519c2dee3378</id>
<content type='text'>
Now that the `packed-refs` backend doesn't use `ref_cache`, there is
nobody left who might want to store peeled values of references in
`ref_cache`. So remove that feature.

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>ref_iterator: keep track of whether the iterator output is ordered</title>
<updated>2017-09-14T06:19:07Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2017-09-13T17:15:55Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=8738a8a4df9ee50112b5f5a757c58988166974d3'/>
<id>urn:sha1:8738a8a4df9ee50112b5f5a757c58988166974d3</id>
<content type='text'>
References are iterated over in order by refname, but reflogs are not.
Some consumers of reference iteration care about the difference. Teach
each `ref_iterator` to keep track of whether its output is ordered.

`overlay_ref_iterator` is one of the picky consumers. Add a sanity
check in `overlay_ref_iterator_begin()` to verify that its inputs are
ordered.

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>create_ref_entry(): remove `check_name` option</title>
<updated>2017-05-23T05:29:56Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2017-05-22T14:17:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c1da06c6f1a77370341d93d80af027caa6a19a94'/>
<id>urn:sha1:c1da06c6f1a77370341d93d80af027caa6a19a94</id>
<content type='text'>
Only one caller was using it, so move the check to that caller.

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>read_packed_refs(): do more of the work of reading packed refs</title>
<updated>2017-05-23T05:29:55Z</updated>
<author>
<name>Michael Haggerty</name>
<email>mhagger@alum.mit.edu</email>
</author>
<published>2017-05-22T14:17:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=099a912a279415dd27716ee5de07ff347bfc49da'/>
<id>urn:sha1:099a912a279415dd27716ee5de07ff347bfc49da</id>
<content type='text'>
Teach `read_packed_refs()` to also

* Allocate and initialize the new `packed_ref_cache`
* Open and close the `packed-refs` file
* Update the `validity` field of the new object

This decreases the coupling between `packed_refs_cache` and
`files_ref_store` by a little bit.

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>refs/files-backend: convert many internals to struct object_id</title>
<updated>2017-05-08T06:12:58Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2017-05-06T22:10:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4417df8c492489613d031478ba2e3604f65a5f84'/>
<id>urn:sha1:4417df8c492489613d031478ba2e3604f65a5f84</id>
<content type='text'>
Convert many of the internals of the files backend to use struct
object_id.  Avoid converting public APIs (except one change to
refs/ref-cache.c) to limit the scope of the changes.

Convert one use of get_sha1_hex to parse_oid_hex, and rely on the fact
that a strbuf will be NUL-terminated and that parse_oid_hex will fail on
truncated input to avoid the need to check the length.

This is a requirement to convert parse_object later on.

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>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>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>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>
<entry>
<title>ref-cache: use a callback function to fill the cache</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:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=df30875987329bb46e54ec7be0eb29c33702de3a'/>
<id>urn:sha1:df30875987329bb46e54ec7be0eb29c33702de3a</id>
<content type='text'>
It is a leveling violation for `ref_cache` to know about
`files_ref_store` or that it should call `read_loose_refs()` to lazily
fill cache directories. So instead, have its constructor take as an
argument a callback function that it should use for lazy-filling, and
change `files_ref_store` to supply a pointer to function
`read_loose_refs` (renamed to `loose_fill_ref_dir`) when creating the
ref cache for its loose refs.

This means that we can generify the type of the back-pointer in
`struct ref_cache` from `files_ref_store` to `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>refs: record the ref_store in ref_cache, not ref_dir</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:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e00d1a4ff7d79b403bf97a0746138d584c9ebf9a'/>
<id>urn:sha1:e00d1a4ff7d79b403bf97a0746138d584c9ebf9a</id>
<content type='text'>
Instead of keeping a pointer to the `ref_store` in every `ref_dir`
entry, store it once in `struct ref_cache`, and change `struct
ref_dir` to include a pointer to its containing `ref_cache` instead.
This makes it easier to add to the information that is accessible from
a `ref_dir` without increasing the size of every `ref_dir` instance.

Note that previously, every `ref_dir` pointed at the containing
`files_ref_store` regardless of whether it was a part of the loose or
packed reference cache. Now we have to be sure to initialize the
instances to point at the correct containing `ref_cache`. So change
`create_dir_entry()` to take a `ref_cache` parameter, and change its
callers to pass the correct `ref_cache` depending on the purpose of
the new `dir_entry`.

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>
