{"thread":{"id":"3531","subject":"[PATCH 1/3] cg-mv doesn't work with bash 3.1.7 due to excessive quotes","startedAt":"2006-03-03T01:11:54Z","lastAt":"2006-03-19T22:37:03Z","messageCount":8,"participants":["Pavel Roskin","Junio C Hamano","Josef Weidendorfer","Petr Baudis"],"isPatch":true,"patchVersion":1,"patchTotal":3},"messages":[{"id":"17091","messageId":"20060303011154.14619.71590.stgit@dv.roinet.com","threadId":"3531","inReplyTo":null,"subject":"[PATCH 1/3] cg-mv doesn't work with bash 3.1.7 due to excessive quotes","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2006-03-03T01:11:54Z","receivedAt":"2006-03-03T01:11:54Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"\n\nSigned-off-by: Pavel Roskin <proski@gnu.org>\n---\n\n cg-mv |    2 +-\n 1 files changed, 1 insertions(+), 1 deletions(-)\n\ndiff --git a/cg-mv b/cg-mv\nindex c42853c..d5618ba 100755\n--- a/cg-mv\n+++ b/cg-mv\n@@ -38,7 +38,7 @@ done\n # Strip trailing / which is something GIT does not bear well.\n ARGS2=()\n for arg in \"${ARGS[@]}\"; do\n-\tARGS2[\"${#ARGS2[@]}\"]=\"$_git_relpath${arg%/}\"\n+\tARGS2[${#ARGS2[@]}]=\"$_git_relpath${arg%/}\"\n done\n \n git-mv $force \"${ARGS2[@]}\"\n"},{"id":"17093","messageId":"20060303011157.14619.99070.stgit@dv.roinet.com","threadId":"3531","inReplyTo":"20060303011154.14619.71590.stgit@dv.roinet.com","subject":"[PATCH 2/3] Make tutorial-script work with current cogito","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2006-03-03T01:11:57Z","receivedAt":"2006-03-03T01:11:57Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"Labels on merge conflict lines have changed.  There is no \"git rename\",\nuse cg-mv instead.  In one case stack.h is not created, so copy\nstack.h~master to stack.h before fixing it.\n\nAlso fix comments in script.sh to use the new labels.\n\nSigned-off-by: Pavel Roskin <proski@gnu.org>\n---\n\n .../tutorial-script/0010-alice-bob-fixup.ed        |    2 +\n .../tutorial-script/0017-alice-bob-fixup.ed        |    2 +\n .../tutorial-script/0018-alice-charlie-fixup1.ed   |    4 +--\n .../tutorial-script/0019-alice-charlie-fixup2.ed   |    4 +--\n .../tutorial-script/0021-bob-alice-fixup1.ed       |    4 +--\n .../tutorial-script/0022-bob-alice-fixup2.ed       |    2 +\n Documentation/tutorial-script/script.sh            |   31 ++++++++++----------\n 7 files changed, 25 insertions(+), 24 deletions(-)\n\ndiff --git a/Documentation/tutorial-script/0010-alice-bob-fixup.ed b/Documentation/tutorial-script/0010-alice-bob-fixup.ed\nindex ca2047c..81b1360 100644\n--- a/Documentation/tutorial-script/0010-alice-bob-fixup.ed\n+++ b/Documentation/tutorial-script/0010-alice-bob-fixup.ed\n@@ -1,3 +1,3 @@\n-/^<<<<<<< rpn\\.c/,/^>>>>>>> \\.merge_file_/d\n+/^<<<<<<< bob/,/^>>>>>>> bobswork/d\n w\n q\ndiff --git a/Documentation/tutorial-script/0017-alice-bob-fixup.ed b/Documentation/tutorial-script/0017-alice-bob-fixup.ed\nindex ad04eb7..6353328 100644\n--- a/Documentation/tutorial-script/0017-alice-bob-fixup.ed\n+++ b/Documentation/tutorial-script/0017-alice-bob-fixup.ed\n@@ -1,4 +1,4 @@\n-/^<<<<<<< Makefile/d\n+/^<<<<<<< \\.merge_file_/d\n /^=======/,/^=======/+1d\n /^>>>>>>> \\.merge_file_/d\n w\ndiff --git a/Documentation/tutorial-script/0018-alice-charlie-fixup1.ed b/Documentation/tutorial-script/0018-alice-charlie-fixup1.ed\nindex 65f5ef5..20c25c8 100644\n--- a/Documentation/tutorial-script/0018-alice-charlie-fixup1.ed\n+++ b/Documentation/tutorial-script/0018-alice-charlie-fixup1.ed\n@@ -1,7 +1,7 @@\n-/^<<<<<<< Makefile/d\n+/^<<<<<<< master/d\n /^rpn\\.o:/s/\\.h.*$/.h lexer.h/\n /^lexer\\.o:/s/:.*$/: lexer.h/\n-/^=======/,/^>>>>>>> \\.merge_file_/d\n+/^=======/,/^>>>>>>> charlie/d\n w\n q\n \ndiff --git a/Documentation/tutorial-script/0019-alice-charlie-fixup2.ed b/Documentation/tutorial-script/0019-alice-charlie-fixup2.ed\nindex f1aadb4..5d531de 100644\n--- a/Documentation/tutorial-script/0019-alice-charlie-fixup2.ed\n+++ b/Documentation/tutorial-script/0019-alice-charlie-fixup2.ed\n@@ -1,5 +1,5 @@\n-/^<<<<<<< rpn\\.c/,/^=======/d\n-/^>>>>>>> \\.merge_file_/d\n+/^<<<<<<< master/,/^=======/d\n+/^>>>>>>> charlie/d\n w\n q\n \ndiff --git a/Documentation/tutorial-script/0021-bob-alice-fixup1.ed b/Documentation/tutorial-script/0021-bob-alice-fixup1.ed\nindex 2783f73..df703d5 100644\n--- a/Documentation/tutorial-script/0021-bob-alice-fixup1.ed\n+++ b/Documentation/tutorial-script/0021-bob-alice-fixup1.ed\n@@ -1,4 +1,4 @@\n-/^<<<<<<< Makefile/,/^=======/d\n-/^>>>>>>> \\.merge_file_/d\n+/^<<<<<<< master/,/^=======/d\n+/^>>>>>>> origin/d\n w\n q\ndiff --git a/Documentation/tutorial-script/0022-bob-alice-fixup2.ed b/Documentation/tutorial-script/0022-bob-alice-fixup2.ed\nindex 18c90d4..d8c5746 100644\n--- a/Documentation/tutorial-script/0022-bob-alice-fixup2.ed\n+++ b/Documentation/tutorial-script/0022-bob-alice-fixup2.ed\n@@ -1,5 +1,5 @@\n /^#include \"stack\\.h\"/+1d\n /^#include \"lexer\\.h\"/+1,/^#include \"stack\\.h\"/d\n-/^<<<<<<< rpn\\.c/-1,/^>>>>>>> \\.merge_file_/d\n+/^<<<<<<< master/-1,/^>>>>>>> origin/d\n w\n q\ndiff --git a/Documentation/tutorial-script/script.sh b/Documentation/tutorial-script/script.sh\nindex bc70b77..edcebda 100755\n--- a/Documentation/tutorial-script/script.sh\n+++ b/Documentation/tutorial-script/script.sh\n@@ -120,13 +120,13 @@ cg-update bobswork && should_fail\n # difference between her version and Bob's:\n \n #: ...\n-#: <<<<<<< rpn.c\n+#: <<<<<<< bob\n #: extern double pop(void);\n #: extern void push(double);\n #: extern void clear(void);\n #: \n #: =======\n-#: >>>>>>> .merge_file_5wCNZT\n+#: >>>>>>> bobswork\n #: extern int getsym(void);\n #: ...\n  \n@@ -216,7 +216,7 @@ cg-merge bob && should_fail\n # Merge fails:\n \n #: ...\n-#: <<<<<<< Makefile\n+#: <<<<<<< .merge_file_l54ztH\n #:\t$(CC) $(CFLAGS) $^ -lm -o $@\n #: =======\n #:\t$(CC) $(CFLAGS) $^ -o $@\n@@ -235,31 +235,31 @@ cg-merge charlie && should_fail\n # Merge conflicts!\n \n #: ...\n-#: <<<<<<< Makefile\n-#:         $(CC) $(CFLAGS) $^ -lm -o $@\n-#:        \n+#: <<<<<<< master\n+#:\t$(CC) $(CFLAGS) $^ -lm -o $@\n+#:\t\n #: rpn.o: stack.h\n #: stack.o: stack.h\n-#: lexer.o:\n+#: lexer.o:\t\n #: =======\n-#:         $(CC) $(CFLAGS) $^ -o $@\n-#:                \n+#:\t$(CC) $(CFLAGS) $^ -o $@\n+#:\t\n #: rpn.o lexer.o: lexer.h\n-#: \n-#: >>>>>>> .merge_file_huuX9C\n+#:\t\n+#: >>>>>>> charlie\n \n ed Makefile < $TOP/0018-alice-charlie-fixup1.ed\n \n #: ...\n-#: <<<<<<< rpn.c\n+#: <<<<<<< master\n #: extern int getsym(void);\n #: \n #: =======\n #: extern double pop(void);\n #: extern void push(double);\n #: extern void clear(void);\n-#:\n-#: >>>>>> .merge_file_qtv6VA\n+#: \n+#: >>>>>>> charlie\n #: ...\n \n ed rpn.c    < $TOP/0019-alice-charlie-fixup2.ed\n@@ -273,7 +273,7 @@ cg-add CONTRIBUTORS\n cg-commit -m \"Add CONTRIBUTORS\"\n \n # Wrong file name...\n-git rename CONTRIBUTORS CREDITS\n+cg-mv CONTRIBUTORS CREDITS\n cg-commit -m \"Rename CONTRIBUTORS to CREDITS\"\n \n \n@@ -308,6 +308,7 @@ echo \"Merge with 0.4\" | cg-merge && shou\n # Mishandled stack.h\n ed Makefile < $TOP/0021-bob-alice-fixup1.ed\n ed rpn.c    < $TOP/0022-bob-alice-fixup2.ed\n+cp stack.h~master stack.h\n ed stack.h  < $TOP/0023-bob-alice-fixup3.ed\n cg-add stack.h\n \n"},{"id":"17092","messageId":"20060303011159.14619.40752.stgit@dv.roinet.com","threadId":"3531","inReplyTo":"20060303011154.14619.71590.stgit@dv.roinet.com","subject":"[PATCH 3/3] Allow the tutorial script to be run by \"make test\"","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2006-03-03T01:11:59Z","receivedAt":"2006-03-03T01:11:59Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"\n\nSigned-off-by: Pavel Roskin <proski@gnu.org>\n---\n\n Documentation/Makefile                 |    4 ++++\n Documentation/tutorial-script/Makefile |    5 +++++\n Makefile                               |    1 +\n 3 files changed, 10 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex 3aad2fb..e5508e8 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -55,7 +55,11 @@ install-html: html\n \t$(INSTALL) -m755 -d $(DESTDIR)/$(htmldir)\n \t$(INSTALL) $(DOC_HTML) $(DESTDIR)/$(htmldir)\n \n+test:\n+\tmake -C tutorial-script test\n+\n clean:\n+\tmake -C tutorial-script clean\n \trm -f *.xml *.html *.1 *.7 cg*.txt $(PACKAGE).txt\n \n .PRECIOUS: cg%.txt\ndiff --git a/Documentation/tutorial-script/Makefile b/Documentation/tutorial-script/Makefile\nnew file mode 100644\nindex 0000000..bdf384f\n--- /dev/null\n+++ b/Documentation/tutorial-script/Makefile\n@@ -0,0 +1,5 @@\n+test:\n+\t./script.sh\n+\n+clean:\n+\trm -rf Playground\ndiff --git a/Makefile b/Makefile\nindex 994b182..2b53641 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -59,6 +59,7 @@ doc:\n \n test: all\n \t$(MAKE) -C t/ all\n+\t$(MAKE) -C Documentation/ test\n \n \n \n"},{"id":"17099","messageId":"7vbqwo3xo4.fsf@assigned-by-dhcp.cox.net","threadId":"3531","inReplyTo":"20060303011154.14619.71590.stgit@dv.roinet.com","subject":"Re: [PATCH 1/3] cg-mv doesn't work with bash 3.1.7 due to excessive quotes","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-03-03T05:27:39Z","receivedAt":"2006-03-03T05:27:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Pavel Roskin <proski@gnu.org> writes:\n\n> -\tARGS2[\"${#ARGS2[@]}\"]=\"$_git_relpath${arg%/}\"\n> +\tARGS2[${#ARGS2[@]}]=\"$_git_relpath${arg%/}\"\n\nIs this an application bug?  It looks like a workaround for a\nbug in the shell...\n\nNot that I care too much either way -- I do not use shell arrays\nmyself ;-).\n"},{"id":"17115","messageId":"1141395067.30343.14.camel@dv","threadId":"3531","inReplyTo":"7vbqwo3xo4.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 1/3] cg-mv doesn't work with bash 3.1.7 due to excessive quotes","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2006-03-03T14:11:07Z","receivedAt":"2006-03-03T14:11:07Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"On Thu, 2006-03-02 at 21:27 -0800, Junio C Hamano wrote:\n> Pavel Roskin <proski@gnu.org> writes:\n> \n> > -\tARGS2[\"${#ARGS2[@]}\"]=\"$_git_relpath${arg%/}\"\n> > +\tARGS2[${#ARGS2[@]}]=\"$_git_relpath${arg%/}\"\n> \n> Is this an application bug?  It looks like a workaround for a\n> bug in the shell...\n\nIndeed, bash 3.00.16 (FC4) is fine with the original cg-mv.  On the\nother hand, bash 3.1.7 (FC development) doesn't even like this:\n\n$ arg[\"0\"]=0\nbash: \"0\": syntax error: operand expected (error token is \"\"0\"\")\n\nI don't see any relevant information in the NEWS file, so even if it's\nno a bug, it's an undocumented feature :-)\n\nAnyway, the quotes are excessive, bash is (sort of) correct to complain\nabout it, and I don't see any other instances of quoting array arguments\nin cogito.\n\nThe quotes in question have always existed in cg-mv, they were not added\nto work around anything.\n\n-- \nRegards,\nPavel Roskin\n"},{"id":"17120","messageId":"200603031734.16315.Josef.Weidendorfer@gmx.de","threadId":"3531","inReplyTo":"7vbqwo3xo4.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 1/3] cg-mv doesn't work with bash 3.1.7 due to excessive quotes","fromName":"Josef Weidendorfer","fromEmail":"josef.weidendorfer@gmx.de","sentAt":"2006-03-03T16:34:16Z","receivedAt":"2006-03-03T16:34:16Z","isPatch":true,"sender":{"key":"josef.weidendorfer@gmx.de","avatar":null},"body":"On Friday 03 March 2006 06:27, you wrote:\n> Pavel Roskin <proski@gnu.org> writes:\n> \n> > -\tARGS2[\"${#ARGS2[@]}\"]=\"$_git_relpath${arg%/}\"\n> > +\tARGS2[${#ARGS2[@]}]=\"$_git_relpath${arg%/}\"\n> \n> Is this an application bug?  It looks like a workaround for a\n> bug in the shell...\n\nThis line in cg-mv is needed to work around at least two\nbugs in git-mv:\n* \"git-mv a/ b/\" not working.\n  Fix was to strip all trailing slashes of args (fixed in 1.2.4)\n* \"cd subdir; git-mv ../file .\"\n  Fix is to run git-mv from base directory (see separate patch for git-mv)\nI think cg-mv should be able to be a direct wrapper for git-mv with\nthe next maintenance release.\n\nPasky: do you know of other problems with git-mv?\n\nJosef\n"},{"id":"17439","messageId":"1142023722.23830.8.camel@dv","threadId":"3531","inReplyTo":"1141395067.30343.14.camel@dv","subject":"Re: [PATCH 1/3] cg-mv doesn't work with bash 3.1.7 due to excessive quotes","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2006-03-10T20:48:42Z","receivedAt":"2006-03-10T20:48:42Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"Hello, Petr!\n\nOn Fri, 2006-03-03 at 09:11 -0500, Pavel Roskin wrote:\n> On Thu, 2006-03-02 at 21:27 -0800, Junio C Hamano wrote:\n> > Pavel Roskin <proski@gnu.org> writes:\n> > \n> > > -\tARGS2[\"${#ARGS2[@]}\"]=\"$_git_relpath${arg%/}\"\n> > > +\tARGS2[${#ARGS2[@]}]=\"$_git_relpath${arg%/}\"\n\nAny issues with this patch?  FC5 is due in a week.  Expect and outcry\nfrom the new bash 3.1.7 users if the fixed cogito is not available\nshortly.\n\nBash is not as wrong as it may seem.  Left hand side in assignments is\nalready a special case in earlier versions of bash, just not in the\nindex:\n\nbash 3.00.16 (FC4)\n$ f\"oo\"=bar\nbash: foo=bar: command not found\n$ foo[\"0\"]=bar\n$\n\nbash 3.1.7 (FC5)\n$ f\"oo\"=bar\nbash: foo=bar: command not found\n$ foo[\"0\"]=bar\nbash: \"0\": syntax error: operand expected (error token is \"\"0\"\")\n$\n\n-- \nRegards,\nPavel Roskin\n"},{"id":"17686","messageId":"20060319223703.GI18185@pasky.or.cz","threadId":"3531","inReplyTo":"20060303011157.14619.99070.stgit@dv.roinet.com","subject":"Re: [PATCH 2/3] Make tutorial-script work with current cogito","fromName":"Petr Baudis","fromEmail":"pasky@suse.cz","sentAt":"2006-03-19T22:37:03Z","receivedAt":"2006-03-19T22:37:03Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"Dear diary, on Fri, Mar 03, 2006 at 02:11:57AM CET, I got a letter\nwhere Pavel Roskin <proski@gnu.org> said that...\n> Labels on merge conflict lines have changed.  There is no \"git rename\",\n> use cg-mv instead.  In one case stack.h is not created, so copy\n> stack.h~master to stack.h before fixing it.\n> \n> Also fix comments in script.sh to use the new labels.\n> \n> Signed-off-by: Pavel Roskin <proski@gnu.org>\n\nWhoops, overlooked this and already fixed it on my own. Thanks anyway.\n\n> @@ -308,6 +308,7 @@ echo \"Merge with 0.4\" | cg-merge && shou\n>  # Mishandled stack.h\n>  ed Makefile < $TOP/0021-bob-alice-fixup1.ed\n>  ed rpn.c    < $TOP/0022-bob-alice-fixup2.ed\n> +cp stack.h~master stack.h\n>  ed stack.h  < $TOP/0023-bob-alice-fixup3.ed\n>  cg-add stack.h\n\nIsn't it enough to just kill ~master and move ~origin there, though?\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\nRight now I am having amnesia and deja-vu at the same time.  I think\nI have forgotten this before.\n"}]}