[darcs-users] darcs diff output

Dan Pascu dan at ag-projects.com
Mon Jan 12 13:42:34 UTC 2009


On Saturday 10 January 2009, Trent W. Buck wrote:
> Dan Pascu <dan at ag-projects.com> writes:
> > I noticed that with darcs-2 when there is no change in the working
> > tree, darcs diff still outputs an empty line. This was not happening
> > in 1.0.9
> >
> > dawn:~/work/project$ darcs diff
> > dawn:~/work/project$ darcs2 diff
> >
> > dawn:~/work/project$
>
> This shouldn't be a problem, because patch(1) will ignore everything
> before the first hunk (signified by a line beginning with three
> minus-hyphens).  That "header" area is often used to hold a comment
> explaining what the patch does;

I do not know why you assume that the empty line is added at the 
beginning, maybe it comes from the Haskell programmer habit of using the 
prefix notation ;)

Now seriously, the line is added at the end, which makes it part of the 
context and much more harmful. With the modified context, patch may fail 
to match the chunk and reject it. The correctness of the diff information 
is altered as the extra line is in the diff area, not preceding it.

>
>     darcs diff -p .
>
> However I can understand how annoying unwanted whitespace can be, so if

It would be nice it if were only about an annoying whitespace.

> you want this regression fixed the best approach is to 1) report it to
> bugs at darcs.net; 2) write a regression test for the tests/ directory;
> and then 3) hack the code so the test passes.
>
> Of course, you don't need to do all three steps by yourself.  But then
> it'll only get dealt with when someone else has the inclination, time
> and experience to do the remaining steps.

It appears I have no other choice, given that I don't know Haskell. 
Otherwise I would have chosen to send a patch for such a trivial matter 
and get it done quicker. As it stands, all I can do is report it.

-- 
Dan


More information about the darcs-users mailing list