<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/builtin/pull.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-15T18:30:40Z</updated>
<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>fetch: add --negotiation-restrict option</title>
<updated>2026-04-15T18:30:39Z</updated>
<author>
<name>Derrick Stolee</name>
<email>stolee@gmail.com</email>
</author>
<published>2026-04-15T15:14:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=d542ba848889be052927828218a0d4c88a812cb4'/>
<id>urn:sha1:d542ba848889be052927828218a0d4c88a812cb4</id>
<content type='text'>
The --negotiation-tip option to 'git fetch' and 'git pull' allows users
to specify that they want to focus negotiation on a small set of
references. This is a _restriction_ on the negotiation set, helping to
focus the negotiation when the ref count is high. However, it doesn't
allow for the ability to opportunistically select references beyond that
list.

This subtle detail that this is a 'maximum set' and not a 'minimum set'
is not immediately clear from the option name. This makes it more
complicated to add a new option that provides the complementary behavior
of a minimum set.

For now, create a new synonym option, --negotiation-restrict, that
behaves identically to --negotiation-tip. Update the documentation to
make it clear that this new name is the preferred option, but we keep
the old name for compatibility.

Update a few warning messages with the new option, but also make them
translatable with the option name inserted by formatting. At least one
of these messages will be reused later for a new option.

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>run-command: wean start_command() off the_repository</title>
<updated>2026-03-12T15:30:57Z</updated>
<author>
<name>Burak Kaan Karaçay</name>
<email>bkkaracay@gmail.com</email>
</author>
<published>2026-03-12T14:44:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=05c324b92fe723674cbf9ae1b0b1675821b6c275'/>
<id>urn:sha1:05c324b92fe723674cbf9ae1b0b1675821b6c275</id>
<content type='text'>
The start_command() relies on the_repository due to the
close_object_store flag in 'struct child_process'. When this flag is
set, start_command() closes the object store associated with
the_repository before spawning a child process.

To eliminate this dependency, replace the 'close_object_store' with the
new 'struct object_database *odb_to_close' field. This allows callers to
specify the object store that needs to be closed.

Suggested-by: René Scharfe &lt;l.s.r@web.de&gt;
Signed-off-by: Burak Kaan Karaçay &lt;bkkaracay@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>commit: rename `free_commit_list()` to conform to coding guidelines</title>
<updated>2026-01-15T13:32:31Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2026-01-15T09:35:34Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9f18d089c51fba2776fe1fece877a359c47417f7'/>
<id>urn:sha1:9f18d089c51fba2776fe1fece877a359c47417f7</id>
<content type='text'>
Our coding guidelines say that:

  Functions that operate on `struct S` are named `S_&lt;verb&gt;()` and should
  generally receive a pointer to `struct S` as first parameter.

While most of the functions related to `struct commit_list` already
follow that naming schema, `free_commit_list()` doesn't.

Rename the function to address this and adjust all of its callers. Add a
compatibility wrapper for the old function name to ease the transition
and avoid any semantic conflicts with in-flight patch series. This
wrapper will be removed once Git 2.53 has been released.

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>pull: move options[] array into function scope</title>
<updated>2025-12-12T13:08:02Z</updated>
<author>
<name>K Jayatheerth</name>
<email>jayatheerthkulkarni2005@gmail.com</email>
</author>
<published>2025-12-12T07:44:33Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=bab391761d1c7cff59d1c29ee546efc3e588473d'/>
<id>urn:sha1:bab391761d1c7cff59d1c29ee546efc3e588473d</id>
<content type='text'>
Unless there are good reasons, it is customary to have the options[]
array used with the parse-options API declared in function scope rather
than at file scope.

Move builtin/pull.c:cmd_pull()’s options[] array into the function to
match that convention.

Signed-off-by: K Jayatheerth &lt;jayatheerthkulkarni2005@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Merge branch 'ps/config-wo-the-repository'</title>
<updated>2025-08-04T15:10:33Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-08-04T15:10:32Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=540aaa607c5efcd94bb852a76a8ec3e07ea9a7bc'/>
<id>urn:sha1:540aaa607c5efcd94bb852a76a8ec3e07ea9a7bc</id>
<content type='text'>
The config API had a set of convenience wrapper functions that
implicitly use the_repository instance; they have been removed and
inlined at the calling sites.

