git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: XonqNopp <xonqnoppp@gmail.com>, git@vger.kernel.org
Subject: Re: Proposalö git push -F
Date: Thu, 4 Mar 2021 11:02:18 +0100 (CET)	[thread overview]
Message-ID: <nycvar.QRO.7.76.6.2103041045420.57@tvgsbejvaqbjf.bet> (raw)
In-Reply-To: <xmqqim68lp20.fsf@gitster.c.googlers.com>

Hi,

On Tue, 2 Mar 2021, Junio C Hamano wrote:

> XonqNopp <xonqnoppp@gmail.com> writes:
>
> > I have discovered some months ago that it is more safe to force a push with
> > git push --force-with-lease
> >
> > But since then I keep wondering: why is this not the default?
>
> Because the form "--force-with-lease=<this-exact-commit>" is a
> strict improvement over "--force", but the lazy "guess where the
> other end should be" form, i.e. "--force-with-lease" alone, is worse
> than "--force" in that it gives users false sense of security
> without offering the safety the "lease" mechanism gives.

To add to that: some tools helpfully fetch in the background, therefore
remote-tracking branches are updated _without_ the user being aware of it.
In this instance, `--force-with-lease` is very dangerous.

We did introduce the `--force-if-includes` option, but it seems that we
made this option _not_ imply `--force-with-lease`, which makes it an
unwieldy `git push --force-with-lease --force-if-includes <refspec>`,
which admittedly not even _I_ type, and I really would benefit from this
option.

Maybe it is time to admit that `--force-if-includes` should imply
`--force-with-lease`, and then add `-F` as a shortcut?

Ciao,
Johannes

  reply	other threads:[~2021-03-04 12:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-02 12:35 Proposalö git push -F XonqNopp
2021-03-03  6:38 ` Junio C Hamano
2021-03-04 10:02   ` Johannes Schindelin [this message]
2021-08-24 10:23   ` Xavier Morel

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=nycvar.QRO.7.76.6.2103041045420.57@tvgsbejvaqbjf.bet \
    --to=johannes.schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=xonqnoppp@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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).