monotone-devel
[Top][All Lists]
Advanced

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

Re: [Monotone-devel] Execute by default?


From: Nathaniel Smith
Subject: Re: [Monotone-devel] Execute by default?
Date: Thu, 15 Feb 2007 19:08:33 -0800
User-agent: Mutt/1.5.13 (2006-08-11)

On Fri, Feb 16, 2007 at 12:09:59PM +1100, William Uther wrote:
> Is there a neat way of making mtn mv and mtn rm execute by default?   
> Aliasing mtn to 'mtn -e' isn't quite right.  Is this the sort of  
> thing that should be in a lua hook?

Personally, it seems like the kind of thing we should just get right
by default, so no-one _wants_ to reconfigure it locally :-).

It seems like always "executing" is the Right Thing for
add/drop/rename/pivot_root/whatever-else-I'm-forgetting.  The only
reason we haven't made that the default is that in the special case of
'drop', it's dangerous -- you don't really want to just go deleting
some file that might have local changes, or maybe the user is dropping
it because they just added it by mistake and didn't actually want that
file to be versioned at all.

So, how can we make 'drop' safe?
  -- stash the deleted files somewhere, so we can still undo the
     operation (I tend to think some sort of similar undo
     functionality would be nice for 'revert' and 'update', too, but
     opinion is not unanimous :-).  And in any case this approach
     takes some design work).
  -- Refuse to run 'drop' unless it is safe -- i.e., all the files
     being dropped have previously been checked in, and have not been
     modified locally.  Provide some switch to say "drop this, but
     don't actually delete it from disk", that still works in this
     case.  (What should the switch be called?  --no-execute is rather
     confusing, it sounds like --dry-run.  There's probably prior art
     in other VCSes we can steal.  Or make it a separate command,
     e.g. 'mtn forget' = 'mtn drop --no-execute'.)  Provide a
     different switch to say "yes, I really mean it".
  -- Noisily but automatically downgrade to a "forget" type operation
     when it would be dangerous to actually delete.

Of these, the second looks the easiest and least annoying... though I
can certainly imagine it being annoying (and the "drop --really"
switch is annoyingly similar to the "rm -f" switch that everyone types
automatically without thinking).

-- Nathaniel

-- 
So let us espouse a less contested notion of truth and falsehood, even
if it is philosophically debatable (if we listen to philosophers, we
must debate everything, and there would be no end to the discussion).
  -- Serendipities, Umberto Eco




reply via email to

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