{"thread":{"id":"36666","subject":"[PATCH 01/10] check_bindir: don't use the -a or -o option with the test command","startedAt":"2014-05-15T14:21:41Z","lastAt":"2014-05-15T17:07:59Z","messageCount":12,"participants":["Elia Pinto","Matthieu Moy","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":10},"messages":[{"id":"241674","messageId":"1400163710-28333-1-git-send-email-gitter.spiros@gmail.com","threadId":"36666","inReplyTo":null,"subject":"[PATCH 01/10] check_bindir: don't use the -a or -o option with the test command","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-05-15T14:21:41Z","receivedAt":"2014-05-15T14:21:41Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"Even though POSIX.1 lists -a/-o as options to \"test\", they are\nmarked \"Obsolescent XSI\". Scripts using these expressions\nshould be converted  as follow:\n\ntest \"$1\" -a \"$2\"\n\nshould be written as:\n\ntest \"$1\" && test \"$2\"\n\nLikewise\n\ntest \"$1\" -o \"$2\"\n\nshould be written as:\n\ntest \"$1\"  test \"$2\"\n\nBut note that, in test, -a has higher precedence than -o while\n\"&&\" and \"||\" have equal precedence in the shell.\n\nThe reason for this is that the precedence rules were never well\nspecified, and this made many sane-looking uses of \"test -a/-o\" problematic.\n\nFor example, if $x is \"=\", these work according to POSIX (it's not\nportable, but in practice it's okay):\n\n   $ test -z \"$x\"\n   $ test -z \"$x\" && test a = b\n\nbut this doesn't\n\n   $ test -z \"$x\" -a a = b\n   bash: test: too many arguments\n\nbecause it groups \"test -n = -a\" and is left with \"a = b\".\n\nSimilarly, if $x is \"-f\", these\n\n   $ test \"$x\"\n   $ test \"$x\" || test c = d\n\ncorrectly adds an implicit \"-n\", but this fails:\n\n   $ test \"$x\" -o c = d\n   bash: test: too many arguments\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\n---\nInspired from this discussion http://permalink.gmane.org/gmane.comp.version-control.git/137056\n\n check_bindir |    2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/check_bindir b/check_bindir\nindex a1c4c3e..623eadc 100755\n--- a/check_bindir\n+++ b/check_bindir\n@@ -2,7 +2,7 @@\n bindir=\"$1\"\n gitexecdir=\"$2\"\n gitcmd=\"$3\"\n-if test \"$bindir\" != \"$gitexecdir\" -a -x \"$gitcmd\"\n+if test \"$bindir\" != \"$gitexecdir\" && test -x \"$gitcmd\"\n then\n \techo\n \techo \"!! You have installed git-* commands to new gitexecdir.\"\n-- \n1.7.10.4\n"},{"id":"241682","messageId":"1400163710-28333-2-git-send-email-gitter.spiros@gmail.com","threadId":"36666","inReplyTo":"1400163710-28333-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 02/10] contrib/examples/git-clone.sh: don't use the -a or -o option with the test command","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-05-15T14:21:42Z","receivedAt":"2014-05-15T14:21:42Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"Even though POSIX.1 lists -a/-o as options to \"test\", they are\nmarked \"Obsolescent XSI\". Scripts using these expressions\nshould be converted  as follow:\n\ntest \"$1\" -a \"$2\"\n\nshould be written as:\n\ntest \"$1\" && test \"$2\"\n\nLikewise\n\ntest \"$1\" -o \"$2\"\n\nshould be written as:\n\ntest \"$1\"  test \"$2\"\n\nBut note that, in test, -a has higher precedence than -o while\n\"&&\" and \"||\" have equal precedence in the shell.\n\nThe reason for this is that the precedence rules were never well\nspecified, and this made many sane-looking uses of \"test -a/-o\" problematic.\n\nFor example, if $x is \"=\", these work according to POSIX (it's not\nportable, but in practice it's okay):\n\n   $ test -z \"$x\"\n   $ test -z \"$x\" && test a = b\n\nbut this doesn't\n\n   $ test -z \"$x\" -a a = b\n   bash: test: too many arguments\n\nbecause it groups \"test -n = -a\" and is left with \"a = b\".\n\nSimilarly, if $x is \"-f\", these\n\n   $ test \"$x\"\n   $ test \"$x\" || test c = d\n\ncorrectly adds an implicit \"-n\", but this fails:\n\n   $ test \"$x\" -o c = d\n   bash: test: too many arguments\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\n---\nInspired from this discussion http://permalink.gmane.org/gmane.comp.version-control.git/137056\n\n contrib/examples/git-clone.sh |    2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/contrib/examples/git-clone.sh b/contrib/examples/git-clone.sh\nindex b4c9376..08cf246 100755\n--- a/contrib/examples/git-clone.sh\n+++ b/contrib/examples/git-clone.sh\n@@ -516,7 +516,7 @@ then\n \n \tcase \"$no_checkout\" in\n \t'')\n-\t\ttest \"z$quiet\" = z -a \"z$no_progress\" = z && v=-v || v=\n+\t\ttest \"z$quiet\" = z && test \"z$no_progress\" = z && v=-v || v=\n \t\tgit read-tree -m -u $v HEAD HEAD\n \tesac\n fi\n-- \n1.7.10.4\n"},{"id":"241675","messageId":"1400163710-28333-3-git-send-email-gitter.spiros@gmail.com","threadId":"36666","inReplyTo":"1400163710-28333-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 03/10] contrib/examples/git-commit.sh: don't use the -a or -o option with the test command","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-05-15T14:21:43Z","receivedAt":"2014-05-15T14:21:43Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"Even though POSIX.1 lists -a/-o as options to \"test\", they are\nmarked \"Obsolescent XSI\". Scripts using these expressions\nshould be converted  as follow:\n\ntest \"$1\" -a \"$2\"\n\nshould be written as:\n\ntest \"$1\" && test \"$2\"\n\nLikewise\n\ntest \"$1\" -o \"$2\"\n\nshould be written as:\n\ntest \"$1\"  test \"$2\"\n\nBut note that, in test, -a has higher precedence than -o while\n\"&&\" and \"||\" have equal precedence in the shell.\n\nThe reason for this is that the precedence rules were never well\nspecified, and this made many sane-looking uses of \"test -a/-o\" problematic.\n\nFor example, if $x is \"=\", these work according to POSIX (it's not\nportable, but in practice it's okay):\n\n   $ test -z \"$x\"\n   $ test -z \"$x\" && test a = b\n\nbut this doesn't\n\n   $ test -z \"$x\" -a a = b\n   bash: test: too many arguments\n\nbecause it groups \"test -n = -a\" and is left with \"a = b\".\n\nSimilarly, if $x is \"-f\", these\n\n   $ test \"$x\"\n   $ test \"$x\" || test c = d\n\ncorrectly adds an implicit \"-n\", but this fails:\n\n   $ test \"$x\" -o c = d\n   bash: test: too many arguments\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\n---\nInspired from this discussion http://permalink.gmane.org/gmane.comp.version-control.git/137056\n\n contrib/examples/git-commit.sh |    4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/contrib/examples/git-commit.sh b/contrib/examples/git-commit.sh\nindex 5cafe2e..934505b 100755\n--- a/contrib/examples/git-commit.sh\n+++ b/contrib/examples/git-commit.sh\n@@ -51,7 +51,7 @@ run_status () {\n \t\texport GIT_INDEX_FILE\n \tfi\n \n-\tif test \"$status_only\" = \"t\" -o \"$use_status_color\" = \"t\"; then\n+\tif test \"$status_only\" = \"t\" || test \"$use_status_color\" = \"t\"; then\n \t\tcolor=\n \telse\n \t\tcolor=--nocolor\n@@ -296,7 +296,7 @@ t,,,[1-9]*)\n \tdie \"No paths with -i does not make sense.\" ;;\n esac\n \n-if test ! -z \"$templatefile\" -a -z \"$log_given\"\n+if test ! -z \"$templatefile\" && test -z \"$log_given\"\n then\n \tif test ! -f \"$templatefile\"\n \tthen\n-- \n1.7.10.4\n"},{"id":"241683","messageId":"1400163710-28333-4-git-send-email-gitter.spiros@gmail.com","threadId":"36666","inReplyTo":"1400163710-28333-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 04/10] contrib/examples/git-merge.sh: don't use the -a or -o option with the test command","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-05-15T14:21:44Z","receivedAt":"2014-05-15T14:21:44Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"Even though POSIX.1 lists -a/-o as options to \"test\", they are\nmarked \"Obsolescent XSI\". Scripts using these expressions\nshould be converted  as follow:\n\ntest \"$1\" -a \"$2\"\n\nshould be written as:\n\ntest \"$1\" && test \"$2\"\n\nLikewise\n\ntest \"$1\" -o \"$2\"\n\nshould be written as:\n\ntest \"$1\"  test \"$2\"\n\nBut note that, in test, -a has higher precedence than -o while\n\"&&\" and \"||\" have equal precedence in the shell.\n\nThe reason for this is that the precedence rules were never well\nspecified, and this made many sane-looking uses of \"test -a/-o\" problematic.\n\nFor example, if $x is \"=\", these work according to POSIX (it's not\nportable, but in practice it's okay):\n\n   $ test -z \"$x\"\n   $ test -z \"$x\" && test a = b\n\nbut this doesn't\n\n   $ test -z \"$x\" -a a = b\n   bash: test: too many arguments\n\nbecause it groups \"test -n = -a\" and is left with \"a = b\".\n\nSimilarly, if $x is \"-f\", these\n\n   $ test \"$x\"\n   $ test \"$x\" || test c = d\n\ncorrectly adds an implicit \"-n\", but this fails:\n\n   $ test \"$x\" -o c = d\n   bash: test: too many arguments\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\n---\nInspired from this discussion http://permalink.gmane.org/gmane.comp.version-control.git/137056\n\n contrib/examples/git-merge.sh |    4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/contrib/examples/git-merge.sh b/contrib/examples/git-merge.sh\nindex 7e40f40..52f2aaf 100755\n--- a/contrib/examples/git-merge.sh\n+++ b/contrib/examples/git-merge.sh\n@@ -161,7 +161,7 @@ merge_name () {\n \t\t\treturn\n \t\tfi\n \tfi\n-\tif test \"$remote\" = \"FETCH_HEAD\" -a -r \"$GIT_DIR/FETCH_HEAD\"\n+\tif test \"$remote\" = \"FETCH_HEAD\" && test -r \"$GIT_DIR/FETCH_HEAD\"\n \tthen\n \t\tsed -e 's/\tnot-for-merge\t/\t\t/' -e 1q \\\n \t\t\t\"$GIT_DIR/FETCH_HEAD\"\n@@ -527,7 +527,7 @@ do\n \t\tgit diff-files --name-only\n \t\tgit ls-files --unmerged\n \t    } | wc -l`\n-\t    if test $best_cnt -le 0 -o $cnt -le $best_cnt\n+\t    if test $best_cnt -le 0 || test $cnt -le $best_cnt\n \t    then\n \t\tbest_strategy=$strategy\n \t\tbest_cnt=$cnt\n-- \n1.7.10.4\n"},{"id":"241676","messageId":"1400163710-28333-5-git-send-email-gitter.spiros@gmail.com","threadId":"36666","inReplyTo":"1400163710-28333-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 05/10] contrib/examples/git-repack.sh: don't use the -a or -o option with the test command","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-05-15T14:21:45Z","receivedAt":"2014-05-15T14:21:45Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"Even though POSIX.1 lists -a/-o as options to \"test\", they are\nmarked \"Obsolescent XSI\". Scripts using these expressions\nshould be converted  as follow:\n\ntest \"$1\" -a \"$2\"\n\nshould be written as:\n\ntest \"$1\" && test \"$2\"\n\nLikewise\n\ntest \"$1\" -o \"$2\"\n\nshould be written as:\n\ntest \"$1\"  test \"$2\"\n\nBut note that, in test, -a has higher precedence than -o while\n\"&&\" and \"||\" have equal precedence in the shell.\n\nThe reason for this is that the precedence rules were never well\nspecified, and this made many sane-looking uses of \"test -a/-o\" problematic.\n\nFor example, if $x is \"=\", these work according to POSIX (it's not\nportable, but in practice it's okay):\n\n   $ test -z \"$x\"\n   $ test -z \"$x\" && test a = b\n\nbut this doesn't\n\n   $ test -z \"$x\" -a a = b\n   bash: test: too many arguments\n\nbecause it groups \"test -n = -a\" and is left with \"a = b\".\n\nSimilarly, if $x is \"-f\", these\n\n   $ test \"$x\"\n   $ test \"$x\" || test c = d\n\ncorrectly adds an implicit \"-n\", but this fails:\n\n   $ test \"$x\" -o c = d\n   bash: test: too many arguments\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\n---\nInspired from this discussion http://permalink.gmane.org/gmane.comp.version-control.git/137056\n\n contrib/examples/git-repack.sh |    4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/contrib/examples/git-repack.sh b/contrib/examples/git-repack.sh\nindex f312405..96e3fed 100755\n--- a/contrib/examples/git-repack.sh\n+++ b/contrib/examples/git-repack.sh\n@@ -76,8 +76,8 @@ case \",$all_into_one,\" in\n \t\t\t\texisting=\"$existing $e\"\n \t\t\tfi\n \t\tdone\n-\t\tif test -n \"$existing\" -a -n \"$unpack_unreachable\" -a \\\n-\t\t\t-n \"$remove_redundant\"\n+\t\tif test -n \"$existing\" && test -n \"$unpack_unreachable\" && \\\n+\t\t\ttest -n \"$remove_redundant\"\n \t\tthen\n \t\t\t# This may have arbitrary user arguments, so we\n \t\t\t# have to protect it against whitespace splitting\n-- \n1.7.10.4\n"},{"id":"241677","messageId":"1400163710-28333-6-git-send-email-gitter.spiros@gmail.com","threadId":"36666","inReplyTo":"1400163710-28333-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 06/10] contrib/examples/git-resolve.sh: don't use the -a or -b option with the test command","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-05-15T14:21:46Z","receivedAt":"2014-05-15T14:21:46Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"Even though POSIX.1 lists -a/-o as options to \"test\", they are\nmarked \"Obsolescent XSI\". Scripts using these expressions\nshould be converted  as follow:\n\ntest \"$1\" -a \"$2\"\n\nshould be written as:\n\ntest \"$1\" && test \"$2\"\n\nLikewise\n\ntest \"$1\" -o \"$2\"\n\nshould be written as:\n\ntest \"$1\"  test \"$2\"\n\nBut note that, in test, -a has higher precedence than -o while\n\"&&\" and \"||\" have equal precedence in the shell.\n\nThe reason for this is that the precedence rules were never well\nspecified, and this made many sane-looking uses of \"test -a/-o\" problematic.\n\nFor example, if $x is \"=\", these work according to POSIX (it's not\nportable, but in practice it's okay):\n\n   $ test -z \"$x\"\n   $ test -z \"$x\" && test a = b\n\nbut this doesn't\n\n   $ test -z \"$x\" -a a = b\n   bash: test: too many arguments\n\nbecause it groups \"test -n = -a\" and is left with \"a = b\".\n\nSimilarly, if $x is \"-f\", these\n\n   $ test \"$x\"\n   $ test \"$x\" || test c = d\n\ncorrectly adds an implicit \"-n\", but this fails:\n\n   $ test \"$x\" -o c = d\n   bash: test: too many arguments\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\n---\nInspired from this discussion http://permalink.gmane.org/gmane.comp.version-control.git/137056\n\n contrib/examples/git-resolve.sh |    2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/contrib/examples/git-resolve.sh b/contrib/examples/git-resolve.sh\nindex 48d0fc9..70fdc27 100755\n--- a/contrib/examples/git-resolve.sh\n+++ b/contrib/examples/git-resolve.sh\n@@ -76,7 +76,7 @@ case \"$common\" in\n \t\t\t2>/dev/null || continue\n \t\t# Count the paths that are unmerged.\n \t\tcnt=$(GIT_INDEX_FILE=$G git ls-files --unmerged | wc -l)\n-\t\tif test $best_cnt -le 0 -o $cnt -le $best_cnt\n+\t\tif test $best_cnt -le 0 || test $cnt -le $best_cnt\n \t\tthen\n \t\t\tbest=$c\n \t\t\tbest_cnt=$cnt\n-- \n1.7.10.4\n"},{"id":"241678","messageId":"1400163710-28333-7-git-send-email-gitter.spiros@gmail.com","threadId":"36666","inReplyTo":"1400163710-28333-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 07/10] git-bisect.sh: don't use the -a or -o option with the test command","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-05-15T14:21:47Z","receivedAt":"2014-05-15T14:21:47Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"Even though POSIX.1 lists -a/-o as options to \"test\", they are\nmarked \"Obsolescent XSI\". Scripts using these expressions\nshould be converted  as follow:\n\ntest \"$1\" -a \"$2\"\n\nshould be written as:\n\ntest \"$1\" && test \"$2\"\n\nLikewise\n\ntest \"$1\" -o \"$2\"\n\nshould be written as:\n\ntest \"$1\"  test \"$2\"\n\nBut note that, in test, -a has higher precedence than -o while\n\"&&\" and \"||\" have equal precedence in the shell.\n\nThe reason for this is that the precedence rules were never well\nspecified, and this made many sane-looking uses of \"test -a/-o\" problematic.\n\nFor example, if $x is \"=\", these work according to POSIX (it's not\nportable, but in practice it's okay):\n\n   $ test -z \"$x\"\n   $ test -z \"$x\" && test a = b\n\nbut this doesn't\n\n   $ test -z \"$x\" -a a = b\n   bash: test: too many arguments\n\nbecause it groups \"test -n = -a\" and is left with \"a = b\".\n\nSimilarly, if $x is \"-f\", these\n\n   $ test \"$x\"\n   $ test \"$x\" || test c = d\n\ncorrectly adds an implicit \"-n\", but this fails:\n\n   $ test \"$x\" -o c = d\n   bash: test: too many arguments\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\n---\nInspired from this discussion http://permalink.gmane.org/gmane.comp.version-control.git/137056\n\n git-bisect.sh |    2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/git-bisect.sh b/git-bisect.sh\nindex af4d04c..1e0d602 100755\n--- a/git-bisect.sh\n+++ b/git-bisect.sh\n@@ -408,7 +408,7 @@ bisect_replay () {\n \tbisect_reset\n \twhile read git bisect command rev\n \tdo\n-\t\ttest \"$git $bisect\" = \"git bisect\" -o \"$git\" = \"git-bisect\" || continue\n+\t\ttest \"$git $bisect\" = \"git bisect\" || test \"$git\" = \"git-bisect\" || continue\n \t\tif test \"$git\" = \"git-bisect\"\n \t\tthen\n \t\t\trev=\"$command\"\n-- \n1.7.10.4\n"},{"id":"241680","messageId":"1400163710-28333-8-git-send-email-gitter.spiros@gmail.com","threadId":"36666","inReplyTo":"1400163710-28333-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 08/10] git-mergetool.sh: don't use the -a or -o option with the test command","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-05-15T14:21:48Z","receivedAt":"2014-05-15T14:21:48Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"Even though POSIX.1 lists -a/-o as options to \"test\", they are\nmarked \"Obsolescent XSI\". Scripts using these expressions\nshould be converted  as follow:\n\ntest \"$1\" -a \"$2\"\n\nshould be written as:\n\ntest \"$1\" && test \"$2\"\n\nLikewise\n\ntest \"$1\" -o \"$2\"\n\nshould be written as:\n\ntest \"$1\"  test \"$2\"\n\nBut note that, in test, -a has higher precedence than -o while\n\"&&\" and \"||\" have equal precedence in the shell.\n\nThe reason for this is that the precedence rules were never well\nspecified, and this made many sane-looking uses of \"test -a/-o\" problematic.\n\nFor example, if $x is \"=\", these work according to POSIX (it's not\nportable, but in practice it's okay):\n\n   $ test -z \"$x\"\n   $ test -z \"$x\" && test a = b\n\nbut this doesn't\n\n   $ test -z \"$x\" -a a = b\n   bash: test: too many arguments\n\nbecause it groups \"test -n = -a\" and is left with \"a = b\".\n\nSimilarly, if $x is \"-f\", these\n\n   $ test \"$x\"\n   $ test \"$x\" || test c = d\n\ncorrectly adds an implicit \"-n\", but this fails:\n\n   $ test \"$x\" -o c = d\n   bash: test: too many arguments\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\n---\nInspired from this discussion http://permalink.gmane.org/gmane.comp.version-control.git/137056\n\n git-mergetool.sh |    4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/git-mergetool.sh b/git-mergetool.sh\nindex 332528f..88e853f 100755\n--- a/git-mergetool.sh\n+++ b/git-mergetool.sh\n@@ -205,7 +205,7 @@ checkout_staged_file () {\n \t\t\"$(git checkout-index --temp --stage=\"$1\" \"$2\" 2>/dev/null)\" \\\n \t\t: '\\([^\t]*\\)\t')\n \n-\tif test $? -eq 0 -a -n \"$tmpfile\"\n+\tif test $? -eq 0 && test -n \"$tmpfile\"\n \tthen\n \t\tmv -- \"$(git rev-parse --show-cdup)$tmpfile\" \"$3\"\n \telse\n@@ -256,7 +256,7 @@ merge_file () {\n \tcheckout_staged_file 2 \"$MERGED\" \"$LOCAL\"\n \tcheckout_staged_file 3 \"$MERGED\" \"$REMOTE\"\n \n-\tif test -z \"$local_mode\" -o -z \"$remote_mode\"\n+\tif test -z \"$local_mode\" || test -z \"$remote_mode\"\n \tthen\n \t\techo \"Deleted merge conflict for '$MERGED':\"\n \t\tdescribe_file \"$local_mode\" \"local\" \"$LOCAL\"\n-- \n1.7.10.4\n"},{"id":"241679","messageId":"1400163710-28333-9-git-send-email-gitter.spiros@gmail.com","threadId":"36666","inReplyTo":"1400163710-28333-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 09/10] git-rebase--interactive.sh: don't use the -a or -o option with the test command","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-05-15T14:21:49Z","receivedAt":"2014-05-15T14:21:49Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"Even though POSIX.1 lists -a/-o as options to \"test\", they are\nmarked \"Obsolescent XSI\". Scripts using these expressions\nshould be converted  as follow:\n\ntest \"$1\" -a \"$2\"\n\nshould be written as:\n\ntest \"$1\" && test \"$2\"\n\nLikewise\n\ntest \"$1\" -o \"$2\"\n\nshould be written as:\n\ntest \"$1\"  test \"$2\"\n\nBut note that, in test, -a has higher precedence than -o while\n\"&&\" and \"||\" have equal precedence in the shell.\n\nThe reason for this is that the precedence rules were never well\nspecified, and this made many sane-looking uses of \"test -a/-o\" problematic.\n\nFor example, if $x is \"=\", these work according to POSIX (it's not\nportable, but in practice it's okay):\n\n   $ test -z \"$x\"\n   $ test -z \"$x\" && test a = b\n\nbut this doesn't\n\n   $ test -z \"$x\" -a a = b\n   bash: test: too many arguments\n\nbecause it groups \"test -n = -a\" and is left with \"a = b\".\n\nSimilarly, if $x is \"-f\", these\n\n   $ test \"$x\"\n   $ test \"$x\" || test c = d\n\ncorrectly adds an implicit \"-n\", but this fails:\n\n   $ test \"$x\" -o c = d\n   bash: test: too many arguments\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\n---\nInspired from this discussion http://permalink.gmane.org/gmane.comp.version-control.git/137056\n\n git-rebase--interactive.sh |    2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 6ec9d3c..797571f 100644\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -1013,7 +1013,7 @@ then\n \tgit rev-list $revisions |\n \twhile read rev\n \tdo\n-\t\tif test -f \"$rewritten\"/$rev -a \"$(sane_grep \"$rev\" \"$state_dir\"/not-cherry-picks)\" = \"\"\n+\t\tif test -f \"$rewritten\"/$rev && test \"$(sane_grep \"$rev\" \"$state_dir\"/not-cherry-picks)\" = \"\"\n \t\tthen\n \t\t\t# Use -f2 because if rev-list is telling us this commit is\n \t\t\t# not worthwhile, we don't want to track its multiple heads,\n-- \n1.7.10.4\n"},{"id":"241681","messageId":"1400163710-28333-10-git-send-email-gitter.spiros@gmail.com","threadId":"36666","inReplyTo":"1400163710-28333-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 10/10] git-submodule.sh: don't use the -a or -o option with the test command","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-05-15T14:21:50Z","receivedAt":"2014-05-15T14:21:50Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"Even though POSIX.1 lists -a/-o as options to \"test\", they are\nmarked \"Obsolescent XSI\". Scripts using these expressions\nshould be converted  as follow:\n\ntest \"$1\" -a \"$2\"\n\nshould be written as:\n\ntest \"$1\" && test \"$2\"\n\nLikewise\n\ntest \"$1\" -o \"$2\"\n\nshould be written as:\n\ntest \"$1\"  test \"$2\"\n\nBut note that, in test, -a has higher precedence than -o while\n\"&&\" and \"||\" have equal precedence in the shell.\n\nThe reason for this is that the precedence rules were never well\nspecified, and this made many sane-looking uses of \"test -a/-o\" problematic.\n\nFor example, if $x is \"=\", these work according to POSIX (it's not\nportable, but in practice it's okay):\n\n   $ test -z \"$x\"\n   $ test -z \"$x\" && test a = b\n\nbut this doesn't\n\n   $ test -z \"$x\" -a a = b\n   bash: test: too many arguments\n\nbecause it groups \"test -n = -a\" and is left with \"a = b\".\n\nSimilarly, if $x is \"-f\", these\n\n   $ test \"$x\"\n   $ test \"$x\" || test c = d\n\ncorrectly adds an implicit \"-n\", but this fails:\n\n   $ test \"$x\" -o c = d\n   bash: test: too many arguments\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\n---\nInspired from this discussion http://permalink.gmane.org/gmane.comp.version-control.git/137056\n\n git-submodule.sh |   14 +++++++-------\n 1 file changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex b55d83a..d89e1d0 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -864,7 +864,7 @@ Maybe you want to use 'update --init'?\")\"\n \t\tthen\n \t\t\tsubforce=$force\n \t\t\t# If we don't already have a -f flag and the submodule has never been checked out\n-\t\t\tif test -z \"$subsha1\" -a -z \"$force\"\n+\t\t\tif test -z \"$subsha1\" || test -z \"$force\"\n \t\t\tthen\n \t\t\t\tsubforce=\"-f\"\n \t\t\tfi\n@@ -1059,13 +1059,13 @@ cmd_summary() {\n \t\twhile read mod_src mod_dst sha1_src sha1_dst status sm_path\n \t\tdo\n \t\t\t# Always show modules deleted or type-changed (blob<->module)\n-\t\t\ttest $status = D -o $status = T && echo \"$sm_path\" && continue\n+                        ( test $status = D || test $status = T ) && echo \"$sm_path\" && continue\n \t\t\t# Respect the ignore setting for --for-status.\n \t\t\tif test -n \"$for_status\"\n \t\t\tthen\n \t\t\t\tname=$(module_name \"$sm_path\")\n \t\t\t\tignore_config=$(get_submodule_config \"$name\" ignore none)\n-\t\t\t\ttest $status != A -a $ignore_config = all && continue\n+\t\t\t\ttest $status != A && test $ignore_config = all && continue\n \t\t\tfi\n \t\t\t# Also show added or modified modules which are checked out\n \t\t\tGIT_DIR=\"$sm_path/.git\" git-rev-parse --git-dir >/dev/null 2>&1 &&\n@@ -1125,7 +1125,7 @@ cmd_summary() {\n \t\t*)\n \t\t\terrmsg=\n \t\t\ttotal_commits=$(\n-\t\t\tif test $mod_src = 160000 -a $mod_dst = 160000\n+\t\t\tif test $mod_src = 160000 && test $mod_dst = 160000\n \t\t\tthen\n \t\t\t\trange=\"$sha1_src...$sha1_dst\"\n \t\t\telif test $mod_src = 160000\n@@ -1162,7 +1162,7 @@ cmd_summary() {\n \t\t\t# i.e. deleted or changed to blob\n \t\t\ttest $mod_dst = 160000 && echo \"$errmsg\"\n \t\telse\n-\t\t\tif test $mod_src = 160000 -a $mod_dst = 160000\n+\t\t\tif test $mod_src = 160000 && test $mod_dst = 160000\n \t\t\tthen\n \t\t\t\tlimit=\n \t\t\t\ttest $summary_limit -gt 0 && limit=\"-$summary_limit\"\n@@ -1233,7 +1233,7 @@ cmd_status()\n \t\t\tsay \"U$sha1 $displaypath\"\n \t\t\tcontinue\n \t\tfi\n-\t\tif test -z \"$url\" || ! test -d \"$sm_path\"/.git -o -f \"$sm_path\"/.git\n+\t\tif test -z \"$url\" || ! test -d \"$sm_path\"/.git || test -f \"$sm_path\"/.git\n \t\tthen\n \t\t\tsay \"-$sha1 $displaypath\"\n \t\t\tcontinue;\n@@ -1402,7 +1402,7 @@ then\n fi\n \n # \"--cached\" is accepted only by \"status\" and \"summary\"\n-if test -n \"$cached\" && test \"$command\" != status -a \"$command\" != summary\n+if test -n \"$cached\" && test \"$command\" != status && test \"$command\" != summary\n then\n \tusage\n fi\n-- \n1.7.10.4\n"},{"id":"241689","messageId":"vpqr43v3tdo.fsf@anie.imag.fr","threadId":"36666","inReplyTo":"1400163710-28333-1-git-send-email-gitter.spiros@gmail.com","subject":"Re: [PATCH 01/10] check_bindir: don't use the -a or -o option with the test command","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2014-05-15T16:21:23Z","receivedAt":"2014-05-15T16:21:23Z","isPatch":true,"sender":{"key":"matthieu.moy@grenoble-inp.fr","avatar":"https://gravatar.com/avatar/72c8a2705971a25dfaff23cece15130d405685845d911aedd5667ace277f3fc5?d=mp&s=160"},"body":"Elia Pinto <gitter.spiros@gmail.com> writes:\n\n>    $ test -z \"$x\" -a a = b\n>    bash: test: too many arguments\n>\n> because it groups \"test -n = -a\" and is left with \"a = b\".\n\nI guess you meant -z, not -n.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"241701","messageId":"xmqq7g5ngec0.fsf@gitster.dls.corp.google.com","threadId":"36666","inReplyTo":"1400163710-28333-1-git-send-email-gitter.spiros@gmail.com","subject":"Re: [PATCH 01/10] check_bindir: don't use the -a or -o option with the test command","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-05-15T17:07:59Z","receivedAt":"2014-05-15T17:07:59Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Elia Pinto <gitter.spiros@gmail.com> writes:\n\n> Even though POSIX.1 lists -a/-o as options to \"test\", they are\n> marked \"Obsolescent XSI\". Scripts using these expressions\n> should be converted  as follow:\n>\n> test \"$1\" -a \"$2\"\n>\n> should be written as:\n>\n> test \"$1\" && test \"$2\"\n>\n> Likewise\n>\n> test \"$1\" -o \"$2\"\n>\n> should be written as:\n>\n> test \"$1\"  test \"$2\"\n\nSomething missing from here???\n\n> But note that, in test, -a has higher precedence than -o while\n> \"&&\" and \"||\" have equal precedence in the shell.\n>\n> The reason for this is that the precedence rules were never well\n> specified, and this made many sane-looking uses of \"test -a/-o\" problematic.\n>\n> For example, if $x is \"=\", these work according to POSIX (it's not\n> portable, but in practice it's okay):\n>\n>    $ test -z \"$x\"\n>    $ test -z \"$x\" && test a = b\n>\n> but this doesn't\n>\n>    $ test -z \"$x\" -a a = b\n>    bash: test: too many arguments\n>\n> because it groups \"test -n = -a\" and is left with \"a = b\".\n>\n> Similarly, if $x is \"-f\", these\n>\n>    $ test \"$x\"\n>    $ test \"$x\" || test c = d\n>\n> correctly adds an implicit \"-n\", but this fails:\n>\n>    $ test \"$x\" -o c = d\n>    bash: test: too many arguments\n>\n> Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>\n> ---\n> Inspired from this discussion http://permalink.gmane.org/gmane.comp.version-control.git/137056\n>\n>  check_bindir |    2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n>\n> diff --git a/check_bindir b/check_bindir\n> index a1c4c3e..623eadc 100755\n> --- a/check_bindir\n> +++ b/check_bindir\n> @@ -2,7 +2,7 @@\n>  bindir=\"$1\"\n>  gitexecdir=\"$2\"\n>  gitcmd=\"$3\"\n> -if test \"$bindir\" != \"$gitexecdir\" -a -x \"$gitcmd\"\n> +if test \"$bindir\" != \"$gitexecdir\" && test -x \"$gitcmd\"\n>  then\n>  \techo\n>  \techo \"!! You have installed git-* commands to new gitexecdir.\"\n"}]}