Re: [PATCH v3 2/7] fetch: add --negotiation-restrict option
- From
Derrick Stolee <stolee@gmail.com>
- Date
- May 12, 2026, 14:23 UTC
- Message-ID
- <a2eab12b-49c0-4786-88cc-15f9996aca2b@gmail.com>
- In-Reply-To
- <VI0PR03MB116340D42554FA1D08E51910BC0392@VI0PR03MB11634.eurprd03.prod.outlook.com>
On 5/12/26 7:11 AM, Matthew John Cheetham wrote:
> On 2026-04-22 16:25, Derrick Stolee via GitGitGadget wrote: >> From: Derrick Stolee <stolee@gmail.com>
Show 33 quoted lines
>> --- a/Documentation/fetch-options.adoc >> +++ b/Documentation/fetch-options.adoc >> @@ -49,6 +49,7 @@ the current repository has the same history as the source >> repository. >> `.git/shallow`. This option updates `.git/shallow` and accepts such >> refs. >> +`--negotiation-restrict=(<commit>|<glob>)`:: >> `--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 >> @@ -58,6 +59,9 @@ the current repository has the same history as the source >> repository. >> local ref is likely to have commits in common with the >> upstream ref being fetched. >> + >> +`--negotiation-restrict` is the preferred name for this option; >> +`--negotiation-tip` is accepted as a synonym. >> ++ >> This option may be specified more than once; if so, Git will report >> commits reachable from any of the given commits. >> + > > By my eyes it looks like two other references to the old name remain and > could also be updated for consistency (since --negotiation-restrict is > now the preferred name): > > 1. Documentation/fetch-options.adoc, under `--negotiate-only`: > "ancestors of the provided `--negotiation-tip=` arguments" > > 2. Documentation/config/fetch.adoc: > "See also the `--negotiate-only` and `--negotiation-tip` options" > > Of course the old name will still work, so this is more a nit-pick :-)
Thanks for catching these! I will make the correct updates in the next version.
Show 18 quoted lines
>> diff --git a/builtin/pull.c b/builtin/pull.c
>> index 7e67fdce97..821cc6699a 100644
>> --- a/builtin/pull.c
>> +++ b/builtin/pull.c
>> @@ -999,6 +999,9 @@ int cmd_pull(int argc,
>> OPT_PASSTHRU_ARGV(0, "negotiation-tip", &opt_fetch, N_("revision"),
>> N_("report that we have only objects reachable from this object"),
>> 0),
>> + OPT_PASSTHRU_ARGV(0, "negotiation-restrict", &opt_fetch, N_("revision"),
>> + N_("report that we have only objects reachable from this object"),
>> + 0),
>> OPT_BOOL(0, "show-forced-updates", &opt_show_forced_updates,
>> N_("check for forced-updates on all updated branches")),
>> OPT_PASSTHRU(0, "set-upstream", &set_upstream, NULL,
>
> It's a shame we don't have a nice way to combine the `OPT_ALIAS` and
> `OPT_PASSTHRU_ARGV` functionality, but it's only a small duplication
> cost of the repeated definition.Actually, I just missed that I should use OPT_ALIAS in 'pull' as well as how it's used in 'fetch'. Will fix.
Thanks, -Stolee