Re: [PATCH] push: add config option to --force-with-lease by default.
- From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
- Date
- Jul 3, 2017, 22:28 UTC
- Message-ID
- <87wp7pb1fz.fsf@gmail.com>
- In-Reply-To
- <87y3s5b204.fsf@gmail.com>
On Mon, Jul 03 2017, Ævar Arnfjörð Bjarmason jotted:
> On Mon, Jul 03 2017, Francesco Mazzoli jotted: > > A couple of things I didn't notice at first:
Oh and also, makes sense to add tests for this, see t/t5533-push-cas.sh. I.e. just make sure the cases where the option works work with the config, and that the option overrides the config etc.
Show 21 quoted lines
>> git_config(git_push_config, &flags);
>> + if (push_always_force_with_lease) {
>> + cas.use_tracking_for_rest = 1;
>> + }
>
> This should go in git_push_config.
>
>> + if (!strcmp(var, "push.alwaysforcewithlease")) {
>> + push_always_force_with_lease = git_config_bool(var, value);
>> + return 0;
>> + }
>
> [As you noted on IRC] --force-with-lease takes args, but yours
> doesn't. Arguably this makes no sense whatsoever to have in the config,
> but something worth pointing out in the commit message.
>
> We could make the config accept args, you'd call
> parse_push_cas_option(), but should we? I don't know.
>
> Should this also apply to send-pack's --force-with-lease? Under the same
> option name or send-pack.forceWithLease? I also don't know...