From: Junio C Hamano <junkio@cox.net>
To: torvalds@osdl.org
Cc: git@vger.kernel.org
Subject: [PATCH] Make sure diff-helper can tell rename/copy in the new diff-raw format.
Date: Mon, 23 May 2005 00:26:06 -0700 [thread overview]
Message-ID: <7vfywe769d.fsf@assigned-by-dhcp.cox.net> (raw)
This adds tests to make sure that diff-helper can tell renames
from copies using the same "everything but the last one are
copies and the last one is either rename or stay" logic.
Signed-off-by: Junio C Hamano <junkio@cox.net>
---
t/t4003-diff-rename-1.sh | 6 +--
t/t4005-diff-rename-2.sh | 93 +++++++++++++++++++++++++++++++++++++++++++++--
2 files changed, 93 insertions(+), 6 deletions(-)
diff --git a/t/t4003-diff-rename-1.sh b/t/t4003-diff-rename-1.sh
--- a/t/t4003-diff-rename-1.sh
+++ b/t/t4003-diff-rename-1.sh
@@ -58,7 +58,7 @@ rename new COPYING.#
EOF
test_expect_success \
- 'validate output from rename/copy detection' \
+ 'validate output from rename/copy detection (#1)' \
'diff -u current expected'
test_expect_success \
@@ -98,7 +98,7 @@ diff --git a/COPYING b/COPYING
EOF
test_expect_success \
- 'validate output from rename/copy detection' \
+ 'validate output from rename/copy detection (#2)' \
'diff -u current expected'
test_expect_success \
@@ -127,7 +127,7 @@ copy to COPYING.#
EOF
test_expect_success \
- 'validate output from rename/copy detection' \
+ 'validate output from rename/copy detection (#3)' \
'diff -u current expected'
test_done
diff --git a/t/t4005-diff-rename-2.sh b/t/t4005-diff-rename-2.sh
--- a/t/t4005-diff-rename-2.sh
+++ b/t/t4005-diff-rename-2.sh
@@ -36,7 +36,42 @@ cat >expected <<\EOF
EOF
test_expect_success \
- 'validate output from rename/copy detection' \
+ 'validate output from rename/copy detection (#1)' \
+ 'diff -u current expected'
+
+# make sure diff-helper groks it correctly.
+mv expected raw-output
+GIT_DIFF_OPTS=--unified=0 git-diff-helper <raw-output |
+sed -e 's/\([0-9][0-9]*\)/#/g' >current &&
+cat >expected <<\EOF
+diff --git a/COPYING b/COPYING.#
+similarity index #%
+copy from COPYING
+copy to COPYING.#
+--- a/COPYING
++++ b/COPYING.#
+@@ -# +# @@
+- HOWEVER, in order to allow a migration to GPLv# if that seems like
++ However, in order to allow a migration to GPLv# if that seems like
+diff --git a/COPYING b/COPYING.#
+similarity index #%
+rename old COPYING
+rename new COPYING.#
+--- a/COPYING
++++ b/COPYING.#
+@@ -# +# @@
+- Note that the only valid version of the GPL as far as this project
++ Note that the only valid version of the G.P.L as far as this project
+@@ -# +# @@
+- HOWEVER, in order to allow a migration to GPLv# if that seems like
++ HOWEVER, in order to allow a migration to G.P.Lv# if that seems like
+@@ -# +# @@
+- This file is licensed under the GPL v#, or a later version
++ This file is licensed under the G.P.L v#, or a later version
+EOF
+
+test_expect_success \
+ 'validate output from diff-helper (#1)' \
'diff -u current expected'
test_expect_success \
@@ -56,7 +91,39 @@ cat >expected <<\EOF
EOF
test_expect_success \
- 'validate output from rename/copy detection' \
+ 'validate output from rename/copy detection (#2)' \
+ 'diff -u current expected'
+
+# make sure diff-helper groks it correctly.
+mv expected raw-output
+GIT_DIFF_OPTS=--unified=0 git-diff-helper <raw-output |
+sed -e 's/\([0-9][0-9]*\)/#/g' >current
+cat >expected <<\EOF
+diff --git a/COPYING b/COPYING.#
+similarity index #%
+copy from COPYING
+copy to COPYING.#
+--- a/COPYING
++++ b/COPYING.#
+@@ -# +# @@
+- HOWEVER, in order to allow a migration to GPLv# if that seems like
++ However, in order to allow a migration to GPLv# if that seems like
+diff --git a/COPYING b/COPYING
+--- a/COPYING
++++ b/COPYING
+@@ -# +# @@
+- Note that the only valid version of the GPL as far as this project
++ Note that the only valid version of the G.P.L as far as this project
+@@ -# +# @@
+- HOWEVER, in order to allow a migration to GPLv# if that seems like
++ HOWEVER, in order to allow a migration to G.P.Lv# if that seems like
+@@ -# +# @@
+- This file is licensed under the GPL v#, or a later version
++ This file is licensed under the G.P.L v#, or a later version
+EOF
+
+test_expect_success \
+ 'validate output from diff-helper (#2)' \
'diff -u current expected'
test_expect_success \
@@ -76,7 +143,27 @@ cat >expected <<\EOF
EOF
test_expect_success \
- 'validate output from rename/copy detection' \
+ 'validate output from rename/copy detection (#3)' \
+ 'diff -u current expected'
+
+# make sure diff-helper groks it correctly.
+mv expected raw-output
+GIT_DIFF_OPTS=--unified=0 git-diff-helper <raw-output |
+sed -e 's/\([0-9][0-9]*\)/#/g' >current
+cat >expected <<\EOF
+diff --git a/COPYING b/COPYING.#
+similarity index #%
+copy from COPYING
+copy to COPYING.#
+--- a/COPYING
++++ b/COPYING.#
+@@ -# +# @@
+- HOWEVER, in order to allow a migration to GPLv# if that seems like
++ However, in order to allow a migration to GPLv# if that seems like
+EOF
+
+test_expect_success \
+ 'validate output from diff-helper (#3)' \
'diff -u current expected'
test_done
------------------------------------------------
next reply other threads:[~2005-05-23 7:25 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-23 7:26 Junio C Hamano [this message]
2005-05-23 14:49 ` [PATCH] Make sure diff-helper can tell rename/copy in the new diff-raw format Linus Torvalds
2005-05-23 18:43 ` Junio C Hamano
2005-05-23 19:03 ` Linus Torvalds
2005-05-23 19:16 ` Linus Torvalds
2005-05-23 21:55 ` [PATCH] diff-raw format update take #2 Junio C Hamano
2005-05-23 22:08 ` Junio C Hamano
2005-05-24 0:12 ` Chris Wedgwood
2005-05-24 0:25 ` Junio C Hamano
2005-05-24 0:31 ` Chris Wedgwood
2005-05-24 0:45 ` Junio C Hamano
2005-05-24 1:03 ` Linus Torvalds
2005-05-24 1:05 ` Chris Wedgwood
2005-05-24 1:29 ` David Lang
2005-05-24 1:33 ` Chris Wedgwood
2005-05-24 1:39 ` Thomas Glanzmann
[not found] ` <20050524013947.ADFEE528F53@taniwha.stupidest.org>
2005-05-24 1:44 ` Thomas Glanzmann
2005-05-24 1:50 ` Linus Torvalds
2005-05-24 0:51 ` Linus Torvalds
2005-05-26 0:55 ` [PATCH] Make sure diff-helper can tell rename/copy in the new diff-raw format Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vfywe769d.fsf@assigned-by-dhcp.cox.net \
--to=junkio@cox.net \
--cc=git@vger.kernel.org \
--cc=torvalds@osdl.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.