You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Oliver Lietz <ap...@oliverlietz.de> on 2018/01/23 12:20:39 UTC

Git force push

Hi,

can we have a simple rule (allow vs deny) for git push --force?

Thanks,
O.


Re: Git force push

Posted by Stefan Egli <st...@apache.org>.
I just stumbled upon a problem where I did a commit with a wrong author
email (in SLING-7407) and "thanks" to force push I was able to correct
this. Not saying it is a good idea to do this often though .. ;)

Cheers,
Stefan

On 23.01.18, 13:26, "Radu Cotescu" <ra...@apache.org> wrote:

>Hi Oliver,
>
>Shouldn't we *never* allow force push?
>
>Cheers,
>Radu
>
>On Tue, 23 Jan 2018 at 14:20 Oliver Lietz <ap...@oliverlietz.de> wrote:
>
>> Hi,
>>
>> can we have a simple rule (allow vs deny) for git push --force?
>>
>> Thanks,
>> O.
>>
>>



Re: Git force push

Posted by Radu Cotescu <ra...@apache.org>.
Hi Oliver,

Shouldn't we *never* allow force push?

Cheers,
Radu

On Tue, 23 Jan 2018 at 14:20 Oliver Lietz <ap...@oliverlietz.de> wrote:

> Hi,
>
> can we have a simple rule (allow vs deny) for git push --force?
>
> Thanks,
> O.
>
>

Re: Git force push

Posted by Robert Munteanu <ro...@apache.org>.
Hi,

On Tue, 2018-01-23 at 15:05 +0100, Stefan Egli wrote:
> Sounds like a good idea to start with disallowing --force for now,
> given
> there is --force-with-lease for emergencies. The unfortunate bit is
> perhaps that this opens up a way to modify history without noticing
> (which
> is what I've used it for too).

My impression is that --force-with-lease is entirely a client-side
setting, which means that we can't protect against accidents by
disabling it on GitHub, we can only document it as a convention.

Robert

Re: Git force push

Posted by Stefan Egli <st...@apache.org>.
Sounds like a good idea to start with disallowing --force for now, given
there is --force-with-lease for emergencies. The unfortunate bit is
perhaps that this opens up a way to modify history without noticing (which
is what I've used it for too).

Cheers,
Stefan

On 23.01.18, 14:59, "Jason Bailey" <Ja...@sas.com> wrote:

>The methodology with GIT is usually around never committing anything
>directly to master, rather branch and merge. Internally I have our github
>projects set up to prevent force pushes to master and to allow it on
>branches so that the developer working on that branch has the option of
>fixing things if there is an oops
>
>I haven't seen the -force-with-lease before so I can't say how well it
>works, but that has definitely jumped to the top of my "commands to now
>use"
>
>-----Original Message-----
>From: Bertrand Delacretaz [mailto:bdelacretaz@apache.org]
>Sent: Tuesday, January 23, 2018 8:49 AM
>To: dev <de...@sling.apache.org>
>Subject: Re: Git force push
>
>EXTERNAL
>
>On Tue, Jan 23, 2018 at 2:33 PM, Stefan Seifert <ss...@pro-vision.de>
>wrote:
>> i would also vote for *not* allowing push --force..
>
>+1, my understanding is that one can destroy history with that...which
>we don't want.
>
>I have never used --force-with-lease so far but according to [1] it only
>allows you to force-push if no-one else has pushed changes up to the
>remote in the interim.
>
>If that's correct (does anyone have experience with it?) I'd be in favor
>of allowing --force-with-lease but not --force. With our many
>repositories we often have a single committer working on a given
>repository for some time, in which case --force-with-lease could help,
>apparently.
>
>-Bertrand
>
>[1] https://developer.atlassian.com/blog/2015/04/force-with-lease/



RE: Git force push

Posted by Jason Bailey <Ja...@sas.com>.
The methodology with GIT is usually around never committing anything directly to master, rather branch and merge. Internally I have our github projects set up to prevent force pushes to master and to allow it on branches so that the developer working on that branch has the option of fixing things if there is an oops

I haven't seen the -force-with-lease before so I can't say how well it works, but that has definitely jumped to the top of my "commands to now use"

-----Original Message-----
From: Bertrand Delacretaz [mailto:bdelacretaz@apache.org] 
Sent: Tuesday, January 23, 2018 8:49 AM
To: dev <de...@sling.apache.org>
Subject: Re: Git force push

EXTERNAL

On Tue, Jan 23, 2018 at 2:33 PM, Stefan Seifert <ss...@pro-vision.de> wrote:
> i would also vote for *not* allowing push --force..

+1, my understanding is that one can destroy history with that...which
we don't want.

I have never used --force-with-lease so far but according to [1] it only allows you to force-push if no-one else has pushed changes up to the remote in the interim.

If that's correct (does anyone have experience with it?) I'd be in favor of allowing --force-with-lease but not --force. With our many repositories we often have a single committer working on a given repository for some time, in which case --force-with-lease could help, apparently.

-Bertrand

[1] https://developer.atlassian.com/blog/2015/04/force-with-lease/

Re: Git force push

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Tue, Jan 23, 2018 at 2:33 PM, Stefan Seifert <ss...@pro-vision.de> wrote:
> i would also vote for *not* allowing push --force..

+1, my understanding is that one can destroy history with that...which
we don't want.

I have never used --force-with-lease so far but according to [1] it
only allows you to force-push if no-one else has pushed changes up to
the remote in the interim.

If that's correct (does anyone have experience with it?) I'd be in
favor of allowing --force-with-lease but not --force. With our many
repositories we often have a single committer working on a given
repository for some time, in which case --force-with-lease could help,
apparently.

-Bertrand

[1] https://developer.atlassian.com/blog/2015/04/force-with-lease/

RE: Git force push

Posted by Stefan Seifert <ss...@pro-vision.de>.
i would also vote for *not* allowing push --force

stefan

>-----Original Message-----
>From: Oliver Lietz [mailto:apache@oliverlietz.de]
>Sent: Tuesday, January 23, 2018 1:21 PM
>To: dev@sling.apache.org
>Subject: Git force push
>
>Hi,
>
>can we have a simple rule (allow vs deny) for git push --force?
>
>Thanks,
>O.
>