monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] to be recursive or non-recursive that is the questi


From: Thomas Keller
Subject: Re: [Monotone-devel] to be recursive or non-recursive that is the question
Date: Mon, 10 May 2010 23:10:00 +0200
User-agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; de; rv:1.9.1.9) Gecko/20100317 Lightning/1.0b2pre Thunderbird/3.0.4

Am 10.05.10 06:21, schrieb Derek Scherger:
> mtn add is non-recursive by default but allows for --recursive if you want
> it.
> mtn revert is recursive by default and doesn't allow for an obvious way of
> being non-recursive (I believe --depth=N will stop the recursion at the
> specified depth).
> 
> So, which is more dangerous (1) accidentally adding some files you didn't
> mean to add, or (2) accidentally reverting a bunch of changes you didn't
> mean to revert?
> 
> Recovering from (1) is easy, just revert the additions you don't want. Since
> revert is recursive this is no problem! ;)
> Recovering from (2) is ... not so easy. If you happen to have all the
> reverted files open in editor buffers you might be able to write them back
> out but any pending renames will be messed up badly.

I'm all for making revert non-recursive by default. While letting revert
acting recursively on the tree matches up with what f.e. subversion
does, it has always been a major headache for me to circumvent this with
dubious options, especially if directory attributes had to be reverted.

> There's an old branch net.venge.monotone.restrictions.wildcard-paths that
> once tried to add something like the foo/bar/... suffix that perforce uses
> to indicate recursive behaviour and perhaps we should consider doing this
> again. This might help clean up add, revert, status, diff, commit, etc. and
> allow the --depth option to be retired.
> 
> i.e.
> $ mtn add a # non-recursive
> $ mtn add a/... # recusive
> 
> $ mtn revert a # non-recursive
> $ mtn revert a/... # recursive
> 
> I'm not sure how we'd represent a recursive revert of the entire workspace,
> maybe 'mtn revert ...' or something.

This is actually a nice idea - though we probably have to prohibit file
names like "^\.{3,}" for that to work properly. It would certainly help
/ avoid the code clutter we have with the various --depth, --recursive
and so on option code.

Thomas.

-- 
GPG-Key 0x160D1092 | address@hidden | http://thomaskeller.biz
Please note that according to the EU law on data retention, information
on every electronic information exchange might be retained for a period
of six months or longer: http://www.vorratsdatenspeicherung.de/?lang=en

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]