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

Re: [Xen-devel] [PATCH v4 for-4.10] scripts: introduce a script for build test



On Mon, Oct 30, 2017 at 04:01:54PM +0000, Wei Liu wrote:
> +git rev-list $BASE..$TIP | nl -ba | tac | \
> +while read num rev; do
> +    echo "Testing $num $rev"
> +
> +    git checkout $rev
> +    ret=$?
> +    if test $ret -ne 0; then
> +        echo "Failed to checkout $num $rev with $ret"

I don't think printing the return value of git-checkout is usefull, it
is just too much information.  git-checkout man page have nothing about
the meaning of it.


Beside that, and the fact that I don't like this style of while loop
where `exit` doesn't exit the script, but only the loop ...

Reviewed-by: Anthony PERARD <anthony.perard@xxxxxxxxxx>


FIY: One would write the loop like this:
while read num rev; do
  :
done < <(git rev-list $BASE..$TIP | nl -ba | tac)

And then you could ret=$?;break; inside the loop, and have the correct
$ret value after the loop.

-- 
Anthony PERARD

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.