<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/fetch-pack.c, branch jch</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/git/git.git/
</subtitle>
<id>https://git.shady.money/git/atom?h=jch</id>
<link rel='self' href='https://git.shady.money/git/atom?h=jch'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/'/>
<updated>2026-04-17T04:27:22Z</updated>
<entry>
<title>Merge branch 'ds/fetch-negotiation-options' into jch</title>
<updated>2026-04-17T04:27:22Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-04-17T04:27:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=878809dc2ef29cc38c434c135f3e26cf0eb2509f'/>
<id>urn:sha1:878809dc2ef29cc38c434c135f3e26cf0eb2509f</id>
<content type='text'>
The negotiation tip options in "git fetch" have been reworked to
allow requiring certain refs to be sent as "have" lines, and to
restrict negotiation to a specific set of refs.

* ds/fetch-negotiation-options:
  send-pack: pass negotiation config in push
  remote: add negotiationRequire config as default for --negotiation-require
  fetch: add --negotiation-require option for negotiation
  remote: add remote.*.negotiationRestrict config
  transport: rename negotiation_tips
  fetch: add --negotiation-restrict option
  t5516: fix test order flakiness
</content>
</entry>
<entry>
<title>fetch: add --negotiation-require option for negotiation</title>
<updated>2026-04-15T18:30:40Z</updated>
<author>
<name>Derrick Stolee</name>
<email>stolee@gmail.com</email>
</author>
<published>2026-04-15T15:14:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=18d5475b45b2a883ca88b12c87f4cc19d1ec5cf2'/>
<id>urn:sha1:18d5475b45b2a883ca88b12c87f4cc19d1ec5cf2</id>
<content type='text'>
Add a new --negotiation-require option to 'git fetch', which ensures
that certain ref tips are always sent as 'have' lines during fetch
negotiation, regardless of what the negotiation algorithm selects.

This is useful when the repository has a large number of references, so
the normal negotiation algorithm truncates the list. This is especially
important in repositories with long parallel commit histories. For
example, a repo could have a 'dev' branch for development and a
'release' branch for released versions. If the 'dev' branch isn't
selected for negotiation, then it's not a big deal because there are
many in-progress development branches with a shared history. However, if
'release' is not selected for negotiation, then the server may think
that this is the first time the client has asked for that reference,
causing a full download of its parallel commit history (and any extra
data that may be unique to that branch). This is based on a real example
where certain fetches would grow to 60+ GB when a release branch
updated.

This option is a complement to --negotiation-restrict, which reduces the
negotiation ref set to a specific list. In the earlier example, using
--negotiation-restrict to focus the negotiation to 'dev' and 'release'
would avoid those problematic downloads, but would still not allow
advertising potentially-relevant user brances. In this way, the
'require' version solves the problem I mention while allowing
negotiation to pick other references opportunistically. The two options
can also be combined to allow the best of both worlds.

The argument may be an exact ref name or a glob pattern. Non-existent
refs are silently ignored.

Also add --negotiation-require to 'git pull' passthrough options.

Signed-off-by: Derrick Stolee &lt;stolee@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>transport: rename negotiation_tips</title>
<updated>2026-04-15T18:30:39Z</updated>
<author>
<name>Derrick Stolee</name>
<email>stolee@gmail.com</email>
</author>
<published>2026-04-15T15:14:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9596a1ca95a847afe26d9c25cb8a17f6b697a9a2'/>
<id>urn:sha1:9596a1ca95a847afe26d9c25cb8a17f6b697a9a2</id>
<content type='text'>
The previous change added the --negotiation-restrict synonym for the
--negotiation-tips option for 'git fetch'. In anticipation of adding a
new option that behaves similarly but with distinct changes to its
behavior, rename the internal representation of this data from
'negotiation_tips' to 'negotiation_restrict_tips'.

The 'tips' part is kept because this is an oid_array in the transport
layer. This requires the builtin to handle parsing refs into collections
of oids so the transport layer can handle this cleaner form of the data.

Signed-off-by: Derrick Stolee &lt;stolee@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ps/odb-cleanup'</title>
<updated>2026-04-08T17:19:17Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-04-08T17:19:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9797fed6cea706f65de64396222545d545226e15'/>
<id>urn:sha1:9797fed6cea706f65de64396222545d545226e15</id>
<content type='text'>
Various code clean-up around odb subsystem.

