<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/packfile.h, branch v2.45.4</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=v2.45.4</id>
<link rel='self' href='https://git.shady.money/git/atom?h=v2.45.4'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2023-11-19T23:15:50Z</updated>
<entry>
<title>packfile.c: fix a typo in `each_file_in_pack_dir_fn()`'s declaration</title>
<updated>2023-11-19T23:15:50Z</updated>
<author>
<name>Johannes Schindelin</name>
<email>johannes.schindelin@gmx.de</email>
</author>
<published>2023-11-17T13:15:15Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=50f1abcff6681ae06334b3deef39b20aec261c15'/>
<id>urn:sha1:50f1abcff6681ae06334b3deef39b20aec261c15</id>
<content type='text'>
One parameter is called `file_pach`. On the face of it, this looks as if
it was supposed to talk about a `path` instead of a `pach`.

However, looking at the way this callback is called, it gets fed the
`d_name` from a directory entry, which provides just the file name, not
the full path. Therefore, let's fix this by calling the parameter
`file_name` instead.

Signed-off-by: Johannes Schindelin &lt;johannes.schindelin@gmx.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>packfile.h: move pack_window and pack_entry from cache.h</title>
<updated>2023-04-24T19:47:31Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2023-04-22T20:17:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0ff73d742b40bc85966d5b7dcc28f438910f771c'/>
<id>urn:sha1:0ff73d742b40bc85966d5b7dcc28f438910f771c</id>
<content type='text'>
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>Merge branch 'ab/remove-implicit-use-of-the-repository' into en/header-split-cache-h</title>
<updated>2023-04-04T15:25:52Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2023-04-04T15:25:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=e7dca80692dec7f0717d9ad6d978d0ceab90cf6a'/>
<id>urn:sha1:e7dca80692dec7f0717d9ad6d978d0ceab90cf6a</id>
<content type='text'>
* ab/remove-implicit-use-of-the-repository:
  libs: use "struct repository *" argument, not "the_repository"
  post-cocci: adjust comments for recent repo_* migration
  cocci: apply the "revision.h" part of "the_repository.pending"
  cocci: apply the "rerere.h" part of "the_repository.pending"
  cocci: apply the "refs.h" part of "the_repository.pending"
  cocci: apply the "promisor-remote.h" part of "the_repository.pending"
  cocci: apply the "packfile.h" part of "the_repository.pending"
  cocci: apply the "pretty.h" part of "the_repository.pending"
  cocci: apply the "object-store.h" part of "the_repository.pending"
  cocci: apply the "diff.h" part of "the_repository.pending"
  cocci: apply the "commit.h" part of "the_repository.pending"
  cocci: apply the "commit-reach.h" part of "the_repository.pending"
  cocci: apply the "cache.h" part of "the_repository.pending"
  cocci: add missing "the_repository" macros to "pending"
  cocci: sort "the_repository" rules by header
  cocci: fix incorrect &amp; verbose "the_repository" rules
  cocci: remove dead rule from "the_repository.pending.cocci"
</content>
</entry>
<entry>
<title>cocci: apply the "packfile.h" part of "the_repository.pending"</title>
<updated>2023-03-28T14:36:45Z</updated>
<author>
<name>Ævar Arnfjörð Bjarmason</name>
<email>avarab@gmail.com</email>
</author>
<published>2023-03-28T13:58:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=afe27c889429438829bc8818ed17e4960bd3ef02'/>
<id>urn:sha1:afe27c889429438829bc8818ed17e4960bd3ef02</id>
<content type='text'>
Apply the part of "the_repository.pending.cocci" pertaining to
"packfile.h".

