{"thread":{"id":"36857","subject":"[PATCH 01/20] check_bindir: avoid \"test <cond> -a/-o <cond>\"","startedAt":"2014-06-06T14:55:43Z","lastAt":"2014-06-10T21:47:49Z","messageCount":35,"participants":["Elia Pinto","Torsten Bögershausen","Matthieu Moy","Junio C Hamano","Johannes Sixt","David Aguilar","René Scharfe"],"isPatch":true,"patchVersion":1,"patchTotal":20},"messages":[{"id":"243492","messageId":"1402066563-28519-1-git-send-email-gitter.spiros@gmail.com","threadId":"36857","inReplyTo":null,"subject":"[PATCH 00/20] avoid \"test <cond> -a/-o <cond>\"","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-06-06T14:55:43Z","receivedAt":"2014-06-06T14:55:43Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"These patch series  convert test -a/-o to && and ||.\n\nThis is the the third version.\n\nChanges:\n\n- Change the commit message for consistency with the comment to the patch to the CodingGuideline (Junio proposed patch\n http://www.spinics.net/lists/git/msg232199.html) expressing even better the meaning \n of the patches ( in particular, the phrase \"Better known\" vs. \"error prone\").\n The previous comment was \"convert test -a/-o to && and ||\"\n\n\n- Therefore also includes the Julio patch to the CodingGuideline\n\n\nI have done the rebase with \"master\" and the patches also apply to \"next\".\n\nI hope I have done the right thing in  resending the patch series.\nI am Sorry if not.\n\n\nElia Pinto (20):\n  check_bindir: avoid \"test <cond> -a/-o <cond>\"\n  contrib/examples/git-clone.sh: avoid \"test <cond> -a/-o <cond>\"\n  contrib/examples/git-commit.sh: avoid \"test <cond> -a/-o <cond>\"\n  contrib/examples/git-merge.sh: avoid \"test <cond> -a/-o <cond>\"\n  contrib/examples/git-repack.sh: avoid \"test <cond> -a/-o <cond>\"\n  contrib/examples/git-resolve.sh: avoid \"test <cond> -a/-o <cond>\"\n  git-bisect.sh: avoid \"test <cond> -a/-o <cond>\"\n  git-mergetool.sh: avoid \"test <cond> -a/-o <cond>\"\n  git-rebase--interactive.sh: avoid \"test <cond> -a/-o <cond>\"\n  git-submodule.sh: avoid \"test <cond> -a/-o <cond>\"\n  t/lib-httpd.sh: avoid \"test <cond> -a/-o <cond>\"\n  t/t0025-crlf-auto.sh: avoid \"test <cond> -a/-o <cond>\"\n  t/t0026-eol-config.sh: avoid \"test <cond> -a/-o <cond>\"\n  t/t4102-apply-rename.sh: avoid \"test <cond> -a/-o <cond>\"\n  t/t5000-tar-tree.sh: avoid \"test <cond> -a/-o <cond>\"\n  t/t5403-post-checkout-hook.sh: avoid \"test <cond> -a/-o <cond>\"\n  t/t5538-push-shallow.sh: avoid \"test <cond> -a/-o <cond>\"\n  t/t9814-git-p4-rename.sh: avoid \"test <cond> -a/-o <cond>\"\n  t/test-lib-functions.sh: avoid \"test <cond> -a/-o <cond>\"\n  CodingGuidelines: avoid \"test <cond> -a/-o <cond>\"\n\n Documentation/CodingGuidelines  |   12 ++++++++++++\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                |   32 ++++++++++++++++++++------------\n t/lib-httpd.sh                  |    2 +-\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/t5538-push-shallow.sh         |    2 +-\n t/t9814-git-p4-rename.sh        |    4 ++--\n t/test-lib-functions.sh         |    4 ++--\n 20 files changed, 64 insertions(+), 44 deletions(-)\n\n-- \n1.7.10.4\n"},{"id":"243474","messageId":"1402066563-28519-2-git-send-email-gitter.spiros@gmail.com","threadId":"36857","inReplyTo":"1402066563-28519-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 01/20] check_bindir: avoid \"test <cond> -a/-o <cond>\"","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-06-06T14:55:44Z","receivedAt":"2014-06-06T14:55:44Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The 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: 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":"243476","messageId":"1402066563-28519-3-git-send-email-gitter.spiros@gmail.com","threadId":"36857","inReplyTo":"1402066563-28519-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 02/20] contrib/examples/git-clone.sh: avoid \"test <cond> -a/-o <cond>\"","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-06-06T14:55:45Z","receivedAt":"2014-06-06T14:55:45Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The 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: 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":"243494","messageId":"1402066563-28519-4-git-send-email-gitter.spiros@gmail.com","threadId":"36857","inReplyTo":"1402066563-28519-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 03/20] contrib/examples/git-commit.sh: avoid \"test <cond> -a/-o <cond>\"","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-06-06T14:55:46Z","receivedAt":"2014-06-06T14:55:46Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The 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: 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":"243477","messageId":"1402066563-28519-5-git-send-email-gitter.spiros@gmail.com","threadId":"36857","inReplyTo":"1402066563-28519-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 04/20] contrib/examples/git-merge.sh: avoid \"test <cond> -a/-o <cond>\"","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-06-06T14:55:47Z","receivedAt":"2014-06-06T14:55:47Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The 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: 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":"243491","messageId":"1402066563-28519-6-git-send-email-gitter.spiros@gmail.com","threadId":"36857","inReplyTo":"1402066563-28519-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 05/20] contrib/examples/git-repack.sh: avoid \"test <cond> -a/-o <cond>\"","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-06-06T14:55:48Z","receivedAt":"2014-06-06T14:55:48Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The 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: 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":"243475","messageId":"1402066563-28519-7-git-send-email-gitter.spiros@gmail.com","threadId":"36857","inReplyTo":"1402066563-28519-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 06/20] contrib/examples/git-resolve.sh: avoid \"test <cond> -a/-o <cond>\"","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-06-06T14:55:49Z","receivedAt":"2014-06-06T14:55:49Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The 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: 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":"243490","messageId":"1402066563-28519-8-git-send-email-gitter.spiros@gmail.com","threadId":"36857","inReplyTo":"1402066563-28519-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 07/20] git-bisect.sh: avoid \"test <cond> -a/-o <cond>\"","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-06-06T14:55:50Z","receivedAt":"2014-06-06T14:55:50Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The 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: 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":"243488","messageId":"1402066563-28519-9-git-send-email-gitter.spiros@gmail.com","threadId":"36857","inReplyTo":"1402066563-28519-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 08/20] git-mergetool.sh: avoid \"test <cond> -a/-o <cond>\"","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-06-06T14:55:51Z","receivedAt":"2014-06-06T14:55:51Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The 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: 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 d08dc92..9a046b7 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":"243493","messageId":"1402066563-28519-10-git-send-email-gitter.spiros@gmail.com","threadId":"36857","inReplyTo":"1402066563-28519-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 09/20] git-rebase--interactive.sh: avoid \"test <cond> -a/-o <cond>\"","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-06-06T14:55:52Z","receivedAt":"2014-06-06T14:55:52Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The 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: 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":"243489","messageId":"1402066563-28519-11-git-send-email-gitter.spiros@gmail.com","threadId":"36857","inReplyTo":"1402066563-28519-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 10/20] git-submodule.sh: avoid \"test <cond> -a/-o <cond>\"","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-06-06T14:55:53Z","receivedAt":"2014-06-06T14:55:53Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The 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: Elia Pinto <gitter.spiros@gmail.com>\n---\n git-submodule.sh |   32 ++++++++++++++++++++------------\n 1 file changed, 20 insertions(+), 12 deletions(-)\n\ndiff --git a/git-submodule.sh b/git-submodule.sh\nindex b55d83a..1e3a5a6 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,17 @@ 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\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 \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 +1129,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 +1166,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 +1237,11 @@ 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\" ||\n+\t\t{\n+\t\t\t! test -d \"$sm_path\"/.git &&\n+\t\t\t! test -f \"$sm_path\"/.git\n+\t\t}\n \t\tthen\n \t\t\tsay \"-$sha1 $displaypath\"\n \t\t\tcontinue;\n@@ -1402,7 +1410,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":"243478","messageId":"1402066563-28519-12-git-send-email-gitter.spiros@gmail.com","threadId":"36857","inReplyTo":"1402066563-28519-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 11/20] t/lib-httpd.sh: avoid \"test <cond> -a/-o <cond>\"","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-06-06T14:55:54Z","receivedAt":"2014-06-06T14:55:54Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The 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: Elia Pinto <gitter.spiros@gmail.com>\n---\n t/lib-httpd.sh |    2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/t/lib-httpd.sh b/t/lib-httpd.sh\nindex 252cbf1..38a47fe 100644\n--- a/t/lib-httpd.sh\n+++ b/t/lib-httpd.sh\n@@ -132,7 +132,7 @@ prepare_httpd() {\n \tHTTPD_URL_USER=$HTTPD_PROTO://user%40host@$HTTPD_DEST\n \tHTTPD_URL_USER_PASS=$HTTPD_PROTO://user%40host:pass%40host@$HTTPD_DEST\n \n-\tif test -n \"$LIB_HTTPD_DAV\" -o -n \"$LIB_HTTPD_SVN\"\n+\tif test -n \"$LIB_HTTPD_DAV\" || test -n \"$LIB_HTTPD_SVN\"\n \tthen\n \t\tHTTPD_PARA=\"$HTTPD_PARA -DDAV\"\n \n-- \n1.7.10.4\n"},{"id":"243479","messageId":"1402066563-28519-13-git-send-email-gitter.spiros@gmail.com","threadId":"36857","inReplyTo":"1402066563-28519-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 12/20] t/t0025-crlf-auto.sh: avoid \"test <cond> -a/-o <cond>\"","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-06-06T14:55:55Z","receivedAt":"2014-06-06T14:55:55Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The 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: 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 b0e5694..28102de 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":"243487","messageId":"1402066563-28519-14-git-send-email-gitter.spiros@gmail.com","threadId":"36857","inReplyTo":"1402066563-28519-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 13/20] t/t0026-eol-config.sh: avoid \"test <cond> -a/-o <cond>\"","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-06-06T14:55:56Z","receivedAt":"2014-06-06T14:55:56Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The 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: 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 e1126aa..4807b0f 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":"243486","messageId":"1402066563-28519-15-git-send-email-gitter.spiros@gmail.com","threadId":"36857","inReplyTo":"1402066563-28519-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 14/20] t/t4102-apply-rename.sh: avoid \"test <cond> -a/-o <cond>\"","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-06-06T14:55:57Z","receivedAt":"2014-06-06T14:55:57Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The 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: 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":"243481","messageId":"1402066563-28519-16-git-send-email-gitter.spiros@gmail.com","threadId":"36857","inReplyTo":"1402066563-28519-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 15/20] t/t5000-tar-tree.sh: avoid \"test <cond> -a/-o <cond>\"","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-06-06T14:55:58Z","receivedAt":"2014-06-06T14:55:58Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The 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: 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 74fc5a8..ad6fa0d 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":"243483","messageId":"1402066563-28519-17-git-send-email-gitter.spiros@gmail.com","threadId":"36857","inReplyTo":"1402066563-28519-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 16/20] t/t5403-post-checkout-hook.sh: avoid \"test <cond> -a/-o <cond>\"","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-06-06T14:55:59Z","receivedAt":"2014-06-06T14:55:59Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The 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: 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":"243485","messageId":"1402066563-28519-18-git-send-email-gitter.spiros@gmail.com","threadId":"36857","inReplyTo":"1402066563-28519-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 17/20] t/t5538-push-shallow.sh: avoid \"test <cond> -a/-o <cond>\"","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-06-06T14:56:00Z","receivedAt":"2014-06-06T14:56:00Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The 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: 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":"243480","messageId":"1402066563-28519-19-git-send-email-gitter.spiros@gmail.com","threadId":"36857","inReplyTo":"1402066563-28519-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 18/20] t/t9814-git-p4-rename.sh: avoid \"test <cond> -a/-o <cond>\"","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-06-06T14:56:01Z","receivedAt":"2014-06-06T14:56:01Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The 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: 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":"243484","messageId":"1402066563-28519-20-git-send-email-gitter.spiros@gmail.com","threadId":"36857","inReplyTo":"1402066563-28519-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 19/20] t/test-lib-functions.sh: avoid \"test <cond> -a/-o <cond>\"","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-06-06T14:56:02Z","receivedAt":"2014-06-06T14:56:02Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The 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: 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":"243482","messageId":"1402066563-28519-21-git-send-email-gitter.spiros@gmail.com","threadId":"36857","inReplyTo":"1402066563-28519-1-git-send-email-gitter.spiros@gmail.com","subject":"[PATCH 20/20] CodingGuidelines: avoid \"test <cond> -a/-o <cond>\"","fromName":"Elia Pinto","fromEmail":"gitter.spiros@gmail.com","sentAt":"2014-06-06T14:56:03Z","receivedAt":"2014-06-06T14:56:03Z","isPatch":true,"sender":{"key":"gitter.spiros@gmail.com","avatar":"https://avatars.githubusercontent.com/u/158490?v=4"},"body":"The 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>\nSigned-off-by: Elia Pinto <gitter.spiros@gmail.com>\n---\n Documentation/CodingGuidelines |   12 ++++++++++++\n 1 file changed, 12 insertions(+)\n\ndiff --git a/Documentation/CodingGuidelines b/Documentation/CodingGuidelines\nindex f424dbd..2d426bc 100644\n--- a/Documentation/CodingGuidelines\n+++ b/Documentation/CodingGuidelines\n@@ -106,6 +106,18 @@ 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 For C programs:\n \n  - We use tabs to indent, and interpret tabs as taking up to\n-- \n1.7.10.4\n"},{"id":"243511","messageId":"539210A8.5040003@web.de","threadId":"36857","inReplyTo":"1402066563-28519-21-git-send-email-gitter.spiros@gmail.com","subject":"Re: [PATCH 20/20] CodingGuidelines: avoid \"test <cond> -a/-o <cond>\"","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2014-06-06T19:04:08Z","receivedAt":"2014-06-06T19:04:08Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 2014-06-06 16.56, Elia Pinto wrote:\n> + - We do not write our \"test\" command with \"-a\" and \"-o\" and use \"&&\"\nThat \"and\" \"and\" \"and\" could be somewhat confusing.\nHow about:\n\nWe do not write our \"test\" command with \"-a\" and/or \"-o\".\nInstead we use \"&&\" or \"||\" to concatenate multiple \"test\" commands instead,\nbecause the use of \"-a/-o\" is often error-prone.  E.g.\n(The rest looks OK)\n"},{"id":"243623","messageId":"vpq1tuyw6nt.fsf@anie.imag.fr","threadId":"36857","inReplyTo":"1402066563-28519-1-git-send-email-gitter.spiros@gmail.com","subject":"Re: [PATCH 00/20] avoid \"test <cond> -a/-o <cond>\"","fromName":"Matthieu Moy","fromEmail":"matthieu.moy@grenoble-inp.fr","sentAt":"2014-06-09T13:31:50Z","receivedAt":"2014-06-09T13:31:50Z","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> These patch series  convert test -a/-o to && and ||.\n\nReviewed-by: Matthieu Moy <Matthieu.Moy@imag.fr>\n\n-- \nMatthieu Moy\nhttp://www-verimag.imag.fr/~moy/\n"},{"id":"243684","messageId":"xmqqoay1d5vi.fsf@gitster.dls.corp.google.com","threadId":"36857","inReplyTo":"1402066563-28519-11-git-send-email-gitter.spiros@gmail.com","subject":"Re: [PATCH 10/20] git-submodule.sh: avoid \"test <cond> -a/-o <cond>\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-06-09T23:23:45Z","receivedAt":"2014-06-09T23:23:45Z","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> @@ -1059,13 +1059,17 @@ 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\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\nI think this conversion is wrong and causes parse error.  The\nsurrounding code cannot be seen in the context of thsi patch, but\nlooks somewhat like this:\n\n\tmodules=$( ....\n                   case \"$status\" in\n                   [DT])\n                           ...\n                   esac\n                   .... )\n\nPerhaps you would need to spell it with the extra opening\nparenthesis, like so:\n\n\tcase string in\n        ([DT])\n        \t...\n\tesac\n\nor something.\n"},{"id":"243685","messageId":"xmqqha3td5v5.fsf@gitster.dls.corp.google.com","threadId":"36857","inReplyTo":"1402066563-28519-3-git-send-email-gitter.spiros@gmail.com","subject":"Re: [PATCH 02/20] contrib/examples/git-clone.sh: avoid \"test <cond> -a/-o <cond>\"","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-06-09T23:23:58Z","receivedAt":"2014-06-09T23:23:58Z","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 construct is error-prone; \"test\" being built-in in most modern\n> shells, the reason to avoid \"test <cond> && test <cond>\" spawning\n> one extra process by using a single \"test <cond> -a <cond>\" no\n> longer exists.\n>\n> Signed-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>\n> diff --git a/contrib/examples/git-clone.sh b/contrib/examples/git-clone.sh\n> index 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\nHmph.  If we want to see them both empty, \n\n\ttest \"$quiet,$no_progress\" = ,\n\nwould have been a better way to spell this, but that is outside the\nscope of this series.\n\nBut I wonder if we really want to update the contrib/examples/,\nwhich is a record of how historically we have implemented various\nscripted Porcelains using lower level plumbing commands.\n"},{"id":"243709","messageId":"5396AB10.8020603@viscovery.net","threadId":"36857","inReplyTo":"xmqqoay1d5vi.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH 10/20] git-submodule.sh: avoid \"test <cond> -a/-o <cond>\"","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2014-06-10T06:52:00Z","receivedAt":"2014-06-10T06:52:00Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 6/10/2014 1:23, schrieb Junio C Hamano:\n> Elia Pinto <gitter.spiros@gmail.com> writes:\n> \n>> @@ -1059,13 +1059,17 @@ 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\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> I think this conversion is wrong and causes parse error.  The\n> surrounding code cannot be seen in the context of thsi patch, but\n> looks somewhat like this:\n> \n> \tmodules=$( ....\n>                    case \"$status\" in\n>                    [DT])\n>                            ...\n>                    esac\n>                    .... )\n> \n> Perhaps you would need to spell it with the extra opening\n> parenthesis, like so:\n> \n> \tcase string in\n>         ([DT])\n>         \t...\n> \tesac\n> \n> or something.\n\nDo you just think that it causes parse errors or did you actually observe\nthem? Because I think that no parse error should occur.\n\n-- Hannes\n"},{"id":"243712","messageId":"CAJDDKr5dvsChQDk+0qJS8qJq+jr6XggWFaveFkaUj0T2OiGSpA@mail.gmail.com","threadId":"36857","inReplyTo":"1402066563-28519-9-git-send-email-gitter.spiros@gmail.com","subject":"Re: [PATCH 08/20] git-mergetool.sh: avoid \"test <cond> -a/-o <cond>\"","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2014-06-10T07:37:05Z","receivedAt":"2014-06-10T07:37:05Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Fri, Jun 6, 2014 at 7:55 AM, Elia Pinto <gitter.spiros@gmail.com> wrote:\n> The construct is error-prone; \"test\" being built-in in most modern\n> shells, the reason to avoid \"test <cond> && test <cond>\" spawning\n> one extra process by using a single \"test <cond> -a <cond>\" no\n> longer exists.\n>\n> Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>\n> ---\n\nThis looks good to me.  Thanks Elia,\n\nAcked-by: David Aguilar <davvid@gmail.com>\n\n>  git-mergetool.sh |    4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n>\n> diff --git a/git-mergetool.sh b/git-mergetool.sh\n> index d08dc92..9a046b7 100755\n> --- a/git-mergetool.sh\n> +++ b/git-mergetool.sh\n> @@ -205,7 +205,7 @@ checkout_staged_file () {\n>                 \"$(git checkout-index --temp --stage=\"$1\" \"$2\" 2>/dev/null)\" \\\n>                 : '\\([^ ]*\\)    ')\n>\n> -       if test $? -eq 0 -a -n \"$tmpfile\"\n> +       if test $? -eq 0 && test -n \"$tmpfile\"\n>         then\n>                 mv -- \"$(git rev-parse --show-cdup)$tmpfile\" \"$3\"\n>         else\n> @@ -256,7 +256,7 @@ merge_file () {\n>         checkout_staged_file 2 \"$MERGED\" \"$LOCAL\"\n>         checkout_staged_file 3 \"$MERGED\" \"$REMOTE\"\n>\n> -       if test -z \"$local_mode\" -o -z \"$remote_mode\"\n> +       if test -z \"$local_mode\" || test -z \"$remote_mode\"\n>         then\n>                 echo \"Deleted merge conflict for '$MERGED':\"\n>                 describe_file \"$local_mode\" \"local\" \"$LOCAL\"\n> --\n> 1.7.10.4\n>\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n-- \nDavid\n"},{"id":"243715","messageId":"5396BFAA.3000003@viscovery.net","threadId":"36857","inReplyTo":"5396AB10.8020603@viscovery.net","subject":"Re: [PATCH 10/20] git-submodule.sh: avoid \"test <cond> -a/-o <cond>\"","fromName":"Johannes Sixt","fromEmail":"j.sixt@viscovery.net","sentAt":"2014-06-10T08:19:54Z","receivedAt":"2014-06-10T08:19:54Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 6/10/2014 8:52, schrieb Johannes Sixt:\n> Am 6/10/2014 1:23, schrieb Junio C Hamano:\n>> Elia Pinto <gitter.spiros@gmail.com> writes:\n>>\n>>> @@ -1059,13 +1059,17 @@ 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\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>> I think this conversion is wrong and causes parse error.  The\n>> surrounding code cannot be seen in the context of thsi patch, but\n>> looks somewhat like this:\n>>\n>> \tmodules=$( ....\n>>                    case \"$status\" in\n>>                    [DT])\n>>                            ...\n>>                    esac\n>>                    .... )\n>>\n>> Perhaps you would need to spell it with the extra opening\n>> parenthesis, like so:\n>>\n>> \tcase string in\n>>         ([DT])\n>>         \t...\n>> \tesac\n>>\n>> or something.\n> \n> Do you just think that it causes parse errors or did you actually observe\n> them? Because I think that no parse error should occur.\n\n(I should not talk, but test...) bash and zsh get it wrong, dash and ksh\nget it right.\nhttp://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_03\nitem 5 does leave some leeway for interpretation. So it's better to adjust\nas you suggest.\n\n-- Hannes\n-- \n\"Atomic objects are neither active nor radioactive.\" --\nProgramming Languages -- C++, Final Committee Draft (Doc.N3092)\n"},{"id":"243749","messageId":"20140610183638.GA72751@gmail.com","threadId":"36857","inReplyTo":"1402066563-28519-4-git-send-email-gitter.spiros@gmail.com","subject":"Re: [PATCH 03/20] contrib/examples/git-commit.sh: avoid \"test <cond> -a/-o <cond>\"","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2014-06-10T18:36:39Z","receivedAt":"2014-06-10T18:36:39Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Fri, Jun 06, 2014 at 07:55:46AM -0700, Elia Pinto wrote:\n> The construct is error-prone; \"test\" being built-in in most modern\n> shells, the reason to avoid \"test <cond> && test <cond>\" spawning\n> one extra process by using a single \"test <cond> -a <cond>\" no\n> longer exists.\n> \n> Signed-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> \n> diff --git a/contrib/examples/git-commit.sh b/contrib/examples/git-commit.sh\n> index 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\nIt might be worth moving the \"then\" to the next line so that it's\nconsistent with the preferred sh style and with the rest of the script.\n\nIf we do that then there's one less line that would need to be touched\nby a future style-fix patch.\n\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> -- \n> 1.7.10.4\n\n-- \nDavid\n"},{"id":"243750","messageId":"20140610183900.GB72751@gmail.com","threadId":"36857","inReplyTo":"1402066563-28519-6-git-send-email-gitter.spiros@gmail.com","subject":"Re: [PATCH 05/20] contrib/examples/git-repack.sh: avoid \"test <cond> -a/-o <cond>\"","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2014-06-10T18:39:00Z","receivedAt":"2014-06-10T18:39:00Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Fri, Jun 06, 2014 at 07:55:48AM -0700, Elia Pinto wrote:\n> The construct is error-prone; \"test\" being built-in in most modern\n> shells, the reason to avoid \"test <cond> && test <cond>\" spawning\n> one extra process by using a single \"test <cond> -a <cond>\" no\n> longer exists.\n> \n> Signed-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> \n> diff --git a/contrib/examples/git-repack.sh b/contrib/examples/git-repack.sh\n> index 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\nI do not think the traling \"\\\" is needed anymore; the \"&&\" takes care of it.\n-- \nDavid\n"},{"id":"243751","messageId":"20140610184346.GC72751@gmail.com","threadId":"36857","inReplyTo":"1402066563-28519-10-git-send-email-gitter.spiros@gmail.com","subject":"Re: [PATCH 09/20] git-rebase--interactive.sh: avoid \"test <cond> -a/-o <cond>\"","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2014-06-10T18:43:47Z","receivedAt":"2014-06-10T18:43:47Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Fri, Jun 06, 2014 at 07:55:52AM -0700, Elia Pinto wrote:\n> The construct is error-prone; \"test\" being built-in in most modern\n> shells, the reason to avoid \"test <cond> && test <cond>\" spawning\n> one extra process by using a single \"test <cond> -a <cond>\" no\n> longer exists.\n> \n> Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>\n> ---\n>  git-rebase--interactive.sh |    2 +-\n>  1 file changed, 1 insertion(+), 1 deletion(-)\n> \n> diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\n> index 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\nThis line is getting pretty long.\nI wonder whether it should be wrapped at the && to keep it shorter?\n\nAlso, it looks like the last half of the expression can be simplified to,\n\n\ttest -z \"$(sane_grep \"$rev\" \"$state_dir\"/not-cherry-picks)\"\n\nrather than comparing against \"\".\n-- \nDavid\n"},{"id":"243754","messageId":"20140610184913.GD72751@gmail.com","threadId":"36857","inReplyTo":"1402066563-28519-16-git-send-email-gitter.spiros@gmail.com","subject":"Re: [PATCH 15/20] t/t5000-tar-tree.sh: avoid \"test <cond> -a/-o <cond>\"","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2014-06-10T18:49:15Z","receivedAt":"2014-06-10T18:49:15Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Fri, Jun 06, 2014 at 07:55:58AM -0700, Elia Pinto wrote:\n> The construct is error-prone; \"test\" being built-in in most modern\n> shells, the reason to avoid \"test <cond> && test <cond>\" spawning\n> one extra process by using a single \"test <cond> -a <cond>\" no\n> longer exists.\n> \n> Signed-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> \n> diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\n> index 74fc5a8..ad6fa0d 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\nThis looks okay, but it raises a question for the original author\n(René, I think that's you so I've added you to the To: line).\n\nShould that be \"test -f\" instead of \"test -e\"?\n\nThis is a very minor note and should not block this patch.\n-- \nDavid\n"},{"id":"243761","messageId":"20140610192110.GA72977@gmail.com","threadId":"36857","inReplyTo":"20140610184913.GD72751@gmail.com","subject":"Re: [PATCH 15/20] t/t5000-tar-tree.sh: avoid \"test <cond> -a/-o <cond>\"","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2014-06-10T19:21:11Z","receivedAt":"2014-06-10T19:21:11Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"On Tue, Jun 10, 2014 at 11:49:15AM -0700, David Aguilar wrote:\n> On Fri, Jun 06, 2014 at 07:55:58AM -0700, Elia Pinto wrote:\n> > The construct is error-prone; \"test\" being built-in in most modern\n> > shells, the reason to avoid \"test <cond> && test <cond>\" spawning\n> > one extra process by using a single \"test <cond> -a <cond>\" no\n> > longer exists.\n> > \n> > Signed-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> > \n> > diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\n> > index 74fc5a8..ad6fa0d 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> \n> This looks okay, but it raises a question for the original author\n> (René, I think that's you so I've added you to the To: line).\n\nJust following up -- I got a bounce from René's email address.\n\n> \n> Should that be \"test -f\" instead of \"test -e\"?\n\nIt does seem like this should be \"test -f\" nonetheless.\nSorry for the noise.\n\n> This is a very minor note and should not block this patch.\n-- \nDavid\n"},{"id":"243764","messageId":"20140610200804.GD72977@gmail.com","threadId":"36857","inReplyTo":"1402066563-28519-16-git-send-email-gitter.spiros@gmail.com","subject":"Re: [PATCH 15/20] t/t5000-tar-tree.sh: avoid \"test <cond> -a/-o <cond>\"","fromName":"David Aguilar","fromEmail":"davvid@gmail.com","sentAt":"2014-06-10T20:08:05Z","receivedAt":"2014-06-10T20:08:05Z","isPatch":true,"sender":{"key":"davvid@gmail.com","avatar":"https://avatars.githubusercontent.com/u/13196?v=4"},"body":"[Resent using René's correct email address this time, sorry for the noise]\n\nOn Fri, Jun 06, 2014 at 07:55:58AM -0700, Elia Pinto wrote:\n> The construct is error-prone; \"test\" being built-in in most modern\n> shells, the reason to avoid \"test <cond> && test <cond>\" spawning\n> one extra process by using a single \"test <cond> -a <cond>\" no\n> longer exists.\n> \n> Signed-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> \n> diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\n> index 74fc5a8..ad6fa0d 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\nThis looks okay, but it raises a question for the original author\n(René, I think that's you so I've added you to the To: line).\n\nShould that be \"test -f\" instead of \"test -e\"?\n\nThis is a very minor note and should not block this patch.\nIt's probably a change that's better made in a follow-up patch.\n\n>  \t\t\t\t\tpath=$(get_pax_header $header path) &&\n>  \t\t\t\t\tif test -n \"$path\"\n-- \nDavid\n"},{"id":"243805","messageId":"53977D05.5070505@web.de","threadId":"36857","inReplyTo":"20140610200804.GD72977@gmail.com","subject":"Re: [PATCH 15/20] t/t5000-tar-tree.sh: avoid \"test <cond> -a/-o <cond>\"","fromName":"René Scharfe","fromEmail":"l.s.r@web.de","sentAt":"2014-06-10T21:47:49Z","receivedAt":"2014-06-10T21:47:49Z","isPatch":true,"sender":{"key":"l.s.r@web.de","avatar":"https://avatars.githubusercontent.com/u/26122331?v=4"},"body":"Am 10.06.2014 22:08, schrieb David Aguilar:\n> [Resent using René's correct email address this time, sorry for the noise]\n>\n> On Fri, Jun 06, 2014 at 07:55:58AM -0700, Elia Pinto wrote:\n>> The construct is error-prone; \"test\" being built-in in most modern\n>> shells, the reason to avoid \"test <cond> && test <cond>\" spawning\n>> one extra process by using a single \"test <cond> -a <cond>\" no\n>> longer exists.\n>>\n>> Signed-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>>\n>> diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh\n>> index 74fc5a8..ad6fa0d 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>\n> This looks okay, but it raises a question for the original author\n> (René, I think that's you so I've added you to the To: line).\n>\n> Should that be \"test -f\" instead of \"test -e\"?\n\nWith -f instead of -e the function would ignore pax path headers for \ndirectories and special files.  The latter is not relevant for git at \nall and we don't currently have a test for long directory names, but why \nrestrict the code to handle only regular files?\n\nA better change would be adding tests for symlinks and directories with \nlong names.\n\n>\n> This is a very minor note and should not block this patch.\n> It's probably a change that's better made in a follow-up patch.\n>\n>>   \t\t\t\t\tpath=$(get_pax_header $header path) &&\n>>   \t\t\t\t\tif test -n \"$path\"\n"}]}