[darcs-users] Re: darcs diff

Ralph Corderoy ralph at inputplus.co.uk
Sat Feb 19 13:27:07 UTC 2005


Hi David,

> Indeed, that's the issue.  Darcs is making two copies of the entire
> tree so it can run the diff.  Part of the reason for this is so that
> the "---" and "+++"" headers in the diff will be predictable:
> 
> $ darcs diff
> diff -rN -u old-darcs/DiffCommand.lhs new-darcs/DiffCommand.lhs
> --- old-darcs/DiffCommand.lhs   2005-01-29 05:47:39.000000000 -0500
> +++ new-darcs/DiffCommand.lhs   2005-02-18 08:05:53.000000000 -0500
> @@ -116,6 +116,7 @@
>
> ...
>  
> We could get the best of both worlds, perhaps, if we were to
> post-process the output of diff to edit the names of the files, but
> then we'd have to worry about accidentally messing up the contents of
> the diff (in case it has a line starting with --- or +++.  I guess
> we'd have to match on the @@ after the +++ to make sure we're looking
> at a header.

Shirley that's not the case?  The first character of each line from diff
-u is one of [d-+@ ].  All content of the files being diff'd is indented
by one space.  So any /^(---|\+\+\+)/ is from diff, not the files.

Cheers,


Ralph.





More information about the darcs-users mailing list