windows selftest rev 1372

Alexey Shamrin shamrin at gmail.com
Sat Nov 5 16:32:23 GMT 2005


On 29/10/05, Wouter van Heyst <larstiq at larstiq.dyndns.org> wrote:
> <snip>
> > * diff that comes bundled with vim64 (gnu diff 2.7) use backslashes "\".
> > * diff that comes bundled with Cygwin (gnu diff 2.8.7) use forward
> > slashes "/" (But I think Cygwin should be considered as a separate
> > platform)
> > * diff that comes with GnuWin32 (gnu diff 2.8.7 too) use forward slashes "/"
> >
> > Probably it depends of gnu diff version, or maybe it can be configured
> > when compiling. I don't know.
>
> And applying those patches works everywhere?

I tried all possible combinations of 3 diff and 2 patch programs under
win32. Here are the versions I tried:
- diff:
    * diff that comes with Cygwin (gnu diff 2.8.7)
    * diff that comes with GnuWin32 (gnu diff 2.8.7)
    * diff that comes bundled with vim64 (gnu diff 2.7)
- patch
    * patch from cygwin (2.5.8)
    * patch from gnuwin32 (2.5.9)

I generated diffs with this command:
diff -ur diffdir1 diffdir2 > diff_file

All diff_files were slightly different:
* diff from cygwin -- \n line endings in diff header [1], forward slashes
* diff from gnuwin32 -- \r\n line endings in diff header, forward slashes
* diff from gvim -- \r\n line endings in diff header, backslashes

I tried applying this diffs with the this command (with two patch versions):
patch -i diff_file -p0

The only problem was that patch from cygwin wasn't able to comprehend
diff made by cygwin. It failed with:
Assertion failed: hunk, file ../patch-2.5.9-src/patch.c, line 340
When I tried adding --binary to patch this problem disappeared.

So I wasn't able to find win32 patch that doesn't understand forward
slashes. The only problem was with line endings from cygwin diff.

And one observation: win32 subversion uses forward slashes for 'svn
diff' and 'svn log -v', but backslashes for 'svn status'. I think it's
good behaviour.

[1] I should note that when I installed Cygwin I chose "Default text
file type -- Unix / binary" (This option is marked RECOMMENDED).

--
Alexey




More information about the bazaar mailing list