[darcs-users] Re: Suggestion: track patch origin metadata (patch)

David Roundy droundy at abridgegame.org
Sat Oct 23 16:45:02 UTC 2004


On Fri, Oct 22, 2004 at 11:26:14PM +0200, Tomasz Zielonka wrote:
> On Fri, Oct 22, 2004 at 05:53:15PM +0000, Mark Stosberg wrote:
> > On 2004-10-22, Tomasz Zielonka <t.zielonka at students.mimuw.edu.pl> wrote:
> > >
> > > _darcs/prefs/defaults could be used for that, if only there would be a
> > > suitable option that disables a command. You would have a defaults
> > > file like this:
> > >
> > > unpull	  disable
> > > unrecord    disable
> > > rerecord    disable
> > >
> > > What do you think? Seems simple and elegant.
> > 
> > I like it. 

Me too.  :)

> Initial implementation is in the attachment. 

Looks nice.

> I think there should be a dual --enable option or something to be able
> to manually override defaults, but let's see if this will be accepted
> into darcs at all.

I'm not so sure.  I like the idea that --disable can be trusted to actually
disable the command.  So, for example, if you could keep a user from
modifying _darcs/prefs/defaults, you could disable commands you don't want
to allow and then use sudo to let him run darcs, and not worry about him
using --enable to override your policy.

Perhaps we could add another overrideable option... I envision something
like --deprecate (only that's a bad name...).  I imagine an option that
would cause darcs to print out a warning and prompt if you really want to
go through with it.

Another idea is that we could add a string option to the disable flag,
which would be a message to be printed out.  So then defaults would read:

unpull disable David doesn't allow unpulling because it's bad!

And the failure would be something like

Command 'unpull' has been disabled using --disable, because:

    David doesn't allow unpulling because it's bad!

> Also, I am not sure it should be listed in --help, because it is not
> particularly useful outside of _darcs/prefs/defaults.

Agreed.  Definitely doesn't belong in --help... although I'm not sure I
like the precedent of accepting flags that aren't listed in --help.  I hope
you appreciate my decisiveness... :)

> Moreover, it is probably not useful in commands that can be used outside
> of a repository, like get, etc.

Well, if could be stuck in ~/.darcs/defaults, although I'm not sure why
you'd ever want to disable initialize...

> > I still think there is some benefit to partially disable these, as I
> > outlined in my original case. 
> 
> Regarding your orig_here proposition, I think it shouldn't be included
> in the patch itself, only as a pref-like additional information in the
> repository, ie. _darcs/somewhere/originating

Agreed.

> Every {\tt COMMAND} accepts the \verb!--disable! option, which can be
> used in \verb!_darcs/prefs/defaults! to disable some commands in the
> repository. This can be helpful if you want to protect the repository
> from accidential use of advanced commands like unpull, unrecord or
> rerecord.

This documentation is nice, as far as it goes, but I think it would a good
idea to also add a paragraph in configuring_darcs.tex, since that's where
people will be looking when they want to find out how to set up their
repositories.
-- 
David Roundy
http://www.abridgegame.org




More information about the darcs-users mailing list