git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Scott Johnson <jaywir3@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: Would a config var for --force-with-lease be useful?
Date: Mon, 27 Aug 2018 12:24:24 -0700	[thread overview]
Message-ID: <xmqqin3vk3yv.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <CAEFop40OJ5MRwM8zxE44yB0f2Fxw9YsUdM1e-H=Nn9e=sAGJ=w@mail.gmail.com> (Scott Johnson's message of "Fri, 24 Aug 2018 11:39:27 -0500")

Scott Johnson <jaywir3@gmail.com> writes:

> Hello Everyone:
>
> I'm considering writing a patch that adds a configuration variable
> that will allow the user to default the command:
>
> git push --force
>
> to:
>
> git push --force-with-lease

I actually consider "--force-with-lease" that does not say "this is
what exactly I am expecting to replace with my version" a fairly
dangerous form to recommend to the general public, unless their use
of "git fetch" (or "git pull") is disciplined.  In the extreme case,
if you habitually do "git fetch origin" only to update the remote
tracking branches (so that you can do things like "git log ..origin"
to see what others have been doing while you were offline), using
"--force-with-lease" offers no value over "--force", as you're
likely to find your remote-tracking ref to be up-to-date, but it no
longer is what you based on your decision that replacing the tip
with your version is safe.

So, from that point of view, I would recommend thinking twice before
considering to add such a configuration variable.

  parent reply	other threads:[~2018-08-27 19:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-24 16:39 Would a config var for --force-with-lease be useful? Scott Johnson
2018-08-25 13:34 ` Constantin Weißer
2018-08-27 21:21   ` Johannes Schindelin
2018-08-28  9:59     ` Phillip Wood
2018-08-27 19:24 ` Junio C Hamano [this message]
2018-08-27 19:40   ` Ævar Arnfjörð Bjarmason
2018-08-27 20:09     ` Junio C Hamano
2018-08-27 20:44       ` Ævar Arnfjörð Bjarmason
2018-08-27 22:29         ` Junio C Hamano

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=xmqqin3vk3yv.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=jaywir3@gmail.com \
    /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).