Re: Proposalö git push -F

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

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

> XonqNopp <xonqnoppp@xxxxxxxxx> 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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux