diff options
author | Jonathan Tan <jonathantanmy@google.com> | 2018-07-02 22:39:44 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-07-03 22:00:41 (GMT) |
commit | 3390e42adb3b84a9d61b3d46f4105f4cb6ba5edd (patch) | |
tree | 6d3b797117769e6c5a60d9fcd0b30bc7479d20f1 /Documentation | |
parent | ec06283844a90c3e9440286401e9ad7d86daa5ae (diff) | |
download | git-3390e42adb3b84a9d61b3d46f4105f4cb6ba5edd.zip git-3390e42adb3b84a9d61b3d46f4105f4cb6ba5edd.tar.gz git-3390e42adb3b84a9d61b3d46f4105f4cb6ba5edd.tar.bz2 |
fetch-pack: support negotiation tip whitelist
During negotiation, fetch-pack eventually reports as "have" lines all
commits reachable from all refs. Allow the user to restrict the commits
sent in this way by providing a whitelist of tips; only the tips
themselves and their ancestors will be sent.
Both globs and single objects are supported.
This feature is only supported for protocols that support connect or
stateless-connect (such as HTTP with protocol v2).
This will speed up negotiation when the repository has multiple
relatively independent branches (for example, when a repository
interacts with multiple repositories, such as with linux-next [1] and
torvalds/linux [2]), and the user knows which local branch is likely to
have commits in common with the upstream branch they are fetching.
[1] https://kernel.googlesource.com/pub/scm/linux/kernel/git/next/linux-next/
[2] https://kernel.googlesource.com/pub/scm/linux/kernel/git/torvalds/linux/
Signed-off-by: Jonathan Tan <jonathantanmy@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/fetch-options.txt | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Documentation/fetch-options.txt b/Documentation/fetch-options.txt index 97d3217..2d09f87 100644 --- a/Documentation/fetch-options.txt +++ b/Documentation/fetch-options.txt @@ -42,6 +42,22 @@ the current repository has the same history as the source repository. .git/shallow. This option updates .git/shallow and accept such refs. +--negotiation-tip=<commit|glob>:: + By default, Git will report, to the server, commits reachable + from all local refs to find common commits in an attempt to + reduce the size of the to-be-received packfile. If specified, + Git will only report commits reachable from the given tips. + This is useful to speed up fetches when the user knows which + local ref is likely to have commits in common with the + upstream ref being fetched. ++ +This option may be specified more than once; if so, Git will report +commits reachable from any of the given commits. ++ +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. + ifndef::git-pull[] --dry-run:: Show what would be done, without making any changes. |