* ps/odb-cleanup:
  odb: drop unneeded headers and forward decls
  odb: rename `odb_has_object()` flags
  odb: use enum for `odb_write_object` flags
  odb: rename `odb_write_object()` flags
  treewide: use enum for `odb_for_each_object()` flags
  CodingGuidelines: document our style for flags
</content>
</entry>
<entry>
<title>Merge branch 'ps/fsck-wo-the-repository'</title>
<updated>2026-04-07T21:59:26Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-04-07T21:59:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=7b6d0cd51b30e842ffb95d045385100b7c677886'/>
<id>urn:sha1:7b6d0cd51b30e842ffb95d045385100b7c677886</id>
<content type='text'>
Internals of "git fsck" have been refactored to not depend on the
global `the_repository` variable.

* ps/fsck-wo-the-repository:
  builtin/fsck: stop using `the_repository` in error reporting
  builtin/fsck: stop using `the_repository` when marking objects
  builtin/fsck: stop using `the_repository` when checking packed objects
  builtin/fsck: stop using `the_repository` with loose objects
  builtin/fsck: stop using `the_repository` when checking reflogs
  builtin/fsck: stop using `the_repository` when checking refs
  builtin/fsck: stop using `the_repository` when snapshotting refs
  builtin/fsck: fix trivial dependence on `the_repository`
  fsck: drop USE_THE_REPOSITORY
  fsck: store repository in fsck options
  fsck: initialize fsck options via a function
  fetch-pack: move fsck options into function scope
</content>
</entry>
<entry>
<title>odb: rename `odb_has_object()` flags</title>
<updated>2026-04-01T03:43:14Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-03-31T23:57:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=c63911b052dc286de5daddba8d4a20fd59348cee'/>
<id>urn:sha1:c63911b052dc286de5daddba8d4a20fd59348cee</id>
<content type='text'>
Rename `odb_has_object()` flags to be properly prefixed with the
function name.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>use strvec_pushv() to add another strvec</title>
<updated>2026-03-24T19:26:58Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2026-03-24T19:26:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=250e977a2b0aa8cc1c8063c64c44597a166e79f5'/>
<id>urn:sha1:250e977a2b0aa8cc1c8063c64c44597a166e79f5</id>
<content type='text'>
Add and apply a semantic patch that simplifies the code by letting
strvec_pushv() append the items of a second strvec instead of pushing
them one by one.

Suggested-by: Junio C Hamano &lt;gitster@pobox.com&gt;
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>fsck: store repository in fsck options</title>
<updated>2026-03-23T15:33:10Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-03-23T15:02:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=374985390871cb67c02b1608b693480e89567b9a'/>
<id>urn:sha1:374985390871cb67c02b1608b693480e89567b9a</id>
<content type='text'>
The fsck subsystem relies on `the_repository` quite a bit. While we
could of course explicitly pass a repository down the callchain, we
already have a `struct fsck_options` that we pass to almost all
functions.

Extend the options to also store the repository to make it readily
available.

Suggested-by: Junio C Hamano &lt;gitster@pobox.com&gt;
Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fsck: initialize fsck options via a function</title>
<updated>2026-03-23T15:33:10Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-03-23T15:02:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f22360902621e0807a1c0a77476e3e4d323c708d'/>
<id>urn:sha1:f22360902621e0807a1c0a77476e3e4d323c708d</id>
<content type='text'>
We initialize the `struct fsck_options` via a set of macros, often in
global scope. In the next commit though we're about to introduce a new
repository field to the options that must be initialized, and naturally
we don't have a repo other than `the_repository` available in this
scope.

Refactor the code to instead intrdouce a new `fsck_options_init()`
function that initializes the options for us and move initialization
into function scope.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>fetch-pack: move fsck options into function scope</title>
<updated>2026-03-23T15:33:09Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-03-23T15:02:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=17cabd369b5cb96bee9577f49247ef95d07058a7'/>
<id>urn:sha1:17cabd369b5cb96bee9577f49247ef95d07058a7</id>
<content type='text'>
When fetching a packfile, we optionally verify received objects via the
fsck subsystem. The options for those consistency checks are declared in
global scope without a good reason, and they are never cleaned up. So in
case the options are reused, they may accumulate more state over time.

Furthermore, in subsequent changes we'll introduce a repository pointer
into the structure. Obviously though, we don't have a repository
available at static time, except for `the_repository`, which we don't
want to use here.

Refactor the code to move the options into the respective functions and
properly manage their lifecycle.

Signed-off-by: Patrick Steinhardt &lt;ps@pks.im&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
</feed>
