[darcs-users] darcs annotate format obscures the code

Ralph Corderoy ralph at inputplus.co.uk
Sun Mar 20 12:33:21 UTC 2005


Hi David,

> On Sun, Mar 20, 2005 at 10:16:54AM +0000, Ralph Corderoy wrote:
> > I agree with the general problem.  I think the code up front with a
> > `change number', i.e. 1..n, followed by an `end of code' marker and
> > the blame details, in change number order.  Both have to be output
> > at the same time to avoid the repo changing inbetween generating the
> > two.  I suppose the command could send the code to stdout and store
> > the blame detail in a separate given file.
> 
> I like this idea! I presume you mean something like (taking some
> liberties here)
> 
>     00001: #!/bin/sh
>     00002: echo this is only a test
>     00001: exit 0
>     
>     END OF FILE (but this message is still part of the annotate output
>     
>     00001: Sun Oct 20 20:01:05 EDT 2002  droundy at abridgegame.org
>       * Initial version of stupid example.
>     
>     00002: Sun Oct 20 20:01:15 EDT 2002  droundy at abridgegame.org
>       * Explain to the user that this is just a test.

Yes, but don't have leading zeroes.  Xxxxxword xxxxshape xxxxxxxis
important xxxxxxand xxxxxthat xdestroys xxxxxxxit.

> Thus we would give the entire messages at the bottom along with unique
> identifiers of some sort, and we'd have a very compact and readable
> representation of the actual code.

I'm certain unique identifiers should be integers from 1 in time order.
That way, seeing `4' and `6' tells you 6 is more recent and exactly one
thing happened inbetween.

> We'd also want to have a second entry for the patch which deleted a
> particular line (which would be relevant if we're looking at an older
> version of the file).  So maybe something like (for the hypothetical
> first version of this test case)
> 
> 00001-  NOW: #!/bin/sh
> 00001-00002: echo hello world
> 00001-  NOW: exit 0

Drop the `-' since it is unnecessary.  Always ensure at least one space
separates `1', `2', and `:'.  That way, it's easier to pass the output
to other Unix tools, e.g. in awk $3 is always the `:'.  And don't shout.

        1   now : #!/bin/sh
        1     2 : echo hello world
        1   now : exit 0

> END OF FILE (but this message is still part of the annotate output

The first line that doesn't match /^[ 1-9]/ will always be the end of
file line so something more simple like `.' as used by ed(1), SMTP,
etc., may be less noisy.  Alternatively, allow the explanation of the
numbers to be in a separate file.

> If someone wants to code this up, that would be wonderful.  Or if
> someone has a better idea.  I'm off to the airport now... (well,
> really in ten or fifteen minutes...)

Anywhere nice?  Send us a postcard!

Cheers,


Ralph.





More information about the darcs-users mailing list