Re: [PATCHv3 1/5] t7406: simplify by using diff --name-only instead of diff --raw

2 messages, 2 authors, 2018-08-07 · open the first message on its own page

Re: [PATCHv3 1/5] t7406: simplify by using diff --name-only instead of diff --raw

From: Junio C Hamano <hidden>
Date: 2018-08-07 17:29:28

Elijah Newren [off-list ref] writes:
We can get rid of some quoted tabs and make a few tests slightly easier
to read and edit by just asking for the names of the files modified,
since that's all these tests were interested in anyway.
Technically the quoted tab was making sure that we do not mistake
"subsubmodule" (if existed) as "submodule" we seek, so a faithful
replacement would be to find "^submodule", and "^submodule$" would
be an improvement.  But we do not have paths with confusing names in
these tests, so we can leave it as-is, I guess.

I think 0/5 should fix the real bug you are deliberately keeping in
this patch, from the point of view of organization.

quoted hunk
Signed-off-by: Elijah Newren <redacted>
---
 t/t7406-submodule-update.sh | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/t/t7406-submodule-update.sh b/t/t7406-submodule-update.sh
index f604ef7a72..e2405c96b5 100755
--- a/t/t7406-submodule-update.sh
+++ b/t/t7406-submodule-update.sh
@@ -579,9 +579,9 @@ test_expect_success 'submodule update - update=none in .git/config' '
 	  git checkout master &&
 	  compare_head
 	 ) &&
-	 git diff --raw | grep "	submodule" &&
+	 git diff --name-only | grep submodule &&
 	 git submodule update &&
-	 git diff --raw | grep "	submodule" &&
+	 git diff --name-only | grep submodule &&
 	 (cd submodule &&
 	  compare_head
 	 ) &&
@@ -597,9 +597,9 @@ test_expect_success 'submodule update - update=none in .git/config but --checkou
 	  git checkout master &&
 	  compare_head
 	 ) &&
-	 git diff --raw | grep "	submodule" &&
+	 git diff --name-only | grep submodule &&
 	 git submodule update --checkout &&
-	 test_must_fail git diff --raw \| grep "	submodule" &&
+	 test_must_fail git diff --name-only \| grep submodule &&
 	 (cd submodule &&
 	  test_must_fail compare_head
 	 ) &&

Re: [PATCHv3 1/5] t7406: simplify by using diff --name-only instead of diff --raw

From: Elijah Newren <hidden>
Date: 2018-08-07 17:40:19

On Tue, Aug 7, 2018 at 10:29 AM Junio C Hamano [off-list ref] wrote:
Elijah Newren [off-list ref] writes:
quoted
We can get rid of some quoted tabs and make a few tests slightly easier
to read and edit by just asking for the names of the files modified,
since that's all these tests were interested in anyway.
Technically the quoted tab was making sure that we do not mistake
"subsubmodule" (if existed) as "submodule" we seek, so a faithful
replacement would be to find "^submodule", and "^submodule$" would
be an improvement.  But we do not have paths with confusing names in
these tests, so we can leave it as-is, I guess.
I knew someone would find additional issues.  I'll add the anchors if
any other issues come up in review for the series.
I think 0/5 should fix the real bug you are deliberately keeping in
this patch, from the point of view of organization.
You mean 5/5?  And yeah, it was just a temporary thing for
organizational purposes.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help