Re: [PATCH] t5801: properly test the test shell

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Johannes Sixt venit, vidit, dixit 25.04.2013 12:59:
> Am 4/25/2013 12:09, schrieb Michael J Gruber:
>> fc407f9 (Add new simplified git-remote-testgit, 2012-11-28) introduced a
>> test which was meant to skip the test unless the test shell is bash.
>> Unfortunately, it tests for the availability of bash only. But users can
>> opt to use a different shell (using SHELL_PATH) for the tests even though
>> bash is available.
> 
> After my patch this morning ("avoid process substitution"), there is not
> much bashism left in git-remote-testgit:

Is that a patch you submitted?

> diff --git a/git-remote-testgit b/git-remote-testgit
> index e99d5fa..178d030 100755
> --- a/git-remote-testgit
> +++ b/git-remote-testgit
> @@ -1,4 +1,4 @@
> -#!/usr/bin/env bash
> +#!/bin/sh
>  # Copyright (c) 2012 Felipe Contreras
>  
>  alias=$1
> @@ -23,7 +23,6 @@ then
>  	testgitmarks="$dir/testgit.marks"
>  	test -e "$gitmarks" || >"$gitmarks"
>  	test -e "$testgitmarks" || >"$testgitmarks"
> -	testgitmarks_args=( "--"{import,export}"-marks=$testgitmarks" )
>  fi
>  
>  while read line
> @@ -70,7 +69,10 @@ do
>  		fi
>  
>  		echo "feature done"
> -		git fast-export "${testgitmarks_args[@]}" $refs |
> +		git fast-export \
> +			${testgitmarks:+"--import-marks=$testgitmarks"} \
> +			${testgitmarks:+"--export-marks=$testgitmarks"} \
> +			$refs |
>  		sed -e "s#refs/heads/#${prefix}/heads/#g"
>  		echo "done"
>  		;;
> @@ -89,7 +91,10 @@ do
>  
>  		before=$(git for-each-ref --format='%(refname) %(objectname)')
>  
> -		git fast-import "${testgitmarks_args[@]}" --quiet
> +		git fast-import \
> +			${testgitmarks:+"--import-marks=$testgitmarks"} \
> +			${testgitmarks:+"--export-marks=$testgitmarks"} \
> +			--quiet
>  
>  		# figure out which refs were updated
>  		git for-each-ref --format='%(refname) %(objectname)' |
> 
> What's left is to take care of the shbang line, remove the bash
> check from t5801, make a proper commit from this patch. But I leave
> that to the interested reader. :-)
> 

No, the problem (that I'm adressing) is not git-remote-testgit which
uses bash unconditionally, independent of SHELL_PATH.

The problem is bashism(s) in t5801 itself. That is completely orthogonal
to your (non-) patch.

Michael
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]