]> git.ipfire.org Git - thirdparty/git.git/commitdiff
fetch: document the --negotiate-only option
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Wed, 30 Jun 2021 16:38:11 +0000 (18:38 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 30 Jun 2021 21:57:22 +0000 (14:57 -0700)
There was no documentation for the --negotiate-only option added in
9c1e657a8fd (fetch: teach independent negotiation (no packfile),
2021-05-04), only documentation for the related push.negotiation
option added in the following commit in 477673d6f39 (send-pack:
support push negotiation, 2021-05-04).

Let's document it, and update the cross-linking I'd added between
--negotiation-tip=* and 'fetch.negotiationAlgorithm' in
526608284a7 (fetch doc: cross-link two new negotiation options,
2018-08-01).

I think it would be better to say "in common with the remote" here
than "...the server", but the documentation for --negotiation-tip=*
above this talks about "the server", so let's continue doing that in
this related option. See 3390e42adb3 (fetch-pack: support negotiation
tip whitelist, 2018-07-02) for that documentation.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/config/fetch.txt
Documentation/fetch-options.txt

index 6af6f5edb278f53ceb2f4c69f47f72d6ef120e2f..63748c02b72afe5211a710e963c2be502888545e 100644 (file)
@@ -69,7 +69,8 @@ fetch.negotiationAlgorithm::
        setting defaults to "skipping".
        Unknown values will cause 'git fetch' to error out.
 +
-See also the `--negotiation-tip` option for linkgit:git-fetch[1].
+See also the `--negotiate-only` and `--negotiation-tip` options to
+linkgit:git-fetch[1].
 
 fetch.showForcedUpdates::
        Set to false to enable `--no-show-forced-updates` in
index 9e7b4e189ce0aac747569929f234a1a641003ec7..e967ff1874c252cdd73455f73146b4419b58f9c9 100644 (file)
@@ -62,8 +62,17 @@ The argument to this option may be a glob on ref names, a ref, or the (possibly
 abbreviated) SHA-1 of a commit. Specifying a glob is equivalent to specifying
 this option multiple times, one for each matching ref name.
 +
-See also the `fetch.negotiationAlgorithm` configuration variable
-documented in linkgit:git-config[1].
+See also the `fetch.negotiationAlgorithm` and `push.negotiate`
+configuration variables documented in linkgit:git-config[1], and the
+`--negotiate-only` option below.
+
+--negotiate-only::
+       Do not fetch anything from the server, and instead print the
+       ancestors of the provided `--negotiation-tip=*` arguments,
+       which we have in common with the server.
++
+Internally this is used to implement the `push.negotiate` option, see
+linkgit:git-config[1].
 
 --dry-run::
        Show what would be done, without making any changes.