* ps/config-wo-the-repository: (21 commits)
  config: fix sign comparison warnings
  config: move Git config parsing into "environment.c"
  config: remove unused `the_repository` wrappers
  config: drop `git_config_set_multivar()` wrapper
  config: drop `git_config_get_multivar_gently()` wrapper
  config: drop `git_config_set_multivar_in_file_gently()` wrapper
  config: drop `git_config_set_in_file_gently()` wrapper
  config: drop `git_config_set()` wrapper
  config: drop `git_config_set_gently()` wrapper
  config: drop `git_config_set_in_file()` wrapper
  config: drop `git_config_get_bool()` wrapper
  config: drop `git_config_get_ulong()` wrapper
  config: drop `git_config_get_int()` wrapper
  config: drop `git_config_get_string()` wrapper
  config: drop `git_config_get_string()` wrapper
  config: drop `git_config_get_string_multi()` wrapper
  config: drop `git_config_get_value()` wrapper
  config: drop `git_config_get_value()` wrapper
  config: drop `git_config_get()` wrapper
  config: drop `git_config_clear()` wrapper
  ...
</content>
</entry>
<entry>
<title>Merge branch 'ly/pull-autostash'</title>
<updated>2025-08-01T18:27:14Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2025-08-01T18:27:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=6fe666b2cef09571aa01d9ffae179472aeaf9378'/>
<id>urn:sha1:6fe666b2cef09571aa01d9ffae179472aeaf9378</id>
<content type='text'>
"git pull" learned to pay attention to pull.autostash configuration
variable, which overrides rebase/merge.autostash.

* ly/pull-autostash:
  pull: add pull.autoStash config option
</content>
</entry>
<entry>
<title>config: move Git config parsing into "environment.c"</title>
<updated>2025-07-23T15:15:22Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-07-23T14:08:41Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=08b775864edf96b97500fd70446c55528f5cf4a6'/>
<id>urn:sha1:08b775864edf96b97500fd70446c55528f5cf4a6</id>
<content type='text'>
In "config.c" we host both the business logic to read and write config
files as well as the logic to parse specific Git-related variables. On
the one hand this is mixing concerns, but even more importantly it means
that we cannot easily remove the dependency on `the_repository` in our
config parsing logic.

Move the logic into "environment.c". This file is a grab bag of all
kinds of global state already, so it is quite a good fit. Furthermore,
it also hosts most of the global variables that we're parsing the config
values into, making this an even better fit.

Note that there is one hidden change: in `parse_fsync_components()` we
use an `int` to iterate through `ARRAY_SIZE(fsync_component_names)`. But
as -Wsign-compare warnings are enabled in this file this causes a
compiler warning. The issue is fixed by using a `size_t` instead.

This change allows us to drop the `USE_THE_REPOSITORY_VARIABLE`
declaration.

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>config: drop `git_config_get_value()` wrapper</title>
<updated>2025-07-23T15:15:18Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-07-23T14:08:25Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=2f1242567ebe48f7f61df138f37b226256b7c4c6'/>
<id>urn:sha1:2f1242567ebe48f7f61df138f37b226256b7c4c6</id>
<content type='text'>
In 036876a1067 (config: hide functions using `the_repository` by
default, 2024-08-13) we have moved around a bunch of functions in the
config subsystem that depend on `the_repository`. Those function have
been converted into mere wrappers around their equivalent function that
takes in a repository as parameter, and the intent was that we'll
eventually remove those wrappers to make the dependency on the global
repository variable explicit at the callsite.

Follow through with that intent and remove `git_config_get_value()`. All
callsites are adjusted so that they use
`repo_config_get_value(the_repository, ...)` instead. While some
callsites might already have a repository available, this mechanical
conversion is the exact same as the current situation and thus cannot
cause any regression. Those sites should eventually be cleaned up in a
later patch series.

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>config: drop `git_config()` wrapper</title>
<updated>2025-07-23T15:15:18Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2025-07-23T14:08:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9ce196e86b455fa2552812802c58f30c090c94af'/>
<id>urn:sha1:9ce196e86b455fa2552812802c58f30c090c94af</id>
<content type='text'>
In 036876a1067 (config: hide functions using `the_repository` by
default, 2024-08-13) we have moved around a bunch of functions in the
config subsystem that depend on `the_repository`. Those function have
been converted into mere wrappers around their equivalent function that
takes in a repository as parameter, and the intent was that we'll
eventually remove those wrappers to make the dependency on the global
repository variable explicit at the callsite.

Follow through with that intent and remove `git_config()`. All callsites
are adjusted so that they use `repo_config(the_repository, ...)`
instead. While some callsites might already have a repository available,
this mechanical conversion is the exact same as the current situation
and thus cannot cause any regression. Those sites should eventually be
cleaned up in a later patch series.

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