[darcs-users] annotate output (Was: machine-readable formats)

Eric Kow kowey at darcs.net
Sat Sep 4 10:38:23 UTC 2010

Mostly playing librarian again.

On Sat, Sep 04, 2010 at 06:32:57 +0000, Jason Dagit wrote:
> Is it possible for us to match git-annotate?  I think the hurdle here
> is that they give hashes in their output.  I'm not sure if they are
> change hashes or tree hashes.  The feasibility of matching git depends
> on which one it is, I think.

So, it seems the discussion has partly shifted to human-readable
annotate.  Looks like interesting stuff.

Here's the ticket for readable annotate output: http://bugs.darcs.net/issue25
It has a two digit number in a day where issue2000 is fast approaching.

It looks like the output advocated was from git blame (which I
think is also what Jason is suggesting), and that Benedikt was
showing me this page:

$ git blame sha1_file.c
0fcfd160 (Linus Torvalds  2005-04-18 13:04:43 -0700    8)  */
0fcfd160 (Linus Torvalds  2005-04-18 13:04:43 -0700    9) #include "cache.h"
1f688557 (Junio C Hamano  2005-06-27 03:35:33 -0700   10) #include "delta.h"
a733cb60 (Linus Torvalds  2005-06-28 14:21:02 -0700   11) #include "pack.h"
8e440259 (Peter Eriksen   2006-04-02 14:44:09 +0200   12) #include "blob.h"
8e440259 (Peter Eriksen   2006-04-02 14:44:09 +0200   13) #include "commit.h"
8e440259 (Peter Eriksen   2006-04-02 14:44:09 +0200   14) #include "tag.h"
8e440259 (Peter Eriksen   2006-04-02 14:44:09 +0200   15) #include "tree.h"
f35a6d3b (Linus Torvalds  2007-04-09 21:20:29 -0700   16) #include "refs.h"
70f5d5d3 (Nicolas Pitre   2008-02-28 00:25:19 -0500   17) #include "pack-revindex.h"628522ec (Junio C Hamano   

Also, our last sprint report [1] said "Taking a page from git blame, there
will be one line per source file line, with columns for patch
identifier, author name, date and finally the line. One of the design
questions was how we should best refer to darcs patches, the current
best candidate being a prefix of the darcs patch metadata hash."
-- http://blog.darcs.net/2010/03/darcs-hacking-sprint-4-report.html

As for the patch info hash prefix (see http://wiki.darcs.net/Hashes ),
this hash is produced in Darcs.Patch.Info.makeFileName and seems
to use three sections: timestamp, author hash, actual patchinfo hash, as
an example:


I guess we could use a prefix of the third segment, so continuing that


We originally had an idea of intelligently picking the smallest prefix
that would be unambiguous for a given local repository, but I think
Ganesh has recently pointed out on IRC that maybe just going for
uniformly chars could be a better alternative.  (I speculate because
a repo-local criterion of ambiguity would be misleading as the user
could try to use the prefix elsewhere, uniform behaviour is nice, and
also simpler is simpler)

Phew! I hope that's about all for the prior discussiony stuff!


[1] I'm not actually expecting somebody to think to go look it up there
-- archiving fail -- just I that I'd sworn I'd written this down
somewhere and I think this must have been it

Eric Kow <http://www.nltg.brighton.ac.uk/home/Eric.Kow>
For a faster response, try +44 (0)1273 64 2905 or
xmpp:kowey at jabber.fr (Jabber or Google Talk only)

More information about the darcs-users mailing list