Re: [PATCH] push: add config option to --force-with-lease by default.
- From
Mike Rappazzo <rappazzo@gmail.com>
- Date
- Jul 5, 2017, 18:51 UTC
- Message-ID
- <CANoM8SXVYHfHqhf7oNfNUeDUWfpc9QGd8hvxu+g94aWEfQ1ZDQ@mail.gmail.com>
- In-Reply-To
- <EA42AB04-D538-4B4A-BC19-CAE9A80EEA76@mazzo.li>
On Wed, Jul 5, 2017 at 12:43 PM, Francesco Mazzoli <f@mazzo.li> wrote:
Show 33 quoted lines
>> On 5 Jul 2017, at 17:17, Junio C Hamano <gitster@pobox.com> wrote: >> >> The take-away lesson that the earlier thread gave me was that the >> order in which the three options are ranked by their desirebility >> in the UI (and the order we would like to encourage users to use) >> is, from the most to the least preferrable: >> >> - "--force-with-lease=<ref>:<expect>" that is safer than "--force"; >> >> - "--force" that is known to be dangerous, and does not pretend to >> be anything but; >> >> - "--force-with-lease" that pretends to be safer but is not. >> >> The last form should eventually be eliminated, as there is no way to >> correctly intuit what the expected object should be. > > What's not clear to me is what the intended workflow using > `--force-with-lease=<ref>:<expect>` is. Intuitively it seems extremely > cumbersome to manually pluck a revision each time, especially when > dealing with commits that all have the same description. > > On the other hand for my workflow `--force-with-lease` works quite well > because I tend to use it in cases where me and a colleague are working > on the same PR, and thus I'm not doing anything else (including fetching). > > Moreover, it seems to me that the problem `--force-with-lease` is > just one of marketing. `--force-with-lease` is strictly more "safe" > than `--force` in the sense that it'll reject some pushes that `--force` > will let through. I think that if we advertise it better including its > drawbacks it can still be better than no checks at all. > > Francesco
I am in your camp on this, and I will also only ever explicitly fetch. I would hate for --force-with-lease to disappear.
However, I believe that the problem is that there are many third party tools which do a fetch behind the scenes (for example Atlassian SourceTree). This can update the local refs without a user necessarily thinking about it. This can lead to a force-with-lease being used unsafely (without the stated lease).
_Mike