[darcs-users] Re: Browsing the repository from the command line

David Roundy droundy at abridgegame.org
Wed Mar 3 12:31:30 UTC 2004


On Tue, Mar 02, 2004 at 08:37:38AM -0800, Kenneth Knowles wrote:
> 
> If it isn't too high priority, I'd love to work on this.  It would be my
> first non-toy programming in Haskell, so I might be a bit slow.

Sounds good to me.  If you expect to take more than a month or two, then
I'd say you should perhaps let me (or someone else do it), but that seems
unlikely to me.

> Then would the process be something like the following?
> 
> $ darcs changes --repodir http://www.abridgegame.org/darcs
> [List of patch names]
> $ darcs show --repodir http://www.abridgegame.org/darcs '[New patch I'm interested in]'
> [Changes]
> $ darcs pull --patch-name='[New patch I'm interested in]'

Well, the first command is now implemented already, and --repodir should be
--repo in both the first and second commands (since they will accept either
URLs or directories), but other than that it seems right.

Here's my "quickly create a command that does nothing" advice:

Darcs has a pseudo-almost-object-oriented way of dealing with its commands
that allows new commands to be pretty easily (you'll perhaps be the test of
just *how* easily...) defined that will then have consistent behavior, show
up in the man page, etc.  This infrastructure is defined in
DarcsCommands.lhs, and the flag infrastructure in DarcsArguments.lhs (as
one might guess.

You can create a command by taking a simple existing command (revert comes
to mind) and copying it into something like "ShowCommand.lhs" (I'd avoid
Show, because of the existing haskell class named that).  Rename all
instances of revert appropriately, perhaps take out the guts of revert_cmd,
add the command to the GNUMakefile and to TheCommands.lhs and recompile.
Your new "show" command should show up in the man page (if you remade it),
in darcs --help and in "darcs show --help".  Oh yeah, and you should add an
\input statement to darcs.lhs so the new command shows up in the
documentation as well.

If you have any troubles or questions, don't hesitate to ask.  You are
welcome to push intermediate patches (for exampl, after you've done the
above, and have defined a "show" command that does nothing), as long as
they don't contain any nasty bugs.  If you do so, I'll be happy to provide
feedback.
-- 
David Roundy
http://www.abridgegame.org




More information about the darcs-users mailing list