]> git.ipfire.org Git - thirdparty/git.git/commit
remote: add remote.*.negotiationInclude config
authorDerrick Stolee <stolee@gmail.com>
Tue, 19 May 2026 16:24:54 +0000 (16:24 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 20 May 2026 02:33:24 +0000 (11:33 +0900)
commit6f37fecfed7633d47b2c0e16fde0a8ca89e45beb
treeedfa37c35c10134a1264e890155fcf5b52f613fe
parente2164742c9ceb60ac9ddd2114f49304fd73df1f3
remote: add remote.*.negotiationInclude config

Add a new 'remote.<name>.negotiationInclude' multi-valued config option that
provides default values for --negotiation-include when no
--negotiation-include arguments are specified over the command line.  This
is a mirror of how 'remote.<name>.negotiationRestrict' specifies defaults
for the --negotiation-restrict arguments.

Each value is either an exact ref name or a glob pattern whose tips should
always be sent as 'have' lines during negotiation. The config values are
resolved through the same resolve_negotiation_include() codepath as the CLI
options.

This option is additive with the normal negotiation process: the negotiation
algorithm still runs and advertises its own selected commits, but the refs
matching the config are sent unconditionally on top of those heuristically
selected commits.

Similar to the negotiationRestrict config, an empty value resets the value
list to allow ignoring earlier config values, such as those that might be
set in system or global config.

Reviewed-by: Matthew John Cheetham <mjcheetham@outlook.com>
Signed-off-by: Derrick Stolee <stolee@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config/remote.adoc
Documentation/fetch-options.adoc
builtin/fetch.c
remote.c
remote.h
t/t5510-fetch.sh