Discussion:
How to create a diff/patch with binary data
Emmeran Seehuber
2004-12-06 21:32:04 UTC
Permalink
Hi!

Creating diffs for changes in ASCII files works very well using "svn diff".
Also applying this diffs using "patch" works like a dream :)

But now I want to create a "mixed" diff containing changes to ASCII files and
to png image files. But "svn diff" says

--
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
--

on the png files. That is of course correct and expected.

But how can I create a diff (or something similar) containing this binary
changes? And how could this be applied? Does Subversion support this
currently? If not, are they any plans?

Thanks.

cu,
Emmy
Martin A. Brooks
2004-12-06 22:22:57 UTC
Permalink
Post by Emmeran Seehuber
But how can I create a diff (or something similar) containing this binary
changes? And how could this be applied? Does Subversion support this
currently? If not, are they any plans?
One solution here is perhaps to add an svn diff option along the lines
of '--outputpatchto' or '-o' to select a file for the patch to be
written to (taking care to not overwrite versioned files).

So your work flow might look like this:

boole:~/wpp# svn diff foo.png
Index: foo.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
boole:~/wpp# svn diff foo.png -o foo.patch
svn: 673 bytes written to 'foo.patch'.
boole:~/wpp#

Regards

Mart.
Martin A. Brooks
2004-12-07 23:21:02 UTC
Permalink
Post by Martin A. Brooks
One solution here is perhaps to add an svn diff option along the lines
of '--outputpatchto' or '-o' to select a file for the patch to be
written to (taking care to not overwrite versioned files).
Any objections to me raising this as an enchancment request in the issue
tracker?

Mart.
k***@collab.net
2004-12-08 06:46:03 UTC
Permalink
Post by Martin A. Brooks
Post by Martin A. Brooks
One solution here is perhaps to add an svn diff option along the
lines of '--outputpatchto' or '-o' to select a file for the patch
to be written to (taking care to not overwrite versioned files).
Any objections to me raising this as an enchancment request in the
issue tracker?
Doesn't 'svn diff --force > OUTFILE' achieve this today?
Martin A. Brooks
2004-12-08 09:51:44 UTC
Permalink
Post by k***@collab.net
Doesn't 'svn diff --force > OUTFILE' achieve this today?
Assuming that works (I've not had time to check) then that's fine, but
perhaps the --force option should be mentioned in 'svn help diff'?

Regards

Mart.
k***@collab.net
2004-12-08 16:00:13 UTC
Permalink
Post by Martin A. Brooks
Post by k***@collab.net
Doesn't 'svn diff --force > OUTFILE' achieve this today?
Assuming that works (I've not had time to check) then that's fine, but
perhaps the --force option should be mentioned in 'svn help diff'?
It is.

It must have been added recently (perhaps just on latest trunk, not in
any development version)... Yes, in r12038, to fix issue #2099. So
it'll be in 1.2 release.

Loading...