]> git.ipfire.org Git - thirdparty/git.git/commit
fetch: add --negotiation-restrict option
authorDerrick Stolee <stolee@gmail.com>
Tue, 19 May 2026 16:24:49 +0000 (16:24 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 20 May 2026 02:33:23 +0000 (11:33 +0900)
commit1a445fc60b84df95253d740f3a112343ab5ed8d2
tree71e57d98bce0e4217d88d2f996cf6827e86b99e0
parent4e5b2a37956f40acd016f078b1e9a883e97a9f27
fetch: add --negotiation-restrict option

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. Mark --negotiation-tip as an alias of the
new, preferred option.

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.

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/fetch.adoc
Documentation/fetch-options.adoc
builtin/fetch.c
builtin/pull.c
send-pack.c
t/t5510-fetch.sh
t/t5702-protocol-v2.sh
transport-helper.c