Re: Git force push

2018-01-23 Thread Radu Cotescu
Hi Oliver,

Shouldn't we *never* allow force push?

Cheers,
Radu

On Tue, 23 Jan 2018 at 14:20 Oliver Lietz  wrote:

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


Re: Git force push

2018-01-23 Thread Stefan Egli
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"  wrote:

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




RE: Git force push

2018-01-23 Thread Stefan Seifert
i would also vote for *not* allowing push --force

stefan

>-Original Message-
>From: Oliver Lietz [mailto:apa...@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.
>




Re: Git force push

2018-01-23 Thread Bertrand Delacretaz
On Tue, Jan 23, 2018 at 2:33 PM, Stefan Seifert  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

2018-01-23 Thread Jason Bailey
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:bdelacre...@apache.org] 
Sent: Tuesday, January 23, 2018 8:49 AM
To: dev 
Subject: Re: Git force push

EXTERNAL

On Tue, Jan 23, 2018 at 2:33 PM, Stefan Seifert  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

2018-01-23 Thread Stefan Egli
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"  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:bdelacre...@apache.org]
>Sent: Tuesday, January 23, 2018 8:49 AM
>To: dev 
>Subject: Re: Git force push
>
>EXTERNAL
>
>On Tue, Jan 23, 2018 at 2:33 PM, Stefan Seifert 
>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

2018-01-23 Thread Robert Munteanu
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