From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: What's cooking in git.git (Jul 2017, #03; Mon, 10)
Date: Thu, 13 Jul 2017 14:44:09 +0200 (CEST) [thread overview]
Message-ID: <alpine.DEB.2.21.1.1707131435220.4193@virtualbox> (raw)
In-Reply-To: <xmqqlgnv52oq.fsf@gitster.mtv.corp.google.com>
Hi Junio,
On Mon, 10 Jul 2017, Junio C Hamano wrote:
> * jc/allow-lazy-cas (2017-07-06) 1 commit
> - push: disable lazy --force-with-lease by default
>
> Because "git push --force-with-lease[=<ref>]" that relies on the
> stability of remote-tracking branches is unsafe when something
> fetches into the repository behind user's back, it is now disabled
> by default. A new configuration variable can be used to enable it
> by users who know what they are doing. This would pave the way to
> possibly turn `--force` into `--force-with-lease`.
>
> Will wait for feedback, then merge to and cook in 'next'.
I wonder whether the --force-with-lease option would benefit (and counter
the "unsafe because of behind-the-back operations" argument) from doing
some kind of "reverse pull --rebase".
In other words, --force-with-lease could verify that the upstream branch
has no commits that weren't seen in the current branch's reflog, i.e. that
`git rev-parse HEAD@{upstream}` is identical to `git merge-base
--fork-point HEAD HEAD@{upstream}`.
The assumption would be that you typically want to push with a lease only
when following the `pull --rebase` workflow. Meaning that you would only
want to force-push when your local branch had the upstream branch
integrated at some stage [*1*].
I could imagine, though, that this should be an opt-in option for now, and
could be turned into an opt-out option later. Or maybe just make it
opt-out, adding a kick-ass error message explaining the situation properly
(and how to override the safe-guard from the command-line).
Ciao,
Dscho
Footnote *1*: Of course, if you merge upstream, do some stuff and then
reset --hard to the previous state, this safeguard will not catch. It
would *still* catch when aborting a rebase onto upstream, though.
next prev parent reply other threads:[~2017-07-13 12:44 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-10 22:48 What's cooking in git.git (Jul 2017, #03; Mon, 10) Junio C Hamano
2017-07-11 8:28 ` Lars Schneider
2017-07-11 9:11 ` Jeff King
2017-07-11 9:18 ` Lars Schneider
2017-07-11 9:25 ` Jeff King
2017-07-11 15:55 ` Junio C Hamano
2017-07-11 15:50 ` Junio C Hamano
2017-07-13 12:44 ` Johannes Schindelin [this message]
2017-07-13 15:22 ` Junio C Hamano
2017-07-13 15:53 ` Jeff King
2017-07-13 16:32 ` Junio C Hamano
2017-07-13 17:51 ` Junio C Hamano
2017-07-13 18:13 ` Jeff King
2017-07-13 19:10 ` Junio C Hamano
2017-07-13 19:39 ` Junio C Hamano
2017-07-13 20:49 ` Jeff King
2017-07-13 21:24 ` 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=alpine.DEB.2.21.1.1707131435220.4193@virtualbox \
--to=johannes.schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.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).