git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Ævar Arnfjörð Bjarmason" <avarab@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: "Scott Johnson" <jaywir3@gmail.com>,
	git@vger.kernel.org, "Constantin Weißer" <i7c@posteo.de>
Subject: Re: Would a config var for --force-with-lease be useful?
Date: Mon, 27 Aug 2018 21:40:57 +0200	[thread overview]
Message-ID: <87o9dnegxi.fsf@evledraar.gmail.com> (raw)
In-Reply-To: <xmqqin3vk3yv.fsf@gitster-ct.c.googlers.com>


On Mon, Aug 27 2018, Junio C Hamano wrote:

> 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.

Last year there was a proposal for such a patch in:
https://public-inbox.org/git/1499116727-757-1-git-send-email-f@mazzo.li/

This was after/during a long discussion starting with:
https://public-inbox.org/git/CACBZZX7MeX-6RHgh2Fa9+YL03mjxs8xmyE86HnVxBxjMYizcig@mail.gmail.com/

It appears the only patch that got in from that discussion was my
f17d642d3b ("push: document & test --force-with-lease with multiple
remotes", 2017-04-19) (https://github.com/git/git/commit/f17d642d3b)

I still think something like such a config variable would be useful, as
noted in https://public-inbox.org/git/8760f4bmig.fsf@gmail.com/ Junio
voiced similar objections at the time.

It would be great to have some patch like this for consideration, but
give that thread a read first to see what some of the objections were /
various points raised for/against doing that.

  reply	other threads:[~2018-08-27 19:41 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
2018-08-27 19:40   ` Ævar Arnfjörð Bjarmason [this message]
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

  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=87o9dnegxi.fsf@evledraar.gmail.com \
    --to=avarab@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=i7c@posteo.de \
    --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.
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).