[darcs-users] 'annotate' behavior on text files turned into binary files

David Perkowski dadiv at dzero.org
Tue Oct 16 22:21:28 UTC 2007


Hello,

I've been using darcs for a while and really, really like it. Today I  
ran across a strange thing.

I'm not used to using 'annotate' and so I may be misunderstanding  
what is happening here, but I have a CSS file which at some point  
along the way was given some "binary" contents -- I found this  
because someone working on the file was telling me they were not  
seeing their changes when recording, just the indication that there  
were (binary) changes to the file.

It turned out their patch actually corrected the problem (and so was  
still a binary diff, though the resulting file was not) -- so out of  
curiosity I wondered where the problem came from. I unpulled their  
patch, confirmed there was a line in the file with some strange  
characters, and figured I could do 'darcs annotate' to see which  
change was responsible for that line.

To my surprise, 'annotate' seems to be giving me lines of the file  
which were last recorded as text, but which are not currently in the  
file; that is, the changes subsequent to the patch that introduced  
control characters are disregarded in the output. I see, listed above  
actual annotated lines of the file, lines corresponding to the binary  
patches to the file that look like this:

   # Following line added by [Adding new images and CSS for design
   # modifier at anon.com**20070816180212]
    Binary file

(All of these patches were made after the initial import of the file,  
which was in fact the last time the file was not binary.)

And at the very top of the output, at the head of the file:

   # File stylesheet.css created by [Add design files
   # creator at anon.com**20070808021240]  as ./stylesheet.css
   +Binary file

Although the patch that created the file did not create it as a  
binary file.

Is this the expected behavior of 'annotate' in this circumstance? Or  
is there no expectation of behavior on text files which have been  
(inadvertently) turned into binary files? I can certainly understand  
it would be impractical or generally useless to pinpoint the binary  
sections in the file and display them on their own lines, or not  
display them, but does this mean that for this particular file,  
annotate will never yield correct results?

I can delete the file and re-add it, which would set us on the right  
track, but I thought I'd ask about this situation.

I did manage to discover whose patch was binary with 'changes -v'.

Thanks!


More information about the darcs-users mailing list