Patchwork [RFC] strip: add -C as alternative to --no-backup

login
register
mail settings
Submitter David Demelier
Date Feb. 24, 2016, 8:04 a.m.
Message ID <0d235ba100ff229bdd01.1456301078@Gentoo>
Download mbox | patch
Permalink /patch/13339/
State Rejected
Headers show

Comments

David Demelier - Feb. 24, 2016, 8:04 a.m.
# HG changeset patch
# User David Demelier <demelier.david@gmail.com>
# Date 1456300657 -3600
#      Wed Feb 24 08:57:37 2016 +0100
# Node ID 0d235ba100ff229bdd012d15a6141599fae14835
# Parent  91a827e760df9d9b3d86692c5aa195a3d6ba2208
strip: add -C as alternative to --no-backup

Various commands have -C as synonym of "clean" or "no-backup", add this to
strip.

Examples:

hg revert -C
hg update -C
Sean Farley - Feb. 24, 2016, 8:06 a.m.
David Demelier <demelier.david@gmail.com> writes:

> # HG changeset patch
> # User David Demelier <demelier.david@gmail.com>
> # Date 1456300657 -3600
> #      Wed Feb 24 08:57:37 2016 +0100
> # Node ID 0d235ba100ff229bdd012d15a6141599fae14835
> # Parent  91a827e760df9d9b3d86692c5aa195a3d6ba2208
> strip: add -C as alternative to --no-backup
>
> Various commands have -C as synonym of "clean" or "no-backup", add this to
> strip.
>
> Examples:
>
> hg revert -C
> hg update -C

For what it's worth, I kinda like the direction of this short option.
David Soria Parra - Feb. 24, 2016, 4:52 p.m.
O Wed, Feb 24, 2016 at 09:04:38AM +0100, David Demelier wrote:
> # HG changeset patch
> # User David Demelier <demelier.david@gmail.com>
> # Date 1456300657 -3600
> #      Wed Feb 24 08:57:37 2016 +0100
> # Node ID 0d235ba100ff229bdd012d15a6141599fae14835
> # Parent  91a827e760df9d9b3d86692c5aa195a3d6ba2208
> strip: add -C as alternative to --no-backup
> 
> Various commands have -C as synonym of "clean" or "no-backup", add this to
> strip.

I think specificing to not have a backup of your commits (something you explicitly wanted
to store in Mercurial) should be very explicit. It's slightly different from clean
as it existed in histroy once. Not making a backup should be very deliberate and adding
a short option to something hopefully barely used seems dangerous to be accidentally mistyped.

Also the short option hides the fact that you are throwing away work without any chances of
recovery. The naming "no-backup" is pretty explicit.
David Demelier - Feb. 24, 2016, 4:55 p.m.
Le 24/02/2016 17:52, David Soria Parra a écrit :
> O Wed, Feb 24, 2016 at 09:04:38AM +0100, David Demelier wrote:
>> # HG changeset patch
>> # User David Demelier <demelier.david@gmail.com>
>> # Date 1456300657 -3600
>> #      Wed Feb 24 08:57:37 2016 +0100
>> # Node ID 0d235ba100ff229bdd012d15a6141599fae14835
>> # Parent  91a827e760df9d9b3d86692c5aa195a3d6ba2208
>> strip: add -C as alternative to --no-backup
>>
>> Various commands have -C as synonym of "clean" or "no-backup", add this to
>> strip.
> I think specificing to not have a backup of your commits (something you explicitly wanted
> to store in Mercurial) should be very explicit. It's slightly different from clean
> as it existed in histroy once. Not making a backup should be very deliberate and adding
> a short option to something hopefully barely used seems dangerous to be accidentally mistyped.
>
> Also the short option hides the fact that you are throwing away work without any chances of
> recovery. The naming "no-backup" is pretty explicit.

I understand your point of view but just using strip is dangerous. It's 
the same case for hg revert, once you've reverted the file there is no 
way to recover it.

