git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Francesco Mazzoli <f@mazzo.li>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] push: add config option to --force-with-lease by default.
Date: Mon, 03 Jul 2017 23:47:41 +0200	[thread overview]
Message-ID: <871spxchvm.fsf@gmail.com> (raw)
In-Reply-To: <1499116727-757-1-git-send-email-f@mazzo.li>


On Mon, Jul 03 2017, Francesco Mazzoli jotted:

> The flag can be overridden with `--no-force-with-lease`, or by
> passing the config via the command line.

Thanks for hacking on this. A couple of things:

* Most things (but not all) that configure `git whatevs --some-option`
  are configurable via whatevs.someOption, I think this should follow
  that convention. I.e. be push.forceWithLease not
  push.alwaysForceWithLease.

  See my
  https://public-inbox.org/git/20170324231013.23346-1-avarab@gmail.com/
  patch series for something that went through many of these cases
  (although I see I didn't send it all to list). Anyway, something like
  8/10 of our config variables for switches follow that
  convention. Let's use it for new config.

* It makes sense to also document this the git-push manpage. See
  e.g. how we document --follow-tags:

      Push all the refs that [...] This can also be specified with
      configuration variable push.followTags. For more information, see
      push.followTags in git-config(1).

   You should add something like that to --force-with-lease.

> +push.alwaysforcewithlease::
> +	When true, `--force-with-lease` is the default behavior when
> +	using `push --force`. Explicit invocations of `--force-with-lease`
> +	or `--no-force-with-lease` if present, take precedence.

Semantically this makes sense, and is exactly how most of these switch
config variables work (and would be how it worked once refactored with
my CLI arg config patch).

  reply	other threads:[~2017-07-03 21:47 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-03 21:18 [PATCH] push: add config option to --force-with-lease by default Francesco Mazzoli
2017-07-03 21:47 ` Ævar Arnfjörð Bjarmason [this message]
2017-07-03 21:57   ` Francesco Mazzoli
2017-07-03 22:08   ` Francesco Mazzoli
2017-07-03 22:15 ` Ævar Arnfjörð Bjarmason
2017-07-03 22:28   ` Ævar Arnfjörð Bjarmason
2017-07-04 17:51 ` Junio C Hamano
2017-07-05  6:34   ` Francesco Mazzoli
2017-07-05  7:43     ` Junio C Hamano
2017-07-05  8:04       ` Francesco Mazzoli
2017-07-05 15:17         ` Junio C Hamano
2017-07-05 16:43           ` Francesco Mazzoli
2017-07-05 18:51             ` Mike Rappazzo
2017-07-06 19:13             ` Junio C Hamano
2017-07-07  6:19               ` Francesco Mazzoli
2017-07-05 11:26       ` Ævar Arnfjörð Bjarmason
2017-07-05 15:48         ` Ævar Arnfjörð Bjarmason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=871spxchvm.fsf@gmail.com \
    --to=avarab@gmail.com \
    --cc=f@mazzo.li \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).