mbox series

[GSoC,v3,0/2] avoid pipes with Git on LHS

Message ID 20220312062126.31988-1-shivam828787@gmail.com (mailing list archive)
Headers show
Series avoid pipes with Git on LHS | expand

Message

Shubham Mishra March 12, 2022, 6:21 a.m. UTC
changes since v2:
* t0000: remove git command out of subshell
* t0030: fix missing redirections to "tmp" file
Shubham Mishra (2):
  t0001-t0028: avoid pipes with Git on LHS
  t0030-t0050: avoid pipes with Git on LHS

 t/t0000-basic.sh            | 10 +++--
 t/t0022-crlf-rename.sh      |  4 +-
 t/t0025-crlf-renormalize.sh |  4 +-
 t/t0027-auto-crlf.sh        | 12 +++---
 t/t0030-stripspace.sh       | 75 ++++++++++++++++++++++++-------------
 t/t0050-filesystem.sh       |  3 +-
 6 files changed, 66 insertions(+), 42 deletions(-)

Range-diff against v2:
1:  2a219ace42 ! 1:  5e122c0acf t0001-t0028: avoid pipes with Git on LHS
    @@ t/t0000-basic.sh: test_expect_success 'update-index D/F conflict' '
      '
      
     @@ t/t0000-basic.sh: test_expect_success 'very long name in the index handled sanely' '
    + 
      	>path4 &&
      	git update-index --add path4 &&
    ++	git ls-files -s path4 >tmp &&
      	(
     -		git ls-files -s path4 |
     -		sed -e "s/	.*/	/" |
    -+		git ls-files -s path4 >tmp &&
     +		sed -e "s/	.*/	/" tmp |
      		tr -d "\012" &&
      		echo "$a"
2:  c90fc271d9 ! 2:  c412380af3 t0030-t0050: avoid pipes with Git on LHS
    @@ t/t0030-stripspace.sh: test_expect_success \
     -    ! (printf "$ttt$sss$sss$sss" | git stripspace | grep "  " >/dev/null)
     +    printf "$ttt$sss" | git stripspace >tmp &&
     +    ! grep "  " tmp >/dev/null &&
    -+    printf "$ttt$ttt$sss" | git stripspace &&
    ++    printf "$ttt$ttt$sss" | git stripspace >tmp &&
     +    ! grep "  " tmp >/dev/null &&
    -+    printf "$ttt$ttt$ttt$sss" | git stripspace &&
    ++    printf "$ttt$ttt$ttt$sss" | git stripspace >tmp &&
     +    ! grep "  " tmp >/dev/null &&
    -+    printf "$ttt$sss$sss" | git stripspace &&
    ++    printf "$ttt$sss$sss" | git stripspace >tmp &&
     +    ! grep "  " tmp >/dev/null &&
    -+    printf "$ttt$ttt$sss$sss" | git stripspace &&
    ++    printf "$ttt$ttt$sss$sss" | git stripspace >tmp &&
     +    ! grep "  " tmp >/dev/null &&
    -+    printf "$ttt$sss$sss$sss" | git stripspace &&
    ++    printf "$ttt$sss$sss$sss" | git stripspace >tmp &&
     +    ! grep "  " tmp >/dev/null
      '
      
    @@ t/t0030-stripspace.sh: test_expect_success \
     +    echo "$ttt$sss" | git stripspace >tmp &&
     +    ! grep "  " tmp >/dev/null &&
     +    echo "$ttt$ttt$sss" | git stripspace >tmp &&
    -+    ! grep "  " tmp>/dev/null &&
    -+    echo "$ttt$ttt$ttt$sss" &&
    ++    ! grep "  " tmp >/dev/null &&
    ++    echo "$ttt$ttt$ttt$sss" | git stripspace >tmp &&
     +    ! grep "  " tmp >/dev/null &&
     +    echo "$ttt$sss$sss" | git stripspace >tmp &&
     +    ! grep "  " tmp >/dev/null &&

Comments

Johannes Sixt March 12, 2022, 9:05 a.m. UTC | #1
Am 12.03.22 um 07:21 schrieb Shubham Mishra:
> changes since v2:
> * t0000: remove git command out of subshell
> * t0030: fix missing redirections to "tmp" file
> Shubham Mishra (2):
>   t0001-t0028: avoid pipes with Git on LHS
>   t0030-t0050: avoid pipes with Git on LHS
> 
>  t/t0000-basic.sh            | 10 +++--
>  t/t0022-crlf-rename.sh      |  4 +-
>  t/t0025-crlf-renormalize.sh |  4 +-
>  t/t0027-auto-crlf.sh        | 12 +++---
>  t/t0030-stripspace.sh       | 75 ++++++++++++++++++++++++-------------
>  t/t0050-filesystem.sh       |  3 +-
>  6 files changed, 66 insertions(+), 42 deletions(-)
> 
> Range-diff against v2:
> 1:  2a219ace42 ! 1:  5e122c0acf t0001-t0028: avoid pipes with Git on LHS
>     @@ t/t0000-basic.sh: test_expect_success 'update-index D/F conflict' '
>       '
>       
>      @@ t/t0000-basic.sh: test_expect_success 'very long name in the index handled sanely' '
>     + 
>       	>path4 &&
>       	git update-index --add path4 &&
>     ++	git ls-files -s path4 >tmp &&
>       	(
>      -		git ls-files -s path4 |
>      -		sed -e "s/	.*/	/" |
>     -+		git ls-files -s path4 >tmp &&
>      +		sed -e "s/	.*/	/" tmp |
>       		tr -d "\012" &&
>       		echo "$a"
> 2:  c90fc271d9 ! 2:  c412380af3 t0030-t0050: avoid pipes with Git on LHS
>     @@ t/t0030-stripspace.sh: test_expect_success \
>      -    ! (printf "$ttt$sss$sss$sss" | git stripspace | grep "  " >/dev/null)
>      +    printf "$ttt$sss" | git stripspace >tmp &&
>      +    ! grep "  " tmp >/dev/null &&
>     -+    printf "$ttt$ttt$sss" | git stripspace &&
>     ++    printf "$ttt$ttt$sss" | git stripspace >tmp &&
>      +    ! grep "  " tmp >/dev/null &&
>     -+    printf "$ttt$ttt$ttt$sss" | git stripspace &&
>     ++    printf "$ttt$ttt$ttt$sss" | git stripspace >tmp &&
>      +    ! grep "  " tmp >/dev/null &&
>     -+    printf "$ttt$sss$sss" | git stripspace &&
>     ++    printf "$ttt$sss$sss" | git stripspace >tmp &&
>      +    ! grep "  " tmp >/dev/null &&
>     -+    printf "$ttt$ttt$sss$sss" | git stripspace &&
>     ++    printf "$ttt$ttt$sss$sss" | git stripspace >tmp &&
>      +    ! grep "  " tmp >/dev/null &&
>     -+    printf "$ttt$sss$sss$sss" | git stripspace &&
>     ++    printf "$ttt$sss$sss$sss" | git stripspace >tmp &&
>      +    ! grep "  " tmp >/dev/null
>       '
>       
>     @@ t/t0030-stripspace.sh: test_expect_success \
>      +    echo "$ttt$sss" | git stripspace >tmp &&
>      +    ! grep "  " tmp >/dev/null &&
>      +    echo "$ttt$ttt$sss" | git stripspace >tmp &&
>     -+    ! grep "  " tmp>/dev/null &&
>     -+    echo "$ttt$ttt$ttt$sss" &&
>     ++    ! grep "  " tmp >/dev/null &&
>     ++    echo "$ttt$ttt$ttt$sss" | git stripspace >tmp &&
>      +    ! grep "  " tmp >/dev/null &&
>      +    echo "$ttt$sss$sss" | git stripspace >tmp &&
>      +    ! grep "  " tmp >/dev/null &&

This round addresses all my comments. Thanks!

-- Hannes
Shubham Mishra March 12, 2022, 10:27 a.m. UTC | #2
> This round addresses all my comments. Thanks!
>
Thanks, this series really helped me learn how code reviewing works here :).
looking forward to picking other tasks.

Thanks,
Shubham