diff options
author | Andreas Gruenbacher <agruen@suse.de> | 2010-09-17 13:16:08 +0200 |
---|---|---|
committer | Andreas Gruenbacher <agruen@suse.de> | 2010-09-17 13:16:08 +0200 |
commit | 7e6d1e67182b79d4e0de4f6e1d7f70009c57590c (patch) | |
tree | 9a6f25734daf43c0205708f05c1721ede7de93dc | |
parent | 19aecf81082fa21b47e59a3a3b828efdd82be82f (diff) | |
download | patch-7e6d1e67182b79d4e0de4f6e1d7f70009c57590c.tar.gz |
Document that "diff --git" criss-cross renames don't work
* NEWS: Document that "diff --git" criss-cross renames are broken
still.
* tests/criss-cross: Test case currently expected to fail.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | NEWS | 7 | ||||
-rw-r--r-- | tests/Makefile.am | 2 | ||||
-rw-r--r-- | tests/criss-cross | 43 |
4 files changed, 54 insertions, 2 deletions
@@ -34,6 +34,10 @@ generated here. * tests/unmodified-files, tests/copy-rename: Update. + * NEWS: Document that "diff --git" criss-cross renames are broken + still. + * tests/criss-cross: Test case currently expected to fail. + 2010-07-27 Tim Waugh <twaugh@redhat.com> * src/patch.c: Stops "patch --get 1" from segfaulting. @@ -1,6 +1,9 @@ * Support for most features of the "diff --git" format: renames and copies, - permission changes, symlink diffs. (Binary diffs are not supported yet; - patch will complain and skip them.) + permission changes, symlink diffs. Caveats: + + Binary diffs are not supported yet; patch will complain and skip them. + + In the "diff --git" format, all the patches are relative to the original + state of the files to patch, allowing things like criss-cross renames. + GNU patch will currently fail for such patches. * Support for double-quoted filenames: when a filename in a context diff starts with a double quote, it is interpreted as a C string literal. The escape sequences \\, \", \a, \b, \f, \n, \r, \t, \v, and \ooo (a three-digit diff --git a/tests/Makefile.am b/tests/Makefile.am index fbade22..ffe02af 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -22,6 +22,7 @@ TESTS = \ copy-rename \ corrupt-reject-files \ create-delete \ + criss-cross \ crlf-handling \ dash-o-append \ empty-files \ @@ -46,6 +47,7 @@ TESTS = \ unmodified-files XFAIL_TESTS = \ + criss-cross \ dash-o-append EXTRA_DIST = \ diff --git a/tests/criss-cross b/tests/criss-cross new file mode 100644 index 0000000..e3ff959 --- /dev/null +++ b/tests/criss-cross @@ -0,0 +1,43 @@ +# Copyright (C) 2010 Free Software Foundation, Inc. +# +# Copying and distribution of this file, with or without modification, +# in any medium, are permitted without royalty provided the copyright +# notice and this notice are preserved. + +# git diffs: criss-cross renames + +. $srcdir/test-lib.sh + +require_cat +use_local_patch +use_tmpdir + +# ============================================================== +# Criss-cross rename + +echo 1 > f +echo 2 > g + +cat > criss-cross-rename.diff <<EOF +diff --git a/g b/f +similarity index 100% +rename from g +rename to f +diff --git a/f b/g +similarity index 100% +rename from f +rename to g +EOF + +check 'patch -p1 < criss-cross-rename.diff || echo "Status: $?"' <<EOF +patching file f (renamed from g) +patching file g (renamed from f) +EOF + +check 'cat f' <<EOF +2 +EOF + +check 'cat g' <<EOF +1 +EOF |