[darcs-users] annotate output
albertito at blitiri.com.ar
Sun Oct 24 15:08:27 UTC 2010
On Sun, Oct 24, 2010 at 02:30:20PM +0200, Petr Rockai wrote:
> Alberto Bertogli <albertito at blitiri.com.ar> writes:
> > Darcsweb relies on annotate --xml output to show the annotate page, and
> > if it had only the hash ids, that would mean extra darcs invocations to
> > get authorship information.
> > That is so because darcsweb does not rely on any database, or persistent
> > state. It's supposed to be a light, easy to install and read-only cgi
> > application.
> > I can imagine that, for example, a short-lived graphical anotate browser
> > (like git gui blame) could have similar requirements.
> Yes, see my suggestion above... what I proposed would look like (e.g.):
> hash1 | line 1
> hash2 | line 2
> + hash1
> A patch author
> D patch date
> N patch name
> C patch comment
> C (comment continued...)
> + hash2
> (the formatting of patch data is subject to further discussion I guess,
> but the above looks quite reasonable to me... maybe we should come up
> with different letter prefixes, so we have empty intersection with the
> status letters, which would also let us re-use the same format for darcs
> changes --machine --summary)
That looks quite reasonable. I like it, it's both human and machine
parseable, and can be extended in a backwards-compatible way with new
> > - Encoding of the author's name. Remember that people may put weird
> > characters in their name and it should be handled properly.
> As long as we don't allow newlines there, shouldn't be a problem. (Even
> if we do, it actually wouldn't be that much of a problem either.)
Good to know. Will the encoding be fixed to UTF8 (or something else), or
transparent (i.e. what the user put is what you get)?
> > - Binary files: while this has not been a problem, it's a very nice
> > feature to know from darcs which files it considers binary.
> I am not sure, but how was this indicated in the xml format. Do you mean
> Binary file
> (In that case, it's actually not machine-parseable information, since it
> coincides with a text file containing a single line, "Binary file".)
I thought it was inside the XML, but looking at darcsweb's code, I see
it gets it from _darcs/prefs/binaries. So you're right, there should be
no need for this.
> > Also, if you are going to deprecate --xml, please make sure there is a
> > way to reliably detect the availability of the new output in a
> > backwards-compatible way.
> Is this good enough?
> darcs failed: unrecognized option `--machine'
> (it also gives error code 2, while other failures seem to give error
> code 1.)
Looks great to me.
Thanks a lot,
More information about the darcs-users