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

David Roundy droundy at abridgegame.org
Tue Mar 2 14:35:12 UTC 2004


On Mon, Mar 01, 2004 at 07:39:38PM +0100, Samuel Tardieu wrote:
> >>>>> "Kenneth" == Kenneth Knowles <kknowles at uclink.berkeley.edu> writes:
> 
> Kenneth> The request is a command 'darcs list' which would show the
> Kenneth> available patches from a remote repo.  Once I know a patch
> Kenneth> name I can view the changes with 'darcs changes', or I can
> Kenneth> browse through available patches with 'darcs pull' and just
> Kenneth> not apply them.  But I'd really like to run a command that
> Kenneth> would list the patches and I could browse them

> If you want to see all the patches, regardless of what you have
> locally, you could extend the "changes" command with a "--repo"
> argument.

This sounds like a nice idea to me, so I just implemented it (it was pretty
easy... changes is pretty simple).  There is a potentially annoying bug
left, which is that you still can't run changes unless your current
directory is in a darcs repository.

> If you want to browse all unapplied patches, you could extend "darcs
> pull" with a "--browse".

Hmmmm.  This is what I currently do if I want to see what patches could be
pushed or pulled, but it seems ugly.  Perhaps either a pair of new commands
list-pushable and list-pullable? That's not pretty either... I'm not sure
what the best interface is.  One could add a whatchanged command, or a
"compare" (but that would be confusing with diff).  I'm not sure what the
best interface here would be.

> Kenneth> ... Once I know a patch name I can view the changes with
> Kenneth> 'darcs changes'...

I think you are not clear as to what changes does... it just lists the
changes by name.  Currently there is no command to display a patch, which
is a hole in the interface.  I think probably adding a command like "show"
would be good.  I envision something like

$ darcs show 'first debian upload'
hunk ./GNUmakefile 38
+GHCFLAGS += -Wall
+
hunk ./debian/changelog 1
+darcs (0.9.17-1) unstable; urgency=low
+
+  * First upload to Debian.
+  * New upstream release.
+  * Added -Wall to ghc flags.
+  * Added NEWS.
+  * New Maintainer.
+
+ -- Isaac Jones <ijones at debian.org>  Sat, 21 Feb 2004 16:47:48 -0500
+
hunk ./debian/control 4
-Maintainer: David Roundy <droundy at abridgegame.org>
+Maintainer: Isaac Jones <ijones at debian.org>
}

Kenneth, you're welcome to work on this if you like.  It shouldn't be too
hard and would give you an opportunity to see how to add a new darcs
command.  If you don't want to do so, let me know, and eventually I'll get
around to it.  If you do work on this, you'd definitely want to support the
--unified flag, which would involve using contextualPrintPatch.

You could also work on a list-pushable command, or something like that.
The controversial part would be the name, and that is easy to change later.
I guess the other hard part is figuring out what exactly the interface
should be--two commands, one to list patches I have that they don't have
and one for the reverse, or a single command that somehow lists both
patches I have locally and patches they have that I'm lacking.  Hmmm.
Perhaps more discussion is needed, since I don't see the right way to do
it, and I guess most likely you don't either...
-- 
David Roundy
http://www.abridgegame.org




More information about the darcs-users mailing list