<feed xmlns='http://www.w3.org/2005/Atom'>
<title>git/send-pack.h, 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>send-pack: pass negotiation config in push</title>
<updated>2026-04-15T18:30:40Z</updated>
<author>
<name>Derrick Stolee</name>
<email>stolee@gmail.com</email>
</author>
<published>2026-04-15T15:14:26Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9f67318dfc82e17c08ea79cc1cb85c7feb87bdb6'/>
<id>urn:sha1:9f67318dfc82e17c08ea79cc1cb85c7feb87bdb6</id>
<content type='text'>
When push.negotiate is enabled, 'git push' spawns a child 'git fetch
--negotiate-only' process to find common commits.  Pass
--negotiation-require and --negotiation-restrict options from the
'remote.&lt;name&gt;.negotiationRequire' and
'remote.&lt;name&gt;.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 negotiationRequire is configured, the specified ref patterns
are passed as --negotiation-require to ensure their tips are always
sent as 'have' lines during push negotiation.

This change also updates the use of --negotiation-tip into
--negotiation-restrict now that the new synonym exists.

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>send-pack: new return code "ERROR_SEND_PACK_BAD_REF_STATUS"</title>
<updated>2025-02-03T23:24:57Z</updated>
<author>
<name>Jiang Xin</name>
<email>zhiyou.jx@alibaba-inc.com</email>
</author>
<published>2025-02-03T06:29:36Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=3028db4af289560e670b9f362aea16eaf3d1825e'/>
<id>urn:sha1:3028db4af289560e670b9f362aea16eaf3d1825e</id>
<content type='text'>
The "push_refs" function in the transport_vtable is the handler for
git-push operation. All the "push_refs" functions for different
transports (protocols) should have the same behavior, but the behavior
of "git_transport_push()" function for builtin_smart_vtable in
"transport.c" (which calls "send_pack()" in "send-pack.c") differs from
the handler of the HTTP protocol.

The "push_refs()" function for the HTTP protocol which calls the
"push_refs_with_push()" function in "transport-helper.c" will return 0
even when a bad REF_STATUS (such as REF_STATUS_REJECT_NONFASTFORWARD)
was found. But "send_pack()" for Git smart protocol will return -1 for
a bad REF_STATUS.

We cannot ignore bad REF_STATUS directly in the "send_pack()" function,
because the function is also used in "builtin/send-pack.c". So we add a
new non-zero error code "SEND_PACK_ERROR_REF_STATUS" for "send_pack()".

Ignore the specific error code in the "git_transport_push()" function to
have the same behavior as "push_refs()" for HTTP protocol. Note that
even though we ignore the error here, we'll ultimately still end up
detecting that a subset of refs was not pushed in `transport_push()`
because we eventually call `push_had_errors()` on the remote refs.

Signed-off-by: Jiang Xin &lt;zhiyou.jx@alibaba-inc.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>send-pack: stop using `the_repository`</title>
<updated>2024-12-18T18:44:30Z</updated>
<author>
<name>Patrick Steinhardt</name>
<email>ps@pks.im</email>
</author>
<published>2024-12-17T06:43:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=5ee907bb3f12c630f78554ea9b4c605f4e1a5e92'/>
<id>urn:sha1:5ee907bb3f12c630f78554ea9b4c605f4e1a5e92</id>
<content type='text'>
Stop using `the_repository` in the "send-pack" subsystem by passing in a
repository when sending a packfile.

Adjust callers accordingly by using `the_repository`. While there may be
some callers that have a repository available in their context, this
trivial conversion allows for easier verification and bubbles up the use
of `the_repository` by one level.

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>send-pack.c: add config push.useBitmaps</title>
<updated>2022-06-17T21:31:01Z</updated>
<author>
<name>Kyle Zhao</name>
<email>kylezhao@tencent.com</email>
</author>
<published>2022-06-17T19:06:19Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=82f67ee13fb25ebed1cd722c83de49a1ac588429'/>
<id>urn:sha1:82f67ee13fb25ebed1cd722c83de49a1ac588429</id>
<content type='text'>
Reachability bitmaps are designed to speed up the "counting objects"
phase of generating a pack during a clone or fetch. They are not
optimized for Git clients sending a small topic branch via "git push".
In some cases (see [1]), using reachability bitmaps during "git push"
can cause significant performance regressions.

Add a new "push.useBitmaps" configuration variable to allow users to
tell "git push" not to use bitmaps. We already have "pack.bitmaps"
that controls the use of bitmaps, but a separate configuration variable
allows the reachability bitmaps to still be used in other areas,
such as "git upload-pack", while disabling it only for "git push".

[1]: https://lore.kernel.org/git/87zhoz8b9o.fsf@evledraar.gmail.com/

Signed-off-by: Kyle Zhao &lt;kylezhao@tencent.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Add missing includes and forward declarations</title>
<updated>2018-08-15T18:52:09Z</updated>
<author>
<name>Elijah Newren</name>
<email>newren@gmail.com</email>
</author>
<published>2018-08-15T17:54:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=ef3ca95475ce467ae883cc8175ed40e6f7d27800'/>
<id>urn:sha1:ef3ca95475ce467ae883cc8175ed40e6f7d27800</id>
<content type='text'>
I looped over the toplevel header files, creating a temporary two-line C
program for each consisting of
  #include "git-compat-util.h"
  #include $HEADER
