You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Ulrich Eckhardt <ec...@satorlaser.com> on 2004/07/27 07:20:06 UTC
diffing binary files/ custom diff filter tool
I know that this question is asked pretty often here(OO.org files in
particular), but I had an idea how to add at least an improvement to the
situation. My particular problem is that I need to diff fonts which use a
non-textual format.
Anyhow, for my case it would be enough if I could have a filter that converted
these font-files to a textual representation and then compare these. I would
then simply take each glyph/character in that font, compute a hash for it
and output that hash and the codepoint to stdout. The users could still not
see exactly how each glyph was changed, but at least they would have more
info that just that the font was changed.
The same strategy could be applied to each member of other archives like above
mentioned OO.org files.
Now, how would I best go about integrating this(Tips for RapidSVN and
TortoiseSVN also greatly appreciated)?
Uli
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: diffing binary files/ custom diff filter tool
Posted by Branko Čibej <br...@xbc.nu>.
Ulrich Eckhardt wrote:
>Branko Čibej wrote:
>
>
>>Ulrich Eckhardt wrote:
>>
>>
>>>In simple words: is there a way to plug in a diff-tool that first looks at
>>>'svn:mime-type' and then conditionally calls the Right Tool(tm) for the
>>>given type?
>>>
>>>
>>Yes, of course. The "diff tool" could be a script that looks at the SVN
>>file properties in the working copy (via "svn propget svn:mime-type,"
>>for example). However, note that this would work when explicitly calling
>>invoking "svn diff".
>>
>>
>
>Hmmm, I tried using the --diff-cmd switch on the commandline, but it shews me
>that I only get two files on the commandline, neither of which is in the
>public part of the workingcopy but in some .svn subdir.
>
>
Oh duh, that's right, you can't (always) trivially convert the diff
parameters to a WC path. That is indeed a problem, and I can't think of
a general solution without changes in the --diff-cmd semantics.
>>It would _not_ magically make Subversion merge
>>differences in binary files using your tool during "svn update", because
>>Subversion's notion of when a file is binary is hard-coded, and if it
>>thinks a file is binary, it won't invoke diff3 to do the merge.
>>
>>
>
>Doesn't SVN just look at the mime-type, too? I'd take a look at it, but the
>weather is just too good for hacking ...
>
>
Yes, it looks at the mime type, but the set of "text" mime-types is
hard-coded; you can't modify it.
-- Brane
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: diffing binary files/ custom diff filter tool
Posted by Ulrich Eckhardt <ec...@satorlaser.com>.
Branko Čibej wrote:
> Ulrich Eckhardt wrote:
>>In simple words: is there a way to plug in a diff-tool that first looks at
>>'svn:mime-type' and then conditionally calls the Right Tool(tm) for the
>> given type?
>
> Yes, of course. The "diff tool" could be a script that looks at the SVN
> file properties in the working copy (via "svn propget svn:mime-type,"
> for example). However, note that this would work when explicitly calling
> invoking "svn diff".
Hmmm, I tried using the --diff-cmd switch on the commandline, but it shews me
that I only get two files on the commandline, neither of which is in the
public part of the workingcopy but in some .svn subdir.
> It would _not_ magically make Subversion merge
> differences in binary files using your tool during "svn update", because
> Subversion's notion of when a file is binary is hard-coded, and if it
> thinks a file is binary, it won't invoke diff3 to do the merge.
Doesn't SVN just look at the mime-type, too? I'd take a look at it, but the
weather is just too good for hacking ...
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: diffing binary files/ custom diff filter tool
Posted by Branko Čibej <br...@xbc.nu>.
Ulrich Eckhardt wrote:
>Ulrich Eckhardt wrote:
>[...]
>Rereading that, I find it pretty hard to understand, which might be why nobody
>answered.
>
>In simple words: is there a way to plug in a diff-tool that first looks at
>'svn:mime-type' and then conditionally calls the Right Tool(tm) for the given
>type?
>
>
Yes, of course. The "diff tool" could be a script that looks at the SVN
file properties in the working copy (via "svn propget svn:mime-type,"
for example). However, note that this would work when explicitly calling
invoking "svn diff". It would _not_ magically make Subversion merge
differences in binary files using your tool during "svn update", because
Subversion's notion of when a file is binary is hard-coded, and if it
thinks a file is binary, it won't invoke diff3 to do the merge.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: diffing binary files/ custom diff filter tool
Posted by Ulrich Eckhardt <ec...@satorlaser.com>.
Ulrich Eckhardt wrote:
[...]
Rereading that, I find it pretty hard to understand, which might be why nobody
answered.
In simple words: is there a way to plug in a diff-tool that first looks at
'svn:mime-type' and then conditionally calls the Right Tool(tm) for the given
type?
Uli
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org