{"thread":{"id":"36708","subject":"[PATCH 00/19] convert test -a/-o to && and || patch series","startedAt":"2014-05-20T13:50:13Z","lastAt":"2014-05-20T18:54:30Z","messageCount":27,"participants":["Elia Pinto","Matthieu Moy","Johannes Sixt","Junio C Hamano","Jonathan Nieder"],"isPatch":true,"patchVersion":1,"patchTotal":19},"messages":[{"id":"242242","messageId":"1400593832-6510-1-git-send-email-gitter.spiros@gmail.com","threadId":"36708","inReplyTo":null,"subject":"[PATCH 00/19] convert test -a/-o to && and || patch series","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-05-20T13:50:13Z","receivedAt":"2014-05-20T13:50:13Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"\nThese patch series  convert test -a/-o to && and ||.\n\nThis is the second version.\n\nChanges:\n\n- Modified commit comment based on Jonathan Nieder suggestions\n(was \"don't use the -a or -o option with the test command\")\n\n- Modified patch on git-submodule.sh based on Jonathan Nieder suggestions\n\n\nElia Pinto (19):\n  check_bindir: convert test -a/-o to && and ||\n  contrib/examples/git-clone.sh: convert test -a/-o to && and ||\n  contrib/examples/git-commit.sh: convert test -a/-o to && and ||\n  contrib/examples/git-merge.sh: convert test -a/-o to && and ||\n  contrib/examples/git-repack.sh: convert test -a/-o to && and ||\n  contrib/examples/git-resolve.sh: convert test -a/-o to && and ||\n  git-bisect.sh: convert test -a/-o to && and ||\n  git-mergetool.sh: convert test -a/-o to && and ||\n  git-rebase--interactive.sh: convert test -a/-o to && and ||\n  git-submodule.sh: convert test -a/-o to && and ||\n  t/t0025-crlf-auto.sh: convert test -a/-o to && and ||\n  t/t0026-eol-config.sh: convert test -a/-o to && and ||\n  t/t4102-apply-rename.sh: convert test -a/-o to && and ||\n  t/t5000-tar-tree.sh: convert test -a/-o to && and ||\n  t/t5403-post-checkout-hook.sh: convert test -a/-o to && and ||\n  t/t5537-fetch-shallow.sh: convert test -a/-o to && and ||\n  t/t5538-push-shallow.sh: convert test -a/-o to && and ||\n  t/t9814-git-p4-rename.sh: convert test -a/-o to && and ||\n  t/test-lib-functions.sh: convert test -a/-o to && and ||\n\n check_bindir                    |    2 +-\n contrib/examples/git-clone.sh   |    2 +-\n contrib/examples/git-commit.sh  |    4 ++--\n contrib/examples/git-merge.sh   |    4 ++--\n contrib/examples/git-repack.sh  |    4 ++--\n contrib/examples/git-resolve.sh |    2 +-\n git-bisect.sh                   |    2 +-\n git-mergetool.sh                |    4 ++--\n git-rebase--interactive.sh      |    2 +-\n git-submodule.sh                |   29 +++++++++++++++++------------\n t/t0025-crlf-auto.sh            |    6 +++---\n t/t0026-eol-config.sh           |    8 ++++----\n t/t4102-apply-rename.sh         |    2 +-\n t/t5000-tar-tree.sh             |    2 +-\n t/t5403-post-checkout-hook.sh   |    8 ++++----\n t/t5537-fetch-shallow.sh        |    2 +-\n t/t5538-push-shallow.sh         |    2 +-\n t/t9814-git-p4-rename.sh        |    4 ++--\n t/test-lib-functions.sh         |    4 ++--\n 19 files changed, 49 insertions(+), 44 deletions(-)\n\n-- \n1.7.10.4\n"},{"id":"242243","messageId":"1400593832-6510-2-git-send-email-gitter.spiros@gmail.com","threadId":"36708","inReplyTo":"1400593832-6510-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 01/19] check_bindir: convert test -a/-o to && and ||","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-05-20T13:50:14Z","receivedAt":"2014-05-20T13:50:14Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The interaction with unary operators and operator precedence\nfor && and || are better known than -a and -o, and for that\nreason we prefer them. Replace all existing instances\nof -a and -o to save readers from the burden of thinking\nabout such things.\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\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":"242244","messageId":"1400593832-6510-3-git-send-email-gitter.spiros@gmail.com","threadId":"36708","inReplyTo":"1400593832-6510-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 02/19] contrib/examples/git-clone.sh: convert test -a/-o to && and ||","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-05-20T13:50:15Z","receivedAt":"2014-05-20T13:50:15Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The interaction with unary operators and operator precedence\nfor && and || are better known than -a and -o, and for that\nreason we prefer them. Replace all existing instances\nof -a and -o to save readers from the burden of thinking\nabout such things.\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\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":"242261","messageId":"1400593832-6510-4-git-send-email-gitter.spiros@gmail.com","threadId":"36708","inReplyTo":"1400593832-6510-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 03/19] contrib/examples/git-commit.sh: convert test -a/-o to && and ||","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-05-20T13:50:16Z","receivedAt":"2014-05-20T13:50:16Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The interaction with unary operators and operator precedence\nfor && and || are better known than -a and -o, and for that\nreason we prefer them. Replace all existing instances\nof -a and -o to save readers from the burden of thinking\nabout such things.\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\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":"242245","messageId":"1400593832-6510-5-git-send-email-gitter.spiros@gmail.com","threadId":"36708","inReplyTo":"1400593832-6510-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 04/19] contrib/examples/git-merge.sh: convert test -a/-o to && and ||","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-05-20T13:50:17Z","receivedAt":"2014-05-20T13:50:17Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The interaction with unary operators and operator precedence\nfor && and || are better known than -a and -o, and for that\nreason we prefer them. Replace all existing instances\nof -a and -o to save readers from the burden of thinking\nabout such things.\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\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":"242260","messageId":"1400593832-6510-6-git-send-email-gitter.spiros@gmail.com","threadId":"36708","inReplyTo":"1400593832-6510-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 05/19] contrib/examples/git-repack.sh: convert test -a/-o to && and ||","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-05-20T13:50:18Z","receivedAt":"2014-05-20T13:50:18Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The interaction with unary operators and operator precedence\nfor && and || are better known than -a and -o, and for that\nreason we prefer them. Replace all existing instances\nof -a and -o to save readers from the burden of thinking\nabout such things.\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\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":"242246","messageId":"1400593832-6510-7-git-send-email-gitter.spiros@gmail.com","threadId":"36708","inReplyTo":"1400593832-6510-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 06/19] contrib/examples/git-resolve.sh: convert test -a/-o to && and ||","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-05-20T13:50:19Z","receivedAt":"2014-05-20T13:50:19Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The interaction with unary operators and operator precedence\nfor && and || are better known than -a and -o, and for that\nreason we prefer them. Replace all existing instances\nof -a and -o to save readers from the burden of thinking\nabout such things.\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\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":"242251","messageId":"1400593832-6510-8-git-send-email-gitter.spiros@gmail.com","threadId":"36708","inReplyTo":"1400593832-6510-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 07/19] git-bisect.sh: convert test -a/-o to && and ||","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-05-20T13:50:20Z","receivedAt":"2014-05-20T13:50:20Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The interaction with unary operators and operator precedence\nfor && and || are better known than -a and -o, and for that\nreason we prefer them. Replace all existing instances\nof -a and -o to save readers from the burden of thinking\nabout such things.\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\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":"242259","messageId":"1400593832-6510-9-git-send-email-gitter.spiros@gmail.com","threadId":"36708","inReplyTo":"1400593832-6510-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 08/19] git-mergetool.sh: convert test -a/-o to && and ||","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-05-20T13:50:21Z","receivedAt":"2014-05-20T13:50:21Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The interaction with unary operators and operator precedence\nfor && and || are better known than -a and -o, and for that\nreason we prefer them. Replace all existing instances\nof -a and -o to save readers from the burden of thinking\nabout such things.\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\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":"242249","messageId":"1400593832-6510-10-git-send-email-gitter.spiros@gmail.com","threadId":"36708","inReplyTo":"1400593832-6510-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 09/19] git-rebase--interactive.sh: convert test -a/-o to && and ||","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-05-20T13:50:22Z","receivedAt":"2014-05-20T13:50:22Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The interaction with unary operators and operator precedence\nfor && and || are better known than -a and -o, and for that\nreason we prefer them. Replace all existing instances\nof -a and -o to save readers from the burden of thinking\nabout such things.\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\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":"242247","messageId":"1400593832-6510-11-git-send-email-gitter.spiros@gmail.com","threadId":"36708","inReplyTo":"1400593832-6510-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 10/19] git-submodule.sh: convert test -a/-o to && and ||","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-05-20T13:50:23Z","receivedAt":"2014-05-20T13:50:23Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The interaction with unary operators and operator precedence\nfor && and || are better known than -a and -o, and for that\nreason we prefer them. Replace all existing instances\nof -a and -o to save readers from the burden of thinking\nabout such things.\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\n---\n git-submodule.sh |   29 +++++++++++++++++------------\n 1 file changed, 17 insertions(+), 12 deletions(-)\n\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex b55d83a..4b57b96 100755\n--- a/git-submodule.sh\n+++ b/git-submodule.sh\n@@ -396,7 +396,7 @@ cmd_add()\n \t\t\tsed -e 's|/$||' -e 's|:*/*\\.git$||' -e 's|.*[/:]||g')\n \tfi\n \n-\tif test -z \"$repo\" -o -z \"$sm_path\"; then\n+\tif test -z \"$repo\" || test -z \"$sm_path\"; then\n \t\tusage\n \tfi\n \n@@ -453,7 +453,7 @@ Use -f if you really want to add it.\" >&2\n \t# perhaps the path exists and is already a git repo, else clone it\n \tif test -e \"$sm_path\"\n \tthen\n-\t\tif test -d \"$sm_path\"/.git -o -f \"$sm_path\"/.git\n+\t\tif test -d \"$sm_path\"/.git || test -f \"$sm_path\"/.git\n \t\tthen\n \t\t\teval_gettextln \"Adding existing repo at '\\$sm_path' to the index\"\n \t\telse\n@@ -835,7 +835,7 @@ Maybe you want to use 'update --init'?\")\"\n \t\t\tcontinue\n \t\tfi\n \n-\t\tif ! test -d \"$sm_path\"/.git -o -f \"$sm_path\"/.git\n+\t\tif ! test -d \"$sm_path\"/.git || test -f \"$sm_path\"/.git\n \t\tthen\n \t\t\tmodule_clone \"$sm_path\" \"$name\" \"$url\" \"$reference\" \"$depth\" || exit\n \t\t\tcloned_modules=\"$cloned_modules;$name\"\n@@ -860,11 +860,11 @@ Maybe you want to use 'update --init'?\")\"\n \t\t\tdie \"$(eval_gettext \"Unable to find current ${remote_name}/${branch} revision in submodule path '\\$sm_path'\")\"\n \t\tfi\n \n-\t\tif test \"$subsha1\" != \"$sha1\" -o -n \"$force\"\n+\t\tif test \"$subsha1\" != \"$sha1\" || test -n \"$force\"\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@@ -1034,7 +1034,7 @@ cmd_summary() {\n \tthen\n \t\thead=$rev\n \t\ttest $# = 0 || shift\n-\telif test -z \"$1\" -o \"$1\" = \"HEAD\"\n+\telif test -z \"$1\" || test \"$1\" = \"HEAD\"\n \tthen\n \t\t# before the first commit: compare with an empty tree\n \t\thead=$(git hash-object -w -t tree --stdin </dev/null)\n@@ -1059,13 +1059,18 @@ 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+\t\t\t{\n+\t\t\ttest \"$status\" = D ||\n+\t\t\ttest \"$status\" = T\n+\t\t\t} &&\n+\t\t\techo \"$sm_path\"\n+\t\t\t&& 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 +1130,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 +1167,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 +1238,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 +1407,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":"242257","messageId":"1400593832-6510-12-git-send-email-gitter.spiros@gmail.com","threadId":"36708","inReplyTo":"1400593832-6510-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 11/19] t/t0025-crlf-auto.sh: convert test -a/-o to && and ||","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-05-20T13:50:24Z","receivedAt":"2014-05-20T13:50:24Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The interaction with unary operators and operator precedence\nfor && and || are better known than -a and -o, and for that\nreason we prefer them. Replace all existing instances\nof -a and -o to save readers from the burden of thinking\nabout such things.\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\n---\n t/t0025-crlf-auto.sh |    6 +++---\n 1 file changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/t/t0025-crlf-auto.sh b/t/t0025-crlf-auto.sh\nindex f5f67a6..a13fc56 100755\n--- a/t/t0025-crlf-auto.sh\n+++ b/t/t0025-crlf-auto.sh\n@@ -36,7 +36,7 @@ test_expect_success 'default settings cause no changes' '\n \tonediff=`git diff one` &&\n \ttwodiff=`git diff two` &&\n \tthreediff=`git diff three` &&\n-\ttest -z \"$onediff\" -a -z \"$twodiff\" -a -z \"$threediff\"\n+\ttest -z \"$onediff\" && test -z \"$twodiff\" && test -z \"$threediff\"\n '\n \n test_expect_success 'crlf=true causes a CRLF file to be normalized' '\n@@ -111,7 +111,7 @@ test_expect_success 'autocrlf=true does not normalize CRLF files' '\n \tonediff=`git diff one` &&\n \ttwodiff=`git diff two` &&\n \tthreediff=`git diff three` &&\n-\ttest -z \"$onediff\" -a -z \"$twodiff\" -a -z \"$threediff\"\n+\ttest -z \"$onediff\" && test -z \"$twodiff\" && test -z \"$threediff\"\n '\n \n test_expect_success 'text=auto, autocrlf=true _does_ normalize CRLF files' '\n@@ -126,7 +126,7 @@ test_expect_success 'text=auto, autocrlf=true _does_ normalize CRLF files' '\n \tonediff=`git diff one` &&\n \ttwodiff=`git diff two` &&\n \tthreediff=`git diff three` &&\n-\ttest -z \"$onediff\" -a -n \"$twodiff\" -a -z \"$threediff\"\n+\ttest -z \"$onediff\" && test -n \"$twodiff\" && test -z \"$threediff\"\n '\n \n test_expect_success 'text=auto, autocrlf=true does not normalize binary files' '\n-- \n1.7.10.4\n"},{"id":"242258","messageId":"1400593832-6510-13-git-send-email-gitter.spiros@gmail.com","threadId":"36708","inReplyTo":"1400593832-6510-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 12/19] t/t0026-eol-config.sh: convert test -a/-o to && and ||","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-05-20T13:50:25Z","receivedAt":"2014-05-20T13:50:25Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The interaction with unary operators and operator precedence\nfor && and || are better known than -a and -o, and for that\nreason we prefer them. Replace all existing instances\nof -a and -o to save readers from the burden of thinking\nabout such things.\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\n---\n t/t0026-eol-config.sh |    8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t0026-eol-config.sh b/t/t0026-eol-config.sh\nindex fe0164b..961ee32 100755\n--- a/t/t0026-eol-config.sh\n+++ b/t/t0026-eol-config.sh\n@@ -36,7 +36,7 @@ test_expect_success 'eol=lf puts LFs in normalized file' '\n \t! has_cr two &&\n \tonediff=`git diff one` &&\n \ttwodiff=`git diff two` &&\n-\ttest -z \"$onediff\" -a -z \"$twodiff\"\n+\ttest -z \"$onediff\" && test -z \"$twodiff\"\n '\n \n test_expect_success 'eol=crlf puts CRLFs in normalized file' '\n@@ -49,7 +49,7 @@ test_expect_success 'eol=crlf puts CRLFs in normalized file' '\n \t! has_cr two &&\n \tonediff=`git diff one` &&\n \ttwodiff=`git diff two` &&\n-\ttest -z \"$onediff\" -a -z \"$twodiff\"\n+\ttest -z \"$onediff\" && test -z \"$twodiff\"\n '\n \n test_expect_success 'autocrlf=true overrides eol=lf' '\n@@ -63,7 +63,7 @@ test_expect_success 'autocrlf=true overrides eol=lf' '\n \thas_cr two &&\n \tonediff=`git diff one` &&\n \ttwodiff=`git diff two` &&\n-\ttest -z \"$onediff\" -a -z \"$twodiff\"\n+\ttest -z \"$onediff\" && test -z \"$twodiff\"\n '\n \n test_expect_success 'autocrlf=true overrides unset eol' '\n@@ -77,7 +77,7 @@ test_expect_success 'autocrlf=true overrides unset eol' '\n \thas_cr two &&\n \tonediff=`git diff one` &&\n \ttwodiff=`git diff two` &&\n-\ttest -z \"$onediff\" -a -z \"$twodiff\"\n+\ttest -z \"$onediff\" && test -z \"$twodiff\"\n '\n \n test_done\n-- \n1.7.10.4\n"},{"id":"242256","messageId":"1400593832-6510-14-git-send-email-gitter.spiros@gmail.com","threadId":"36708","inReplyTo":"1400593832-6510-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 13/19] t/t4102-apply-rename.sh: convert test -a/-o to && and ||","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-05-20T13:50:26Z","receivedAt":"2014-05-20T13:50:26Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The interaction with unary operators and operator precedence\nfor && and || are better known than -a and -o, and for that\nreason we prefer them. Replace all existing instances\nof -a and -o to save readers from the burden of thinking\nabout such things.\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\n---\n t/t4102-apply-rename.sh |    2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t4102-apply-rename.sh b/t/t4102-apply-rename.sh\nindex 49e2d6c..fae3059 100755\n--- a/t/t4102-apply-rename.sh\n+++ b/t/t4102-apply-rename.sh\n@@ -52,6 +52,6 @@ EOF\n \n test_expect_success 'apply copy' \\\n     'git apply --index --stat --summary --apply test-patch &&\n-     test \"$(cat bar)\" = \"This is bar\" -a \"$(cat foo)\" = \"This is foo\"'\n+     test \"$(cat bar)\" = \"This is bar\" && test \"$(cat foo)\" = \"This is foo\"'\n \n test_done\n-- \n1.7.10.4\n"},{"id":"242250","messageId":"1400593832-6510-15-git-send-email-gitter.spiros@gmail.com","threadId":"36708","inReplyTo":"1400593832-6510-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 14/19] t/t5000-tar-tree.sh: convert test -a/-o to && and ||","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-05-20T13:50:27Z","receivedAt":"2014-05-20T13:50:27Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The interaction with unary operators and operator precedence\nfor && and || are better known than -a and -o, and for that\nreason we prefer them. Replace all existing instances\nof -a and -o to save readers from the burden of thinking\nabout such things.\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\n---\n t/t5000-tar-tree.sh |    2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\nindex 1cf0a4e..4b57cbd 100755\n--- a/t/t5000-tar-tree.sh\n+++ b/t/t5000-tar-tree.sh\n@@ -72,7 +72,7 @@ check_tar() {\n \t\t\tfor header in *.paxheader\n \t\t\tdo\n \t\t\t\tdata=${header%.paxheader}.data &&\n-\t\t\t\tif test -h $data -o -e $data\n+\t\t\t\tif test -h $data || test -e $data\n \t\t\t\tthen\n \t\t\t\t\tpath=$(get_pax_header $header path) &&\n \t\t\t\t\tif test -n \"$path\"\n-- \n1.7.10.4\n"},{"id":"242255","messageId":"1400593832-6510-16-git-send-email-gitter.spiros@gmail.com","threadId":"36708","inReplyTo":"1400593832-6510-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 15/19] t/t5403-post-checkout-hook.sh: convert test -a/-o to && and ||","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-05-20T13:50:28Z","receivedAt":"2014-05-20T13:50:28Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The interaction with unary operators and operator precedence\nfor && and || are better known than -a and -o, and for that\nreason we prefer them. Replace all existing instances\nof -a and -o to save readers from the burden of thinking\nabout such things.\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\n---\n t/t5403-post-checkout-hook.sh |    8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/t/t5403-post-checkout-hook.sh b/t/t5403-post-checkout-hook.sh\nindex 1753ef2..fc898c9 100755\n--- a/t/t5403-post-checkout-hook.sh\n+++ b/t/t5403-post-checkout-hook.sh\n@@ -39,7 +39,7 @@ test_expect_success 'post-checkout receives the right arguments with HEAD unchan\n \told=$(awk \"{print \\$1}\" clone1/.git/post-checkout.args) &&\n \tnew=$(awk \"{print \\$2}\" clone1/.git/post-checkout.args) &&\n \tflag=$(awk \"{print \\$3}\" clone1/.git/post-checkout.args) &&\n-\ttest $old = $new -a $flag = 1\n+\ttest $old = $new && test $flag = 1\n '\n \n test_expect_success 'post-checkout runs as expected ' '\n@@ -52,7 +52,7 @@ test_expect_success 'post-checkout args are correct with git checkout -b ' '\n \told=$(awk \"{print \\$1}\" clone1/.git/post-checkout.args) &&\n \tnew=$(awk \"{print \\$2}\" clone1/.git/post-checkout.args) &&\n \tflag=$(awk \"{print \\$3}\" clone1/.git/post-checkout.args) &&\n-\ttest $old = $new -a $flag = 1\n+\ttest $old = $new && test $flag = 1\n '\n \n test_expect_success 'post-checkout receives the right args with HEAD changed ' '\n@@ -60,7 +60,7 @@ test_expect_success 'post-checkout receives the right args with HEAD changed ' '\n \told=$(awk \"{print \\$1}\" clone2/.git/post-checkout.args) &&\n \tnew=$(awk \"{print \\$2}\" clone2/.git/post-checkout.args) &&\n \tflag=$(awk \"{print \\$3}\" clone2/.git/post-checkout.args) &&\n-\ttest $old != $new -a $flag = 1\n+\ttest $old != $new && test $flag = 1\n '\n \n test_expect_success 'post-checkout receives the right args when not switching branches ' '\n@@ -68,7 +68,7 @@ test_expect_success 'post-checkout receives the right args when not switching br\n \told=$(awk \"{print \\$1}\" clone2/.git/post-checkout.args) &&\n \tnew=$(awk \"{print \\$2}\" clone2/.git/post-checkout.args) &&\n \tflag=$(awk \"{print \\$3}\" clone2/.git/post-checkout.args) &&\n-\ttest $old = $new -a $flag = 0\n+\ttest $old = $new && test $flag = 0\n '\n \n if test \"$(git config --bool core.filemode)\" = true; then\n-- \n1.7.10.4\n"},{"id":"242248","messageId":"1400593832-6510-17-git-send-email-gitter.spiros@gmail.com","threadId":"36708","inReplyTo":"1400593832-6510-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 16/19] t/t5537-fetch-shallow.sh: convert test -a/-o to && and ||","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-05-20T13:50:29Z","receivedAt":"2014-05-20T13:50:29Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The interaction with unary operators and operator precedence\nfor && and || are better known than -a and -o, and for that\nreason we prefer them. Replace all existing instances\nof -a and -o to save readers from the burden of thinking\nabout such things.\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\n---\n t/t5537-fetch-shallow.sh |    2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t5537-fetch-shallow.sh b/t/t5537-fetch-shallow.sh\nindex be951a4..2c75730 100755\n--- a/t/t5537-fetch-shallow.sh\n+++ b/t/t5537-fetch-shallow.sh\n@@ -173,7 +173,7 @@ EOF\n \t)\n '\n \n-if test -n \"$NO_CURL\" -o -z \"$GIT_TEST_HTTPD\"; then\n+if test -n \"$NO_CURL\" || test -z \"$GIT_TEST_HTTPD\"; then\n \tsay 'skipping remaining tests, git built without http support'\n \ttest_done\n fi\n-- \n1.7.10.4\n"},{"id":"242254","messageId":"1400593832-6510-18-git-send-email-gitter.spiros@gmail.com","threadId":"36708","inReplyTo":"1400593832-6510-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 17/19] t/t5538-push-shallow.sh: convert test -a/-o to && and ||","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-05-20T13:50:30Z","receivedAt":"2014-05-20T13:50:30Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The interaction with unary operators and operator precedence\nfor && and || are better known than -a and -o, and for that\nreason we prefer them. Replace all existing instances\nof -a and -o to save readers from the burden of thinking\nabout such things.\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\n---\n t/t5538-push-shallow.sh |    2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/t5538-push-shallow.sh b/t/t5538-push-shallow.sh\nindex 8e54ac5..63d9ca9 100755\n--- a/t/t5538-push-shallow.sh\n+++ b/t/t5538-push-shallow.sh\n@@ -121,7 +121,7 @@ EOF\n \t)\n '\n \n-if test -n \"$NO_CURL\" -o -z \"$GIT_TEST_HTTPD\"; then\n+if test -n \"$NO_CURL\" || test -z \"$GIT_TEST_HTTPD\"; then\n \tsay 'skipping remaining tests, git built without http support'\n \ttest_done\n fi\n-- \n1.7.10.4\n"},{"id":"242253","messageId":"1400593832-6510-19-git-send-email-gitter.spiros@gmail.com","threadId":"36708","inReplyTo":"1400593832-6510-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 18/19] t/t9814-git-p4-rename.sh: convert test -a/-o to && and ||","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-05-20T13:50:31Z","receivedAt":"2014-05-20T13:50:31Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The interaction with unary operators and operator precedence\nfor && and || are better known than -a and -o, and for that\nreason we prefer them. Replace all existing instances\nof -a and -o to save readers from the burden of thinking\nabout such things.\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\n---\n t/t9814-git-p4-rename.sh |    4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/t9814-git-p4-rename.sh b/t/t9814-git-p4-rename.sh\nindex be802e0..1fc1f5f 100755\n--- a/t/t9814-git-p4-rename.sh\n+++ b/t/t9814-git-p4-rename.sh\n@@ -177,7 +177,7 @@ test_expect_success 'detect copies' '\n \t\tlevel=$(git diff-tree -r -C --find-copies-harder HEAD | sed 1d | cut -f1 | cut -d\" \" -f5 | sed \"s/C0*//\") &&\n \t\ttest -n \"$level\" && test \"$level\" -gt 0 && test \"$level\" -lt 98 &&\n \t\tsrc=$(git diff-tree -r -C --find-copies-harder HEAD | sed 1d | cut -f2) &&\n-\t\ttest \"$src\" = file10 -o \"$src\" = file11 &&\n+\t\ttest \"$src\" = file10 || test \"$src\" = file11 &&\n \t\tgit config git-p4.detectCopies $(($level + 2)) &&\n \t\tgit p4 submit &&\n \t\tp4 filelog //depot/file12 &&\n@@ -191,7 +191,7 @@ test_expect_success 'detect copies' '\n \t\tlevel=$(git diff-tree -r -C --find-copies-harder HEAD | sed 1d | cut -f1 | cut -d\" \" -f5 | sed \"s/C0*//\") &&\n \t\ttest -n \"$level\" && test \"$level\" -gt 2 && test \"$level\" -lt 100 &&\n \t\tsrc=$(git diff-tree -r -C --find-copies-harder HEAD | sed 1d | cut -f2) &&\n-\t\ttest \"$src\" = file10 -o \"$src\" = file11 -o \"$src\" = file12 &&\n+\t\ttest \"$src\" = file10 || test \"$src\" = file11 || test \"$src\" = file12 &&\n \t\tgit config git-p4.detectCopies $(($level - 2)) &&\n \t\tgit p4 submit &&\n \t\tp4 filelog //depot/file13 &&\n-- \n1.7.10.4\n"},{"id":"242252","messageId":"1400593832-6510-20-git-send-email-gitter.spiros@gmail.com","threadId":"36708","inReplyTo":"1400593832-6510-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 19/19] t/test-lib-functions.sh: convert test -a/-o to && and ||","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-05-20T13:50:32Z","receivedAt":"2014-05-20T13:50:32Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The interaction with unary operators and operator precedence\nfor && and || are better known than -a and -o, and for that\nreason we prefer them. Replace all existing instances\nof -a and -o to save readers from the burden of thinking\nabout such things.\n\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\n---\n t/test-lib-functions.sh |    4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/t/test-lib-functions.sh b/t/test-lib-functions.sh\nindex 158e10a..0681003 100644\n--- a/t/test-lib-functions.sh\n+++ b/t/test-lib-functions.sh\n@@ -542,7 +542,7 @@ test_must_fail () {\n \tif test $exit_code = 0; then\n \t\techo >&2 \"test_must_fail: command succeeded: $*\"\n \t\treturn 1\n-\telif test $exit_code -gt 129 -a $exit_code -le 192; then\n+\telif test $exit_code -gt 129 && test $exit_code -le 192; then\n \t\techo >&2 \"test_must_fail: died by signal: $*\"\n \t\treturn 1\n \telif test $exit_code = 127; then\n@@ -569,7 +569,7 @@ test_must_fail () {\n test_might_fail () {\n \t\"$@\"\n \texit_code=$?\n-\tif test $exit_code -gt 129 -a $exit_code -le 192; then\n+\tif test $exit_code -gt 129 && test $exit_code -le 192; then\n \t\techo >&2 \"test_might_fail: died by signal: $*\"\n \t\treturn 1\n \telif test $exit_code = 127; then\n-- \n1.7.10.4\n"},{"id":"242263","messageId":"vpqegzo4k7g.fsf@anie.imag.fr","threadId":"36708","inReplyTo":"1400593832-6510-11-git-send-email-gitter.spiros@gmail.com","subject":"Re: [PATCH 10/19] git-submodule.sh: convert test -a/-o to && and ||","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2014-05-20T14:07:47Z","receivedAt":"2014-05-20T14:07:47Z","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> -\t\t\ttest $status = D -o $status = T && echo \"$sm_path\" && continue\n> +\t\t\t{\n> +\t\t\ttest \"$status\" = D ||\n> +\t\t\ttest \"$status\" = T\n> +\t\t\t} &&\n> +\t\t\techo \"$sm_path\"\n> +\t\t\t&& continue\n\nWe usually write the && at the end of the line, hence that would be\n\necho \"$sm_path\" &&\ncontinue\n\n(shouldn't block the patch, but you may change if you need to resend)\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"242264","messageId":"vpq8upw4k4g.fsf@anie.imag.fr","threadId":"36708","inReplyTo":"1400593832-6510-1-git-send-email-gitter.spiros@gmail.com","subject":"Re: [PATCH 00/19] convert test -a/-o to && and || patch series","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2014-05-20T14:09:35Z","receivedAt":"2014-05-20T14:09:35Z","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> Elia Pinto (19):\n\nI went through the series (not very thoroughly) and it sounds good to\nme.\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"242267","messageId":"537B6936.2080101@viscovery.net","threadId":"36708","inReplyTo":"1400593832-6510-11-git-send-email-gitter.spiros@gmail.com","subject":"Re: [PATCH 10/19] git-submodule.sh: convert test -a/-o to && and ||","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2014-05-20T14:39:50Z","receivedAt":"2014-05-20T14:39:50Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 5/20/2014 15:50, schrieb Elia Pinto:\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\nShould not be ||, but &&!\n\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> +\t\t\t{\n> +\t\t\ttest \"$status\" = D ||\n> +\t\t\ttest \"$status\" = T\n> +\t\t\t} &&\n> +\t\t\techo \"$sm_path\"\n> +\t\t\t&& continue\n\nAs Matthieu noted, this is incorrect. It's not just a style violation,\nit's a syntax error. Why did your test runs not hickup on that?\n\nIn this case you could even leave the original code structure without\nchanging the meaning:\n\n\t\t\ttest $status = D || test $status = T && echo \"$sm_path\" && continue\n\nBut a better idiom is\n\t\t\tcase \"$status\" in\n\t\t\t[DT])\n\t\t\t\tprintf '%s\\n' \"$sm_path\" &&\n\t\t\t\tcontinue\n\t\t\tesac\n\n> @@ -1233,7 +1238,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\nWrong grouping. This could be more correct (I didn't test):\n\n\t\tif test -z \"$url\" ||\n\t\t\t{\n\t\t\t\t! test -d \"$sm_path\"/.git &&\n\t\t\t\t! test -f \"$sm_path\"/.git\n\t\t\t}\n\n-- Hannes\n"},{"id":"242293","messageId":"xmqqy4xwz629.fsf@gitster.dls.corp.google.com","threadId":"36708","inReplyTo":"1400593832-6510-1-git-send-email-gitter.spiros@gmail.com","subject":"Re: [PATCH 00/19] convert test -a/-o to && and || patch series","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-05-20T17:57:34Z","receivedAt":"2014-05-20T17:57:34Z","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> These patch series  convert test -a/-o to && and ||.\n>\n> This is the second version.\n\nPerhaps slightly off-topic, but has the remainder of the previous $(...)\nseries been perfected and ready to apply?\n"},{"id":"242294","messageId":"xmqqsio4z5e5.fsf@gitster.dls.corp.google.com","threadId":"36708","inReplyTo":"1400593832-6510-2-git-send-email-gitter.spiros@gmail.com","subject":"Re: [PATCH 01/19] check_bindir: convert test -a/-o to && and ||","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-05-20T18:12:02Z","receivedAt":"2014-05-20T18:12:02Z","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> The interaction with unary operators and operator precedence\n> for && and || are better known than -a and -o, and for that\n> reason we prefer them. Replace all existing instances\n> of -a and -o to save readers from the burden of thinking\n> about such things.\n>\n> Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>\n> ---\n\nThanks.\n\nAs I already said, I think \"better known\" is much less of an issue\nthan that \"-a/-o\" is \"more error prone\", and that is the reason why\nwe may want to do this rewrite.\n\nI do not know offhand how busy the tree would be when we can apply\nthese patches post-release without them getting rebased, but the\nzero-th step before this series may want to be a patch like this.\n\n Documentation/CodingGuidelines | 13 +++++++++++++\n 1 file changed, 13 insertions(+)\n\ndiff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines\nindex ef67b53..7864c5b 100644\n--- a/Documentation/CodingGuidelines\n+++ b/Documentation/CodingGuidelines\n@@ -106,6 +106,19 @@ For shell scripts specifically (not exhaustive):\n    interface translatable. See \"Marking strings for translation\" in\n    po/README.\n \n+ - We do not write our \"test\" command with \"-a\" and \"-o\" and use \"&&\"\n+   or \"||\" to concatenate multiple \"test\" commands instead, because\n+   the use of \"-a/-o\" is often error-prone.  E.g.\n+\n+     test -n \"$x\" -a \"$a\" = \"$b\"\n+\n+   is buggy and breaks when $x is \"=\", but\n+\n+     test -n \"$x\" && test \"$a\" = \"$b\"\n+\n+   does not have such a problem.\n+\n+\n For C programs:\n \n  - We use tabs to indent, and interpret tabs as taking up to\n"},{"id":"242298","messageId":"20140520182236.GQ12314@google.com","threadId":"36708","inReplyTo":"1400593832-6510-1-git-send-email-gitter.spiros@gmail.com","subject":"Re: [PATCH 00/19] convert test -a/-o to && and || patch series","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2014-05-20T18:22:36Z","receivedAt":"2014-05-20T18:22:36Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\nElia Pinto wrote:\n\n> These patch series  convert test -a/-o to && and ||.\n\nShould this come with a new check in t/check-non-portable-shell.pl so\nwe don't regress in the future?\n\n> Elia Pinto (19):\n[...]\n>  check_bindir                    |    2 +-\n>  contrib/examples/git-clone.sh   |    2 +-\n>  contrib/examples/git-commit.sh  |    4 ++--\n>  contrib/examples/git-merge.sh   |    4 ++--\n>  contrib/examples/git-repack.sh  |    4 ++--\n>  contrib/examples/git-resolve.sh |    2 +-\n>  git-bisect.sh                   |    2 +-\n>  git-mergetool.sh                |    4 ++--\n>  git-rebase--interactive.sh      |    2 +-\n>  git-submodule.sh                |   29 +++++++++++++++++------------\n>  t/t0025-crlf-auto.sh            |    6 +++---\n>  t/t0026-eol-config.sh           |    8 ++++----\n>  t/t4102-apply-rename.sh         |    2 +-\n>  t/t5000-tar-tree.sh             |    2 +-\n>  t/t5403-post-checkout-hook.sh   |    8 ++++----\n>  t/t5537-fetch-shallow.sh        |    2 +-\n>  t/t5538-push-shallow.sh         |    2 +-\n>  t/t9814-git-p4-rename.sh        |    4 ++--\n>  t/test-lib-functions.sh         |    4 ++--\n>  19 files changed, 49 insertions(+), 44 deletions(-)\n\nI still think one patch per file is too many patches for this.  It would\nbe easier to read with, e.g., whichever ones were most complex as\nseparate patches and the rest (the \"easy\" ones) as a single patch.\n\nThanks,\nJonathan\n"},{"id":"242308","messageId":"xmqq38g4z3fd.fsf@gitster.dls.corp.google.com","threadId":"36708","inReplyTo":"xmqqsio4z5e5.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH 01/19] check_bindir: convert test -a/-o to && and ||","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-05-20T18:54:30Z","receivedAt":"2014-05-20T18:54:30Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> As I already said, I think \"better known\" is much less of an issue\n> than that \"-a/-o\" is \"more error prone\", and that is the reason why\n> we may want to do this rewrite.\n>\n> I do not know offhand how busy the tree would be when we can apply\n> these patches post-release without them getting rebased, but the\n> zero-th step before this series may want to be a patch like this.\n\n... and this time with a proposed log message.\n\n-- >8 --\nSubject: [PATCH] CodingGuidelines: avoid \"test <cond> -a/-o <cond>\"\n\nThe construct is error-prone; \"test\" being built-in in most modern\nshells, the reason to avoid \"test <cond> && test <cond>\" spawning\none extra process by using a single \"test <cond> -a <cond>\" no\nlonger exists.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n Documentation/CodingGuidelines | 13 +++++++++++++\n 1 file changed, 13 insertions(+)\n\ndiff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines\nindex 3d08671..4d90c77 100644\n--- a/Documentation/CodingGuidelines\n+++ b/Documentation/CodingGuidelines\n@@ -151,6 +151,19 @@ For shell scripts specifically (not exhaustive):\n    interface translatable. See \"Marking strings for translation\" in\n    po/README.\n \n+ - We do not write our \"test\" command with \"-a\" and \"-o\" and use \"&&\"\n+   or \"||\" to concatenate multiple \"test\" commands instead, because\n+   the use of \"-a/-o\" is often error-prone.  E.g.\n+\n+     test -n \"$x\" -a \"$a\" = \"$b\"\n+\n+   is buggy and breaks when $x is \"=\", but\n+\n+     test -n \"$x\" && test \"$a\" = \"$b\"\n+\n+   does not have such a problem.\n+\n+\n For C programs:\n \n  - We use tabs to indent, and interpret tabs as taking up to\n-- \n2.0.0-rc3-438-g36dae77\n"}]}