This patch is the result of manually fixing errors in compiling those
tiny programs.

Signed-off-by: Elijah Newren &lt;newren@gmail.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>Rename sha1_array to oid_array</title>
<updated>2017-03-31T15:33:56Z</updated>
<author>
<name>brian m. carlson</name>
<email>sandals@crustytoothpaste.net</email>
</author>
<published>2017-03-31T01:40:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=910650d2f8755359ab7b1f0e2a2d576c06a68091'/>
<id>urn:sha1:910650d2f8755359ab7b1f0e2a2d576c06a68091</id>
<content type='text'>
Since this structure handles an array of object IDs, rename it to struct
oid_array.  Also rename the accessor functions and the initialization
constant.

This commit was produced mechanically by providing non-Documentation
files to the following Perl one-liners:

    perl -pi -E 's/struct sha1_array/struct oid_array/g'
    perl -pi -E 's/\bsha1_array_/oid_array_/g'
    perl -pi -E 's/SHA1_ARRAY_INIT/OID_ARRAY_INIT/g'

Signed-off-by: brian m. carlson &lt;sandals@crustytoothpaste.net&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>push: accept push options</title>
<updated>2016-07-14T22:50:41Z</updated>
<author>
<name>Stefan Beller</name>
<email>sbeller@google.com</email>
</author>
<published>2016-07-14T21:49:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=f6a4e61fbb647928d615a0befaec163a5d2bf4af'/>
<id>urn:sha1:f6a4e61fbb647928d615a0befaec163a5d2bf4af</id>
<content type='text'>
This implements everything that is required on the client side to make use
of push options from the porcelain push command.

Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>push: support signing pushes iff the server supports it</title>
<updated>2015-08-19T19:58:45Z</updated>
<author>
<name>Dave Borowitz</name>
<email>dborowitz@google.com</email>
</author>
<published>2015-08-19T15:26:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=30261094b1f7fdcba3b7a1f396e43891cd998149'/>
<id>urn:sha1:30261094b1f7fdcba3b7a1f396e43891cd998149</id>
<content type='text'>
Add a new flag --sign=true (or --sign=false), which means the same
thing as the original --signed (or --no-signed).  Give it a third
value --sign=if-asked to tell push and send-pack to send a push
certificate if and only if the server advertised a push cert nonce.

If not, warn the user that their push may not be as secure as they
thought.

Signed-off-by: Dave Borowitz &lt;dborowitz@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>send-pack.c: add --atomic command line argument</title>
<updated>2015-01-08T03:56:44Z</updated>
<author>
<name>Ronnie Sahlberg</name>
<email>sahlberg@google.com</email>
</author>
<published>2015-01-08T03:23:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=4ff17f10c4297ab3d9948d4216016ca367e737e3'/>
<id>urn:sha1:4ff17f10c4297ab3d9948d4216016ca367e737e3</id>
<content type='text'>
This adds support to send-pack to negotiate and use atomic pushes
iff the server supports it. Atomic pushes are activated by a new command
line flag --atomic.

In order to do this we also need to change the semantics for send_pack()
slightly. The existing send_pack() function actually doesn't send all the
refs back to the server when multiple refs are involved, for example
when using --all. Several of the failure modes for pushes can already be
detected locally in the send_pack client based on the information from the
initial server side list of all the refs as generated by receive-pack.
Any such refs that we thus know would fail to push are thus pruned from
the list of refs we send to the server to update.

For atomic pushes, we have to deal thus with both failures that are detected
locally as well as failures that are reported back from the server. In order
to do so we treat all local failures as push failures too.

We introduce a new status code REF_STATUS_ATOMIC_PUSH_FAILED so we can
flag all refs that we would normally have tried to push to the server
but we did not due to local failures. This is to improve the error message
back to the end user to flag that "these refs failed to update since the
atomic push operation failed."

Signed-off-by: Ronnie Sahlberg &lt;sahlberg@google.com&gt;
Signed-off-by: Stefan Beller &lt;sbeller@google.com&gt;
Signed-off-by: Junio C Hamano &lt;gitster@pobox.com&gt;
</content>
</entry>
<entry>
<title>signed push: add "pushee" header to push certificate</title>
<updated>2014-09-15T20:23:28Z</updated>
<author>
<name>Junio C Hamano</name>
<email>gitster@pobox.com</email>
</author>
<published>2014-08-23T01:15:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/git/commit/?id=9be89160e7382a88e56a02bcf38f4694dd6542d6'/>
<id>urn:sha1:9be89160e7382a88e56a02bcf38f4694dd6542d6</id>
<content type='text'>
Record the URL of the intended recipient for a push (after
anonymizing it if it has authentication material) on a new "pushee
URL" header.  Because the networking configuration (SSH-tunnels,
proxies, etc.) on the pushing user's side varies, the receiving
repository may not know the single canonical URL all the pushing
users would refer it as (besides, many sites allow pushing over
ssh://host/path and https://host/path protocols to the same
repository but with different local part of the path).  So this
value may not be reliably used for replay-attack prevention
purposes, but this will still serve as a human readable hint to
identify the repository the certificate refers to.

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