[darcs-users] Re: More on version management...

David Roundy droundy at abridgegame.org
Mon Mar 22 15:26:25 UTC 2004

On Mon, Mar 22, 2004 at 02:53:15PM +0000, Ian Lynagh wrote:
> [I've CCed the darcs list and (hopefully) set the reply-to header to just
> there. See http://www.abridgegame.org/mailman/listinfo/darcs-users for
> archives or subscribing.]
> On Mon, Mar 22, 2004 at 01:21:23PM +0000, Keith Wansbrough wrote:
> > Shae writes:
> > 
> > > From what I've seen on the mailing list, $Id and friends aren't
> > > likely, because of the design of darcs.[3].
> > > 
> > [..]
> > > [3]http://www.abridgegame.org/pipermail/darcs-users/2004-February/001089.html
> > 
> > This is fatal - I use $Id$ all the time.  We have some very large
> > specification documents that we control using CVS, and it is critical
> > when we read them that we know what version they are.  We do the LaTeX
> > equivalent of "set header to $Id$", and then all our documents are
> > versioned.
> > 
> > Having the version anywhere else but in the document itself would be
> > wrong, because they could get out of sync.

Well, it could be that darcs isn't for you.

By default, darcs doesn't have a name to give any particular version of a
repository, since the names of changes are associated with the change
itself rather than the version that results from that change.  Only if you
run the tag command is a name associated with a version.  It's possible to
tag after each record (there's not yet any way to automate this, but you
could create an alias to do so), but then your history will be cluttered
with an awful lot of tags.  I guess maybe that's not the end of the world.

> I'm told $Id$ expands to something like:
> $Id: Foo.hs,v 1.2 2003/03/04 03:22:34 myuser Exp $
> OTTOMH I think the tuple
>   (tagname (~= version), date of tag creation, e-mail address of tag creator)
> is unique and, along with the filename, is essentially the same
> information.

Yes, that is true, provided there haven't been any changes since the tag.

> To get around the modification of source files problem in Shae's URL
> perhaps "darcs flatten foo" or somesuch could be used to explicitly say
> "I'm taking foo away to print now so please expand $Id$ in it". It could
> complain if the current repo state isn't tagged (or prompt you for a name
> to tag it with) or if foo has unrecorded changes.

Then what happens when the user edits the flattened file? We would have to
parse it.  Yuck.  Then the next thing is that we have to support escaping
for people who want to include the literal string "$Id" in their files, and
then escaping of the escape...

I will concede that it might be nice to get version info without calling
darcs, but I think it would be better to have a configurably-named (how's
that for an ill-coined term?)  non-version-controlled file that just
contains the version information, and then let the user deal with it as he
or she likes (e.g. it could be \input into the latex file).  This could
also perhaps reasonably avoid the requirement of tagging, by printing both
the most recent tag, and all changes since that tag.

I imagine an interface something like

darcs setpref versionfile foo

which would have the result that a file name foo is created, and whenever a
record/pull/apply etc changes the repository, the "version" is written to a
file named foo.  The exact format would be a bit hard to determing, but I
imaging something like the human friendly output of darcs changes.
David Roundy

More information about the darcs-users mailing list