I would like to see this option for more consistency.
Augie Fackler - Feb. 24, 2016, 9:47 p.m.
On Wed, Feb 24, 2016 at 12:06:21AM -0800, Sean Farley wrote:
>
> David Demelier <demelier.david@gmail.com> writes:
>
> > # HG changeset patch
> > # User David Demelier <demelier.david@gmail.com>
> > # Date 1456300657 -3600
> > #      Wed Feb 24 08:57:37 2016 +0100
> > # Node ID 0d235ba100ff229bdd012d15a6141599fae14835
> > # Parent  91a827e760df9d9b3d86692c5aa195a3d6ba2208
> > strip: add -C as alternative to --no-backup
> >
> > Various commands have -C as synonym of "clean" or "no-backup", add this to
> > strip.
> >
> > Examples:
> >
> > hg revert -C
> > hg update -C
>
> For what it's worth, I kinda like the direction of this short option.

I'm -0 on it. Strip is a bad, destructive thing, and I don't think we
should make it any easier to not have backups.

(-0: I won't block it, but if it were just up to me I'd reject this.)

> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Pierre-Yves David - Feb. 24, 2016, 11 p.m.
On 02/24/2016 10:47 PM, Augie Fackler wrote:
> On Wed, Feb 24, 2016 at 12:06:21AM -0800, Sean Farley wrote:
>>
>> David Demelier <demelier.david@gmail.com> writes:
>>
>>> # HG changeset patch
>>> # User David Demelier <demelier.david@gmail.com>
>>> # Date 1456300657 -3600
>>> #      Wed Feb 24 08:57:37 2016 +0100
>>> # Node ID 0d235ba100ff229bdd012d15a6141599fae14835
>>> # Parent  91a827e760df9d9b3d86692c5aa195a3d6ba2208
>>> strip: add -C as alternative to --no-backup
>>>
>>> Various commands have -C as synonym of "clean" or "no-backup", add this to
>>> strip.
>>>
>>> Examples:
>>>
>>> hg revert -C
>>> hg update -C
>>
>> For what it's worth, I kinda like the direction of this short option.
>
> I'm -0 on it. Strip is a bad, destructive thing, and I don't think we
> should make it any easier to not have backups.
>
> (-0: I won't block it, but if it were just up to me I'd reject this.)

While I salute the consistency in the short option (if we were to have 
one, that would be it), I agree with Augie here. I'm not eager to make 
foot-gun easier. (so -0 too)
Pierre-Yves David - March 9, 2016, 3:15 p.m.
On 02/24/2016 08:04 AM, David Demelier wrote:
> # HG changeset patch
> # User David Demelier <demelier.david@gmail.com>
> # Date 1456300657 -3600
> #      Wed Feb 24 08:57:37 2016 +0100
> # Node ID 0d235ba100ff229bdd012d15a6141599fae14835
> # Parent  91a827e760df9d9b3d86692c5aa195a3d6ba2208
> strip: add -C as alternative to --no-backup

The majority of people who expressed opinion (3 out of 4, including 2 
co-maintainer) where not in favor of this short option. Let's consider 
this rejected. I'm droppping it from patchwork.

Cheers

Patch

diff -r 91a827e760df -r 0d235ba100ff hgext/strip.py
--- a/hgext/strip.py	Sun Feb 14 01:33:55 2016 +0900
+++ b/hgext/strip.py	Wed Feb 24 08:57:37 2016 +0100
@@ -83,7 +83,7 @@ 
                                'option)'), _('REV')),
           ('f', 'force', None, _('force removal of changesets, discard '
                                  'uncommitted changes (no backup)')),
-          ('', 'no-backup', None, _('no backups')),
+          ('C', 'no-backup', None, _('no backups')),
           ('', 'nobackup', None, _('no backups (DEPRECATED)')),
           ('n', '', None, _('ignored  (DEPRECATED)')),
           ('k', 'keep', None, _("do not modify working directory during "