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

Tomasz Zielonka t.zielonka at students.mimuw.edu.pl
Mon Oct 25 07:57:01 UTC 2004


On Sat, Oct 23, 2004 at 12:45:02PM -0400, David Roundy wrote:
> 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!

I'm not sure about this. Wouldn't it mean that you _have_ to supply the
string, even if you don't want to? AFAICS, darcs doesn't support options
with optional arguments...?

> > 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... :)

If we predict that there will be more options like --disable that we
don't want to show in --help, perhaps we should make commands accept
some other --*-help option, for example --extended-help or
--defaults-help. We could add a flag to DarcsOption that would allow to
divide options in basic and extended ones.

We could also create a more powerfull help engine. For example, imagine
that every option was marked with categories, like selection, security,
verbosity, dangerous, defaults, .... The user could list options
belonging to a particular category. You could set in defaults which
categories of options are of interest, or of no interest, to you. You
could easily list commands that support a particular option.

However, maybe it could be an overkill to do it now and it may be seen
as introducing an unnecessary complexity (however, not that big IMO).
What do you think? It seems like a feature that should be strongly
marked as pre-1.0 or post-1.0.

I am willing to implement this if people think it is a good idea.

> > 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.

How about this:

There are some options which are meant specifically for use in
\verb!_darcs/prefs/defaults!. One of them is \verb!--disable!. As the
name suggests, this option will disable every command that got it as
argument. So, if you are afraid that you could damage your repositories
by inadvertant use of a command like rerecord, add the following line to
\verb!_darcs/prefs/defaults!:
\begin{verbatim}
unpull disable
\end{verbatim}

It would go into ArgumentDefaults.lhs before:
Also, a global preferences file can be created with the name

Best regards,
Tom

-- 
.signature: Too many levels of symbolic links




More information about the darcs-users mailing list