Re: [PATCH 08/20] git-mergetool.sh: avoid test cond -a/-o cond

2014-06-10 Thread David Aguilar
On Fri, Jun 6, 2014 at 7:55 AM, Elia Pinto gitter.spi...@gmail.com wrote:
 The construct is error-prone; test being built-in in most modern
 shells, the reason to avoid test cond  test cond spawning
 one extra process by using a single test cond -a cond no
 longer exists.

 Signed-off-by: Elia Pinto gitter.spi...@gmail.com
 ---

This looks good to me.  Thanks Elia,

Acked-by: David Aguilar dav...@gmail.com

  git-mergetool.sh |4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

 diff --git a/git-mergetool.sh b/git-mergetool.sh
 index d08dc92..9a046b7 100755
 --- a/git-mergetool.sh
 +++ b/git-mergetool.sh
 @@ -205,7 +205,7 @@ checkout_staged_file () {
 $(git checkout-index --temp --stage=$1 $2 2/dev/null) \
 : '\([^ ]*\)')

 -   if test $? -eq 0 -a -n $tmpfile
 +   if test $? -eq 0  test -n $tmpfile
 then
 mv -- $(git rev-parse --show-cdup)$tmpfile $3
 else
 @@ -256,7 +256,7 @@ merge_file () {
 checkout_staged_file 2 $MERGED $LOCAL
 checkout_staged_file 3 $MERGED $REMOTE

 -   if test -z $local_mode -o -z $remote_mode
 +   if test -z $local_mode || test -z $remote_mode
 then
 echo Deleted merge conflict for '$MERGED':
 describe_file $local_mode local $LOCAL
 --
 1.7.10.4

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


[PATCH 08/20] git-mergetool.sh: avoid test cond -a/-o cond

2014-06-06 Thread Elia Pinto
The construct is error-prone; test being built-in in most modern
shells, the reason to avoid test cond  test cond spawning
one extra process by using a single test cond -a cond no
longer exists.

Signed-off-by: Elia Pinto gitter.spi...@gmail.com
---
 git-mergetool.sh |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/git-mergetool.sh b/git-mergetool.sh
index d08dc92..9a046b7 100755
--- a/git-mergetool.sh
+++ b/git-mergetool.sh
@@ -205,7 +205,7 @@ checkout_staged_file () {
$(git checkout-index --temp --stage=$1 $2 2/dev/null) \
: '\([^ ]*\)')
 
-   if test $? -eq 0 -a -n $tmpfile
+   if test $? -eq 0  test -n $tmpfile
then
mv -- $(git rev-parse --show-cdup)$tmpfile $3
else
@@ -256,7 +256,7 @@ merge_file () {
checkout_staged_file 2 $MERGED $LOCAL
checkout_staged_file 3 $MERGED $REMOTE
 
-   if test -z $local_mode -o -z $remote_mode
+   if test -z $local_mode || test -z $remote_mode
then
echo Deleted merge conflict for '$MERGED':
describe_file $local_mode local $LOCAL
-- 
1.7.10.4

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