{"thread":{"id":"9182","subject":"[PATCH] Fix problematic ']'","startedAt":"2007-07-23T20:36:21Z","lastAt":"2007-07-24T02:18:28Z","messageCount":5,"participants":["Johannes Sixt","Johannes Schindelin","Timo Hirvonen","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"48345","messageId":"200707232236.21389.johannes.sixt@telecom.at","threadId":"9182","inReplyTo":null,"subject":"[PATCH] Fix problematic ']'","fromName":"Johannes Sixt","fromEmail":"johannes.sixt@telecom.at","sentAt":"2007-07-23T20:36:21Z","receivedAt":"2007-07-23T20:36:21Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Not all shells grok a closing ']' of the shell '[' command without\nsurrounding space.\n\nSigned-off-by: Johannes Sixt <johannes.sixt@telecom.at>\n---\n\nI didn't go the long way to change all `[ ... ]` into `test ...`\n\n git-rebase--interactive.sh |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex 579a45e..e0d1326 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -385,7 +385,7 @@ do\n \n \t\trequire_clean_work_tree\n \n-\t\tif [ ! -z \"$2\"]\n+\t\tif [ ! -z \"$2\" ]\n \t\tthen\n \t\t\tgit show-ref --verify --quiet \"refs/heads/$2\" ||\n \t\t\t\tdie \"Invalid branchname: $2\"\n-- \n1.5.3.rc0\n"},{"id":"48355","messageId":"Pine.LNX.4.64.0707232150580.14781@racer.site","threadId":"9182","inReplyTo":"200707232236.21389.johannes.sixt@telecom.at","subject":"Re: [PATCH] Fix problematic ']'","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-07-23T20:51:16Z","receivedAt":"2007-07-23T20:51:16Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Mon, 23 Jul 2007, Johannes Sixt wrote:\n\n> Not all shells grok a closing ']' of the shell '[' command without\n> surrounding space.\n\nDarn.\n\nThanks for cleaning up behind me,\nDscho\n"},{"id":"48357","messageId":"20070723235835.36b6d87a.tihirvon@gmail.com","threadId":"9182","inReplyTo":"200707232236.21389.johannes.sixt@telecom.at","subject":"Re: [PATCH] Fix problematic ']'","fromName":"Timo Hirvonen","fromEmail":"tihirvon@gmail.com","sentAt":"2007-07-23T20:58:35Z","receivedAt":"2007-07-23T20:58:35Z","isPatch":true,"sender":{"key":"tihirvon@gmail.com","avatar":null},"body":"Johannes Sixt <johannes.sixt@telecom.at> wrote:\n\n> Not all shells grok a closing ']' of the shell '[' command without\n> surrounding space.\n\nThat's one good reason to use test instead of /usr/bin/[ hack (yes it\nhas been a shell built-in for a long time). [ is just like test but\nexpects ] as last parameter and ignores it.  Very ugly IMO.\n\n-- \nhttp://onion.dynserv.net/~timo/\n"},{"id":"48392","messageId":"7vvecak1aw.fsf@assigned-by-dhcp.cox.net","threadId":"9182","inReplyTo":"200707232236.21389.johannes.sixt@telecom.at","subject":"Re: [PATCH] Fix problematic ']'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-07-24T02:01:11Z","receivedAt":"2007-07-24T02:01:11Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <johannes.sixt@telecom.at> writes:\n\n> Not all shells grok a closing ']' of the shell '[' command without\n> surrounding space.\n>\n> Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>\n> ---\n>\n> I didn't go the long way to change all `[ ... ]` into `test ...`\n\nMaybe that would have been a better idea.\n"},{"id":"48393","messageId":"Pine.LNX.4.64.0707240318010.14781@racer.site","threadId":"9182","inReplyTo":"7vvecak1aw.fsf@assigned-by-dhcp.cox.net","subject":"[PATCH] rebase -i: exchange all \"if [ .. ]\" by \"if test ..\"","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2007-07-24T02:18:28Z","receivedAt":"2007-07-24T02:18:28Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"\nThis patch is literally\n\n:%s/if \\[ *\\(.*[^ ]\\) *\\]/if test \\1/\n\nin vi, after making sure that the other instances of \"[..]\" are not\nactually invocations of \"test\".\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n\n\tOn Mon, 23 Jul 2007, Junio C Hamano wrote:\n\n\t> Johannes Sixt <johannes.sixt@telecom.at> writes:\n\t> \n\t> > Not all shells grok a closing ']' of the shell '[' command without\n\t> > surrounding space.\n\t> >\n\t> > Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>\n\t> > ---\n\t> >\n\t> > I didn't go the long way to change all `[ ... ]` into `test ...`\n\t> \n\t> Maybe that would have been a better idea.\n\n\tVoila.\n\n\t(Obviously, this is on top of my last patch to rebase -i, to bug \n\tyou into applying it ;-)\n\n\tSeriously again, if I should rather redo it relative to \"master\", \n\tplease say so.  Or apply the regsub and get all the karma for \n\tfree...\n\n git-rebase--interactive.sh |   14 +++++++-------\n 1 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh\nindex ac1f5a2..93289c0 100755\n--- a/git-rebase--interactive.sh\n+++ b/git-rebase--interactive.sh\n@@ -102,7 +102,7 @@ pick_one () {\n \t\tpick_one_preserving_merges \"$@\" && return\n \tparent_sha1=$(git rev-parse --verify $sha1^ 2>/dev/null)\n \tcurrent_sha1=$(git rev-parse --verify HEAD)\n-\tif [ $current_sha1 = $parent_sha1 ]; then\n+\tif test $current_sha1 = $parent_sha1; then\n \t\toutput git reset --hard $sha1\n \t\ttest \"a$1\" = a-n && output git reset --soft $current_sha1\n \t\tsha1=$(git rev-parse --short $sha1)\n@@ -116,7 +116,7 @@ pick_one_preserving_merges () {\n \tcase \"$1\" in -n) sha1=$2 ;; *) sha1=$1 ;; esac\n \tsha1=$(git rev-parse $sha1)\n \n-\tif [ -f \"$DOTEST\"/current-commit ]\n+\tif test -f \"$DOTEST\"/current-commit\n \tthen\n \t\tcurrent_commit=$(cat \"$DOTEST\"/current-commit) &&\n \t\tgit rev-parse HEAD > \"$REWRITTEN\"/$current_commit &&\n@@ -130,7 +130,7 @@ pick_one_preserving_merges () {\n \tnew_parents=\n \tfor p in $(git rev-list --parents -1 $sha1 | cut -d\\  -f2-)\n \tdo\n-\t\tif [ -f \"$REWRITTEN\"/$p ]\n+\t\tif test -f \"$REWRITTEN\"/$p\n \t\tthen\n \t\t\tpreserve=f\n \t\t\tnew_p=$(cat \"$REWRITTEN\"/$p)\n@@ -188,7 +188,7 @@ nth_string () {\n }\n \n make_squash_message () {\n-\tif [ -f \"$SQUASH_MSG\" ]; then\n+\tif test -f \"$SQUASH_MSG\"; then\n \t\tCOUNT=$(($(sed -n \"s/^# This is [^0-9]*\\([0-9]\\+\\).*/\\1/p\" \\\n \t\t\t< \"$SQUASH_MSG\" | tail -n 1)+1))\n \t\techo \"# This is a combination of $COUNT commits.\"\n@@ -286,7 +286,7 @@ do_next () {\n \tHEADNAME=$(cat \"$DOTEST\"/head-name) &&\n \tOLDHEAD=$(cat \"$DOTEST\"/head) &&\n \tSHORTONTO=$(git rev-parse --short $(cat \"$DOTEST\"/onto)) &&\n-\tif [ -d \"$REWRITTEN\" ]\n+\tif test -d \"$REWRITTEN\"\n \tthen\n \t\ttest -f \"$DOTEST\"/current-commit &&\n \t\t\tcurrent_commit=$(cat \"$DOTEST\"/current-commit) &&\n@@ -403,7 +403,7 @@ do\n \n \t\trequire_clean_work_tree\n \n-\t\tif [ ! -z \"$2\"]\n+\t\tif test ! -z \"$2\"\n \t\tthen\n \t\t\toutput git show-ref --verify --quiet \"refs/heads/$2\" ||\n \t\t\t\tdie \"Invalid branchname: $2\"\n@@ -426,7 +426,7 @@ do\n \t\techo $ONTO > \"$DOTEST\"/onto\n \t\ttest -z \"$STRATEGY\" || echo \"$STRATEGY\" > \"$DOTEST\"/strategy\n \t\ttest t = \"$VERBOSE\" && : > \"$DOTEST\"/verbose\n-\t\tif [ t = \"$PRESERVE_MERGES\" ]\n+\t\tif test t = \"$PRESERVE_MERGES\"\n \t\tthen\n \t\t\t# $REWRITTEN contains files for each commit that is\n \t\t\t# reachable by at least one merge base of $HEAD and\n-- \n1.5.3.rc2.32.g35c5b-dirty\n"}]}