Include image file in svn diff patch

I am creating the svn diff patch, however it seems that image files are not included. The patch contains similar lines for each image file, as shown below:

Index: crimgeoprofile/code/jquery/css/ui-lightness/images/animated-overlay.gif =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: crimgeoprofile/code/jquery/css/ui-lightness/images/animated-overlay.gif =================================================================== --- crimgeoprofile/code/jquery/css/ui-lightness/images/animated-overlay.gif (revision 1510040) +++ crimgeoprofile/code/jquery/css/ui-lightness/images/animated-overlay.gif (working copy) 

I use the following command to create a patch:

 svn diff > test.diff 

Any suggestions for including image files would be appreciated.

+6
source share
4 answers

SVN does not support the inclusion of binary files in diff. As a side note: git supports binary files. The resulting patch file is as follows:

 diff --git a/bin/windows/SDL_mixer.dll b/bin/windows/SDL_mixer.dll new file mode 100644 index 0000000000000000000000000000000000000000..f48ee2da696f92b66940b91b52aa53c2 GIT binary patch literal 160256 zcmd?S4SZD9)i*kmOyYopCrYBxf<%o9l`2uFL_&=TgA|RT7>j7Ev^CX7sg%wregu+E z26K8G$kPW}+uD|hZFwrKv_*( YAs@UMf ~XNJW(<Ug6wVlm;iDl0WbXgJ_BoSD06*UQ z-h1DBFF(yWXYaMwUVE*z*Is+=k13j2?MQYw94`DHi#Z&%c=BJq{Qc}d<;Xr~#Ovoc zRu6jXl3M4jZ(VZNLl6HbYtG!qzCU-??5yw3`oRw#^JRVK!K}IdA7nlJgRDunPtThD 

So technically it is possible, it just does not work with svn. Therefore, if you desperately need a patch file, including binaries, consider checking svn with git. It is easy: git svn clone http://path/to/svn . Also works similar to svn://... Then you can create diff git and apply this diff to any target. The target should not be a git repository. git apply my.patch

+2
source

With Suversion 1.9, you can use the git flag to include binary content in the patch file, for example:

 svn diff https://storage/svn/project/trunk --git -c 42 > patch-42.diff 

Subversion 1.8 already has a git flag, but ignores its binary content.

+2
source

Unfortunately, svn diff does not process binary data.

Check out some answers: subversion diff, including new files

Specifically: fooobar.com/questions/27489 / ...

+1
source

Image files get into your diff, as shown by the lines with --- and +++, but they are included as whole files in the patch - this is partially explained by how to intelligently display changes in binary data, such as images in text-only format - if you will not want to use pages with hexadecimal differences (for example, fc -b a.gif b.gif ).

So, they tell you that the files have been changed, and you decide how you would like to compare them - for image files, one of the best comparisons of significant differences is the human eye - you would not expect a version control system to be able to tell you: "This there was a picture of bald people frowning, but now it's a pretty redhead fan smiling, isn't it?

0
source

Source: https://habr.com/ru/post/951419/


All Articles