Signed-off-by: Ævar Arnfjörð Bjarmason &lt;avarab@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>treewide: remove unnecessary cache.h inclusion from a few headers</title>
<updated>2023-03-21T17:56:50Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2023-03-21T06:25:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=a6dc3d364cdf89075582cd521f33d599e6b53cf2'/>
<id>urn:sha1:a6dc3d364cdf89075582cd521f33d599e6b53cf2</id>
<content type='text'>
Ever since a64215b6cd ("object.h: stop depending on cache.h; make
cache.h depend on object.h", 2023-02-24), we have a few headers that
could have replaced their include of cache.h with an include of
object.h.  Make that change now.

Some C files had to start including cache.h after this change (or some
smaller header it had brought in), because the C files were depending
on things from cache.h but were only formerly implicitly getting
cache.h through one of these headers being modified in this patch.

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>Merge branch 'tb/pack-revindex-on-disk-cleanup'</title>
<updated>2021-12-15T17:39:50Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2021-12-15T17:39:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=79aee56c1ee342953a6d9f49f45b89d7f44a624f'/>
<id>urn:sha1:79aee56c1ee342953a6d9f49f45b89d7f44a624f</id>
<content type='text'>
Code clean-up.

* tb/pack-revindex-on-disk-cleanup:
  packfile: make `close_pack_revindex()` static
</content>
</entry>
<entry>
<title>packfile: make `close_pack_revindex()` static</title>
<updated>2021-12-05T07:01:38Z</updated>
<author>
<name>Taylor Blau</name>
<email>me@ttaylorr.com</email>
</author>
<published>2021-12-04T22:51:38Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=0bf0de6cc70361b7847264050d03b91f6d423813'/>
<id>urn:sha1:0bf0de6cc70361b7847264050d03b91f6d423813</id>
<content type='text'>
Since its definition in 2f4ba2a867 (packfile: prepare for the existence
of '*.rev' files, 2021-01-25), the only caller of
`close_pack_revindex()` was within packfile.c.

Thus there is no need for this to be exposed via packfile.h, and instead
can remain static within packfile.c's compilation unit. While we're
here, move the function's opening brace onto its own line.

Noticed-by: Ramsay Jones &lt;ramsay@ramsayjones.plus.com&gt;
Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>packfile: convert has_packed_and_bad() to object_id</title>
<updated>2021-09-12T23:14:32Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2021-09-11T20:42:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7407d733a4a99cf946cab0c82e03c41dbd305b7c'/>
<id>urn:sha1:7407d733a4a99cf946cab0c82e03c41dbd305b7c</id>
<content type='text'>
The single caller has a full object ID, so pass it on instead of just
its hash member.

Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>packfile: convert mark_bad_packed_object() to object_id</title>
<updated>2021-09-12T23:14:32Z</updated>
<author>
<name>René Scharfe</name>
<email>l.s.r@web.de</email>
</author>
<published>2021-09-11T20:40:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=751530de5db77196a08897e3c47526c0f0147ef1'/>
<id>urn:sha1:751530de5db77196a08897e3c47526c0f0147ef1</id>
<content type='text'>
All callers have full object IDs, so pass them on instead of just their
hash member.

Signed-off-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>packfile: introduce 'find_kept_pack_entry()'</title>
<updated>2021-02-23T07:30:52Z</updated>
<author>
<name>Taylor Blau</name>
<email>me@ttaylorr.com</email>
</author>
<published>2021-02-23T02:25:03Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f62312e02837d91e3b47ea876654bf3ac97b2905'/>
<id>urn:sha1:f62312e02837d91e3b47ea876654bf3ac97b2905</id>
<content type='text'>
Future callers will want a function to fill a 'struct pack_entry' for a
given object id but _only_ from its position in any kept pack(s).

In particular, an new 'git repack' mode which ensures the resulting
packs form a geometric progress by object count will mark packs that it
does not want to repack as "kept in-core", and it will want to halt a
reachability traversal as soon as it visits an object in any of the kept
packs. But, it does not want to halt the traversal at non-kept, or
.keep packs.

The obvious alternative is 'find_pack_entry()', but this doesn't quite
suffice since it only returns the first pack it finds, which may or may
not be kept (and the mru cache makes it unpredictable which one you'll
get if there are options).

Short of that, you could walk over all packs looking for the object in
each one, but it scales with the number of packs, which may be
prohibitive.

Introduce 'find_kept_pack_entry()', a function which is like
'find_pack_entry()', but only fills in objects in the kept packs.

Handle packs which have .keep files, as well as in-core kept packs
separately, since certain callers will want to distinguish one from the
other. (Though on-disk and in-core kept packs share the adjective
"kept", it is best to think of the two sets as independent.)

There is a gotcha when looking up objects that are duplicated in kept
and non-kept packs, particularly when the MIDX stores the non-kept
version and the caller asked for kept objects only. This could be
resolved by teaching the MIDX to resolve duplicates by always favoring
the kept pack (if one exists), but this breaks an assumption in existing
MIDXs, and so it would require a format change.

The benefit to changing the MIDX in this way is marginal, so we instead
have a more thorough check here which is explained with a comment.

Callers will be added in subsequent patches.

Co-authored-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Taylor Blau &lt;me@ttaylorr.com&gt;
Reviewed-by: Jeff King &lt;peff@peff.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
