]> git.ipfire.org Git - thirdparty/git.git/commit
send-pack: pass negotiation config in push
authorDerrick Stolee <stolee@gmail.com>
Tue, 19 May 2026 16:24:55 +0000 (16:24 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 20 May 2026 02:33:24 +0000 (11:33 +0900)
commita6d92c48e4426b88a427a75ed2c20d1daa5dc7f7
tree3d1b1ced4b088c8d4b489c1fce4990ec5f433743
parent6f37fecfed7633d47b2c0e16fde0a8ca89e45beb
send-pack: pass negotiation config in push

When push.negotiate is enabled, 'git push' spawns a child 'git fetch
--negotiate-only' process to find common commits.  Pass
--negotiation-include and --negotiation-restrict options from the
'remote.<name>.negotiationInclude' and
'remote.<name>.negotiationRestrict' config keys to this child process.

When negotiationRestrict is configured, it replaces the default
behavior of using all remote refs as negotiation tips. This allows
the user to control which local refs are used for push negotiation.

When negotiationInclude is configured, the specified ref patterns
are passed as --negotiation-include to ensure their tips are always
sent as 'have' lines during push negotiation.

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
send-pack.c
send-pack.h
t/t5516-fetch-push.sh
transport.c