You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by SravanKumar Sandela <ss...@innominds.com> on 2012/03/02 10:09:17 UTC

svn diff on png files

Hi,

I am using svn 1.7.2 and on doing
"svn diff --diff-cmd -diff abc.png"

i see following output in footer

Property changes on: abc.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+image/png

But on previous version of svn (atleast till 1.6.17, r1128011) i see its
footer to be in different format as follows

Property changes on: abc.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Because of this change some of our scripts which do style checking on
patches are failing.

I have few questions,

1. Why are we seeing this change?
2. Is this some buggy or junk character output?
3. Is there a way we can suppress such meta characters?
4. Should we live with it for ever?
5. If this is buggy, has it been already fixed, if not then what does the


## -0,0 +1 ##
+image/png

  mean?

-Sravan.

Re: svn diff on png files

Posted by Stefan Sperling <st...@elego.de>.
On Sat, Mar 03, 2012 at 11:07:11AM +0530, SravanKumar Sandela wrote:
> Yes exactly, and i want to update MAGIC env variable from script. But to do
> that i need to understand how and what to set it to.

On UNIX-like systems (including cygwin, I beleive) you would use a line
such as:

  export MAGIC=/dev/null

or:

  export MAGIC=/this/does/not/exist

To be clear, this only changes the mime-type shown in the output
from "image/png" to "application/octet-stream". It will not cause
the property change to be displayed like it was displayed in 1.6.

Re: svn diff on png files

Posted by SravanKumar Sandela <ss...@innominds.com>.
Yes exactly, and i want to update MAGIC env variable from script. But to do
that i need to understand how and what to set it to.

On Sat, Mar 3, 2012 at 10:38 AM, Ryan Schmidt <
subversion-2012a@ryandesign.com> wrote:

> On Mar 2, 2012, at 21:40, SravanKumar Sandela wrote:
>
> > This is important for us, because users around the world have not yet
> completely shifted to 1.7, but once they shift or for new comers, we have
> to fix the script to take care of this issue
>
> You should modify your script now so that it can adapt and behave
> correctly depending on whether Subversion < 1.7 or >= 1.7 is used.
>
>

Re: svn diff on png files

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Mar 2, 2012, at 21:40, SravanKumar Sandela wrote:

> This is important for us, because users around the world have not yet completely shifted to 1.7, but once they shift or for new comers, we have to fix the script to take care of this issue

You should modify your script now so that it can adapt and behave correctly depending on whether Subversion < 1.7 or >= 1.7 is used.


Re: svn diff on png files

Posted by SravanKumar Sandela <ss...@innominds.com>.
Hi Philip, Stefan,

Thanks for the info, the svn we are using is from cygwin tool, and we did
not compile any svn exclusively, it has just been a download and install
process. Can you point me more to MAGIC environment variable setting to an
empty file?, like how to do it?.

This is important for us, because users around the world have not yet
completely shifted to 1.7, but once they shift or for new comers, we have
to fix the script to take care of this issue, so can u please tell us how
and where to find this MAGIC env var and how could it be set?.

Thanks in anticipation.

-Sravan.

On Sat, Mar 3, 2012 at 12:05 AM, Stefan Sperling <st...@elego.de> wrote:

> On Fri, Mar 02, 2012 at 09:47:12AM +0000, Philip Martin wrote:
> > SravanKumar Sandela <ss...@innominds.com> writes:
> >
> > > 5. If this is buggy, has it been already fixed, if not then what does
> the
> > >
> > >
> > > ## -0,0 +1 ##
> > > +image/png
> > >
> > >   mean?
> >
> > It's intentional, 1.7 shows property diffs as unified diffs:
> >
> > http://subversion.apache.org/docs/release-notes/1.7.html#diff-properties
>
> Also, mime-type detection with libmagic switches the automatically
> configured mime-type from 'application/octet-stream' to 'image/png'.
> http://subversion.apache.org/docs/release-notes/1.7.html#libmagic-support
> If you don't like this, either compile Subversion without libmagic,
> or make the MAGIC environment variable in svn's environment point to
> a file that does not exist or is empty.
>
> There is no way to get the 1.6 property diff output back with a 1.7
> client. I'm sorry that this incompatible change breaks your script.
> The reason this change was made is that 'svn patch' needs to parse
> property changes from patch files and apply them to a working copy.
>

Re: svn diff on png files

Posted by Stefan Sperling <st...@elego.de>.
On Fri, Mar 02, 2012 at 09:47:12AM +0000, Philip Martin wrote:
> SravanKumar Sandela <ss...@innominds.com> writes:
> 
> > 5. If this is buggy, has it been already fixed, if not then what does the
> >
> >
> > ## -0,0 +1 ##
> > +image/png
> >
> >   mean?
> 
> It's intentional, 1.7 shows property diffs as unified diffs:
> 
> http://subversion.apache.org/docs/release-notes/1.7.html#diff-properties

Also, mime-type detection with libmagic switches the automatically
configured mime-type from 'application/octet-stream' to 'image/png'.
http://subversion.apache.org/docs/release-notes/1.7.html#libmagic-support
If you don't like this, either compile Subversion without libmagic,
or make the MAGIC environment variable in svn's environment point to
a file that does not exist or is empty.

There is no way to get the 1.6 property diff output back with a 1.7
client. I'm sorry that this incompatible change breaks your script.
The reason this change was made is that 'svn patch' needs to parse
property changes from patch files and apply them to a working copy.

Re: svn diff on png files

Posted by Philip Martin <ph...@wandisco.com>.
SravanKumar Sandela <ss...@innominds.com> writes:

> 5. If this is buggy, has it been already fixed, if not then what does the
>
>
> ## -0,0 +1 ##
> +image/png
>
>   mean?

It's intentional, 1.7 shows property diffs as unified diffs:

http://subversion.apache.org/docs/release-notes/1.7.html#diff-properties

-- 
Philip