[PATCH V2] status: add terse option flag (issue4119)

Ryan McElroy rm at fb.com
Wed Oct 14 18:52:20 CDT 2015


On 10/14/2015 3:53 PM, Sean Farley wrote:
> Ryan McElroy <rm at fb.com> writes:
>
>> On 10/14/2015 7:20 AM, Pierre-Yves David wrote:
>>>
>>> On 10/13/2015 02:46 PM, Sean Farley wrote:
>>>> # HG changeset patch
>>>> # User Sean Farley <sean at farley.io>
>>>> # Date 1427261050 25200
>>>> #      Tue Mar 24 22:24:10 2015 -0700
>>>> # Node ID 93173ffbe421307efe9cae4404587a541a826ee7
>>>> # Parent  a38924f7680c6b7d95e14ade999c35748c9dcafd
>>>> status: add terse option flag (issue4119)
>>> I really like the idea and think we should move forward on this topic.
>>> However there is likely some testing and discussion required. Can we
>>> flag the command switch as EXPERIMENTAL so that we have option to
>>> adjust this in the next cycle?

Agree. See below for why.

>>>
>>>> Based on an idea by Martin Geisler, this patch adds the ability to
>>>> abbreviate
>>>> the ouput of status by only listing the parent directory for multiple
>>>> files. By
>>>> default, we do this for all status types but control this through the
>>>> experimental.terse option.
>>>>
>>>> Future work could speed up status operations even further by skipping
>>>> disk
>>>> operations based on this config.
>>>>
>>>> For example, imagine we have the following output of status:
>>>>
>>>> $ hg st
>>>> A mercurial/adddir/a
>>>> A mercurial/adddir/b
>>>> A mercurial/adddir/c
>>>> ? bar
>>>> ? baz
>>>> ? foo/subdir/a
>>>> ? foo/subdir/b
>>>> ? foo/subdir/c
>>>> ? foo/x
>>>> ? foo/y
>>>> ? mercurial/subdir/a
>>>> ? mercurial/subdir/b
>>>> ? mercurial/subdir/c
>>>> ? ugh/x
>>>>
>>>> without any configuration, we get:
>>>>
>>>> $ hg st -t
>>>> A mercurial/adddir/
>>>> ? bar
>>>> ? baz
>>>> ? foo/
>>>> ? mercurial/subdir/
>>>> ? ugh/x
>> Why do we get ugh/x and not just ugh/ ?
> Because there is only one file.

Dislike this choice, but I'm open to discussion.

>> If not all files in  mercurial/adddir/a was not added (ie, only some
>> files were added, what does the output look like?)
> (let's assume there are four files: two added and two unknown) There
> would be two entries in the output:
>
> A mercurial/adddir/
> ? mercurial/adddir/

I find this surprising and unexpected. I think it makes sense to keep 
this experimental until we've hashed out some of these details, but I 
definitely like the overall direction.

>>>> and with some config knobs, we get:
>>>>
>>>> $ hg st -t --config experimental.terse='?'
>> This config option is poorly named -- I have no idea what to expect it
>> to do (I had to read the code).
>>
>> Perhaps better: experimental.tersestatuses='?'
> Sure.
>
>>>> But, this has a downside of not working as desired with relative paths:
>>>>
>>>> $ hg st -t re:
>>>> A mercurial/adddir/a
>>>> A mercurial/adddir/b
>>>> A mercurial/adddir/c
>>>> ? bar
>>>> ? baz
>>>> ? foo/subdir/a
>>>> ? foo/subdir/b
>>>> ? foo/subdir/c
>>>> ? foo/x
>>>> ? foo/y
>>>> ? mercurial/subdir/a
>>>> ? mercurial/subdir/b
>>>> ? mercurial/subdir/c
>>>> ? ugh/x
>> What about for the '' filematcher? (eg, hg status ''). Does that also
>> fail to be tersified?
> Yep.
>
>> What would it take to make this work?
> Probably not too much work but this code has bit rotted for a long time
> in my head. We could probably hammer it out at the sprint if there's
> free time.

Sounds good!


More information about the Mercurial-devel mailing list