[2/3] t9810: drop debug `cat` call
diff mbox series

Message ID ef45c9cabe7fe3f31d63edb872ba946ffbd951fe.1582447606.git.martin.agren@gmail.com
State New
Headers show
Series
  • Untitled series #245927
Related show

Commit Message

Martin Ågren Feb. 23, 2020, 8:48 a.m. UTC
We `cat` kwdelfile.c, but don't inspect or grab the contents in any way.
This looks like a remnant from a debug session. Similar to the previous
commit, one could argue that `cat`-ing the file verifies that it didn't
disappear somehow. But because the very next thing we do after `cat`-ing
the file is to `grep` in it, we can safely drop the call to `cat`.

Signed-off-by: Martin Ågren <martin.agren@gmail.com>
---
 t/t9810-git-p4-rcs.sh | 1 -
 1 file changed, 1 deletion(-)

Comments

Junio C Hamano Feb. 24, 2020, 7:18 p.m. UTC | #1
Martin Ågren <martin.agren@gmail.com> writes:

> We `cat` kwdelfile.c, but don't inspect or grab the contents in any way.
> This looks like a remnant from a debug session. Similar to the previous
> commit, one could argue that `cat`-ing the file verifies that it didn't
> disappear somehow. But because the very next thing we do after `cat`-ing
> the file is to `grep` in it, we can safely drop the call to `cat`.
>
> Signed-off-by: Martin Ågren <martin.agren@gmail.com>
> ---
>  t/t9810-git-p4-rcs.sh | 1 -
>  1 file changed, 1 deletion(-)

The change does make sense, but makes me wonder why we need to
single this one out in a separate patch.  Doesn't this fall into the
same category of fixes done in 3/3?  Exactly the same rationale as
above applies to the first one in 3/3 on t0021---we can safely lose
the cat because the file is immediately grepped for a string, so
missing file will be caught as an error either way.

Puzzled...

> diff --git a/t/t9810-git-p4-rcs.sh b/t/t9810-git-p4-rcs.sh
> index 57b533dc6f..e3836888ec 100755
> --- a/t/t9810-git-p4-rcs.sh
> +++ b/t/t9810-git-p4-rcs.sh
> @@ -294,7 +294,6 @@ test_expect_success 'cope with rcs keyword file deletion' '
>  		echo "\$Revision\$" >kwdelfile.c &&
>  		p4 add -t ktext kwdelfile.c &&
>  		p4 submit -d "Add file to be deleted" &&
> -		cat kwdelfile.c &&
>  		grep 1 kwdelfile.c
>  	) &&
>  	git p4 clone --dest="$git" //depot &&

Patch
diff mbox series

diff --git a/t/t9810-git-p4-rcs.sh b/t/t9810-git-p4-rcs.sh
index 57b533dc6f..e3836888ec 100755
--- a/t/t9810-git-p4-rcs.sh
+++ b/t/t9810-git-p4-rcs.sh
@@ -294,7 +294,6 @@  test_expect_success 'cope with rcs keyword file deletion' '
 		echo "\$Revision\$" >kwdelfile.c &&
 		p4 add -t ktext kwdelfile.c &&
 		p4 submit -d "Add file to be deleted" &&
-		cat kwdelfile.c &&
 		grep 1 kwdelfile.c
 	) &&
 	git p4 clone --dest="$git" //depot &&