Issue #431 resolved

Change the default, or add a config option to not include binary file diffs

Tavis Elliott
created an issue

We have some images in our repository, and here's an example notification email:

diff --git a/image.jpg b/image.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..bf8a18584335ffe874b852a158ca292b42d6c53c
GIT binary patch
literal 17627
zc%1FKcT`hf*DksdkPd?MDuNVg(m^m$kuCzF^dbUMBE1C&1VuWCfPkWafCxwv>Am+R
zT|zU2qF^AQga9GA`F-b{d&c?R?~L)@bMK#bX3sH_vG(3$&Arx|&-3gxL;6Yj1za-F
z(boYeC@26u@&_O-0$RWY3W|S@|8A7jl>gX8Dk@59nu|0v|2Qoj105|bJuM9lJrg}W
z10&gJ=$KiU7@7b1{?ASRx%{82$Oj`W4K3sUV<U9}th5xjfF(+btH1?T3QATAQZFC`
z02I^||6#y?H;N0CRMZ#AU7}|opHO#++<i*Q3*^pHQ&Evy!^!Oc6)QEHu>75imrWgM
zuKKboyhzQb6}em8#qn?wBdYk+?<E~QCl@yl?=>-T3CZh9$||aA>NmCSY3u0f=^L0m
zdTefCX=Ux??DEXj&E3O4ATTHx8WI}yDmo@ME<PbG{cT2O*1PxF1%;oBz7&^~e*Iok
zTUX!E*wozJ)7#fSFgP?kH9a#sH~(`1fm}naZ)|S;{<DqUKR7(X9pg_<|A~tNprrU8

Not very helpful, it would be much better to just see:

diff --git a/image.jpg b/image.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..bf8a18584335ffe874b852a158ca292b42d6c53c
Binary files differ

Comments (6)

  1. Sebastian Sdorra repo owner
    • changed status to open

    It looks like javahg sets the "--git" option for mercurial diffs as default and mercurial generates the binary patch only in git mode. I'm not really sure how to fix this, without breaking the existing behaviour. Perhaps i could add an option for diff modes (native and git) to the diff command. But jgit seems to use only git, svnkit uses only unified and mercurial supports unified and git. Have you an better idea, how to fix this?

  2. Tavis Elliott reporter

    I think an option to use native diff would be a good idea. From the command line anyway, it does exactly what we want it to do: "Binary file xxx has changed".

    Perhaps a text field, to be able to configure all of the options given to the diff command? By default populate it based on the SCM type?

  3. Sebastian Sdorra repo owner

    Add the moment there are not many diff options. We can not use every option from the hg, svn or git command. We can use only those which are available from the scm-manager api:

    That means we have to modify the api and after that we have to wait for the next release of scm-manager.

  4. Log in to comment