Skip to content

Commit ea23b22

Browse files
committed
docs: describe remote.<name>.haveRefs config option
Document the new remote.<name>.haveRefs multi-valued config option in Documentation/config/remote.adoc. Also update Documentation/fetch-options.adoc to mention that --negotiation-tip restrictions do not apply to haveRefs. Signed-off-by: Derrick Stolee <stolee@gmail.com>
1 parent c14efdd commit ea23b22

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

Documentation/config/remote.adoc

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,29 @@ priority configuration file (e.g. `.git/config` in a repository) to clear
107107
the values inherited from a lower priority configuration files (e.g.
108108
`$HOME/.gitconfig`).
109109

110+
remote.<name>.haveRefs::
111+
When negotiating with this remote during `git fetch` and `git push`,
112+
the client advertises a list of commits that exist locally. In
113+
repos with many references, this list of "haves" can be truncated.
114+
Depending on data shape, dropping certain references may be
115+
expensive. This multi-valued config option specifies ref patterns
116+
whose tips should always be sent as "have" commits during fetch
117+
negotiation with this remote.
118+
+
119+
Each value is either an exact ref name (e.g. `refs/heads/release`) or a
120+
glob pattern (e.g. `refs/heads/release/*`). The pattern syntax is the same
121+
as for `--negotiation-tip`.
122+
+
123+
If `--negotiation-tip` is used, then the have set is first restricted by
124+
that option and then increased to include the tips specified by the
125+
`remote.<name>.haveRefs` config values.
126+
+
127+
This option is additive with the normal negotiation process: the
128+
negotiation algorithm still runs and advertises its own selected commits,
129+
but the refs matching `remote.<name>.haveRefs` are sent unconditionally on
130+
top of those heuristically selected commits. This option is also used
131+
during push negotiation when `push.negotiate` is enabled.
132+
110133
remote.<name>.followRemoteHEAD::
111134
How linkgit:git-fetch[1] should handle updates to `remotes/<name>/HEAD`
112135
when fetching using the configured refspecs of a remote.

Documentation/fetch-options.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,8 @@ this option multiple times, one for each matching ref name.
6767
+
6868
See also the `fetch.negotiationAlgorithm` and `push.negotiate`
6969
configuration variables documented in linkgit:git-config[1], and the
70-
`--negotiate-only` option below.
70+
`--negotiate-only` option below. Also, these restrictions do not apply
71+
to any `remote.<name>.haveRefs` config values.
7172

7273
`--negotiate-only`::
7374
Do not fetch anything from the server, and instead print the

0 commit comments

Comments
 (0)