[darcs-devel] A forwarded darcs patch

David Roundy droundy at abridgegame.org
Sat Jul 3 08:06:21 PDT 2004


On Sat, Jul 03, 2004 at 03:24:28PM +0100, Ian Lynagh wrote:
> On Sat, Jun 26, 2004 at 05:49:20AM -0400, David Roundy wrote:
> > Secondly, I'd prefer to use get_preflist to do the repo dir reading, just
> > in case some day I change the repository format.
> 
> Sounds good; sorry, I'm not familiar with much of the darcs code yet
> :-(

No problem.

> > Thirdly, it would be nice to use the existing prefs/repos repos file (which
> 
> What's that currently used for?
> 
> A line "foo bar/" could meant the named repo bar/ or the unnamed repo
> "foo bar/". If the current contents are always fully qualified then this
> is less of an issue, though, as you are unlikely to want to name a repo
> something beginning with "/", "http://" etc.

I don't think we need to worry about supporting URLs that begin with a ' '
character, and certainly don't think we want to support names having
spaces.  So I'd say we could define the "name" to be everything before the
first space, unless there is no space, in which case it is unnamed.  The
URL would then be everything after the first space (or everything on the
line).  Probably we'd want to allow multiple spaces between the name and
URL.

Then I'd prefer to have new entries which are added to repos be added with
an initial space, indicating that they have no name (and allowing the URL
itself to have a space).

> > requires care to make sure it works with both named and unnamed repos),
> > and make repository name command completion work right with both named
> > and unnamed repos.  (see the instances of command_get_arg_possibilities
> > = get_preflist "repos").
> 
> Oh, I guess that's the answer to my question. I think it would be nicer
> for the user for them to be separate, and also I imagine make it easier
> to write easily understandable command completion code.

Hmmm.  I guess this is a matter of perspective.  I would prefer to just add
names to already existing URLs.

As for as the ease of writing the command completion code, it's equally
easy either way, as the relevant command completion code is in darcs
itself--and is just the output of

darcs COMMAND --list-options

> > Fourthly, it would be nice to either extend get_preflist itself to also
> > read from ~/.darcs/ (and give the output of both the file in ~/.darcs
> > and the one in _darcs/prefs), or to add another function
> > get_global_preflist, which would read from ~/.darcs/.
> 
> This would definitely be useful to me for things like author (although
> you may prefer to give the global one as a default value rather than
> automatically using it), which I don't think it currently possible?

I had a bit of trouble parsing that sentance.  You can add

ALL author droundy at abridgegame.org

to ~/.darcs/defaults

which would have the effect of making me the author of every patch you
record unless you give an --author flag manually.  This is probably
slightly better than putting the author file in ~/.darcs/.

> > Or a get_all_preflist.  This would allow users to define their
> > repository names just once, and would also allow us to use named
> > repositories with get, which could be handy.
> 
> I'm less convinced of this. The reason I want named repos is so I can
> have repos called stable, devel, jim and bob, but I will have repos
> called all of those for all my projects.
> 
> Hmm, I guess one could have project names as named repos globally.

Yes, you could have both sorts of names.  I reasonably often want to "get"
from http://abridgegame.org/repos/darcs, for example to check if there are
permissions problems, or to test that get --partial is still working
right.  Of course, local gets are very common, but my local repo paths are
small enough that naming them would be silly.

> > If you don't want to do (or don't have time to do) any of these changes,
> > let me know...
> 
> Please feel free to do them if you also think they are useful, but if
> no-one else is motivated I will do so soon  :-)

Ok.  Sounds good to me!
-- 
David Roundy
http://www.abridgegame.org




More information about the darcs-devel mailing list