git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* [PATCH 1/3] cg-mv doesn't work with bash 3.1.7 due to excessive quotes
@ 2006-03-03  1:11 Pavel Roskin
  2006-03-03  1:11 ` [PATCH 2/3] Make tutorial-script work with current cogito Pavel Roskin
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Pavel Roskin @ 2006-03-03  1:11 UTC (permalink / raw
  To: git, Petr Baudis



Signed-off-by: Pavel Roskin <proski@gnu.org>
---

 cg-mv |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/cg-mv b/cg-mv
index c42853c..d5618ba 100755
--- a/cg-mv
+++ b/cg-mv
@@ -38,7 +38,7 @@ done
 # Strip trailing / which is something GIT does not bear well.
 ARGS2=()
 for arg in "${ARGS[@]}"; do
-	ARGS2["${#ARGS2[@]}"]="$_git_relpath${arg%/}"
+	ARGS2[${#ARGS2[@]}]="$_git_relpath${arg%/}"
 done
 
 git-mv $force "${ARGS2[@]}"

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 2/3] Make tutorial-script work with current cogito
  2006-03-03  1:11 [PATCH 1/3] cg-mv doesn't work with bash 3.1.7 due to excessive quotes Pavel Roskin
@ 2006-03-03  1:11 ` Pavel Roskin
  2006-03-19 22:37   ` Petr Baudis
  2006-03-03  1:11 ` [PATCH 3/3] Allow the tutorial script to be run by "make test" Pavel Roskin
  2006-03-03  5:27 ` [PATCH 1/3] cg-mv doesn't work with bash 3.1.7 due to excessive quotes Junio C Hamano
  2 siblings, 1 reply; 8+ messages in thread
From: Pavel Roskin @ 2006-03-03  1:11 UTC (permalink / raw
  To: git, Petr Baudis

Labels on merge conflict lines have changed.  There is no "git rename",
use cg-mv instead.  In one case stack.h is not created, so copy
stack.h~master to stack.h before fixing it.

Also fix comments in script.sh to use the new labels.

Signed-off-by: Pavel Roskin <proski@gnu.org>
---

 .../tutorial-script/0010-alice-bob-fixup.ed        |    2 +
 .../tutorial-script/0017-alice-bob-fixup.ed        |    2 +
 .../tutorial-script/0018-alice-charlie-fixup1.ed   |    4 +--
 .../tutorial-script/0019-alice-charlie-fixup2.ed   |    4 +--
 .../tutorial-script/0021-bob-alice-fixup1.ed       |    4 +--
 .../tutorial-script/0022-bob-alice-fixup2.ed       |    2 +
 Documentation/tutorial-script/script.sh            |   31 ++++++++++----------
 7 files changed, 25 insertions(+), 24 deletions(-)

diff --git a/Documentation/tutorial-script/0010-alice-bob-fixup.ed b/Documentation/tutorial-script/0010-alice-bob-fixup.ed
index ca2047c..81b1360 100644
--- a/Documentation/tutorial-script/0010-alice-bob-fixup.ed
+++ b/Documentation/tutorial-script/0010-alice-bob-fixup.ed
@@ -1,3 +1,3 @@
-/^<<<<<<< rpn\.c/,/^>>>>>>> \.merge_file_/d
+/^<<<<<<< bob/,/^>>>>>>> bobswork/d
 w
 q
diff --git a/Documentation/tutorial-script/0017-alice-bob-fixup.ed b/Documentation/tutorial-script/0017-alice-bob-fixup.ed
index ad04eb7..6353328 100644
--- a/Documentation/tutorial-script/0017-alice-bob-fixup.ed
+++ b/Documentation/tutorial-script/0017-alice-bob-fixup.ed
@@ -1,4 +1,4 @@
-/^<<<<<<< Makefile/d
+/^<<<<<<< \.merge_file_/d
 /^=======/,/^=======/+1d
 /^>>>>>>> \.merge_file_/d
 w
diff --git a/Documentation/tutorial-script/0018-alice-charlie-fixup1.ed b/Documentation/tutorial-script/0018-alice-charlie-fixup1.ed
index 65f5ef5..20c25c8 100644
--- a/Documentation/tutorial-script/0018-alice-charlie-fixup1.ed
+++ b/Documentation/tutorial-script/0018-alice-charlie-fixup1.ed
@@ -1,7 +1,7 @@
-/^<<<<<<< Makefile/d
+/^<<<<<<< master/d
 /^rpn\.o:/s/\.h.*$/.h lexer.h/
 /^lexer\.o:/s/:.*$/: lexer.h/
-/^=======/,/^>>>>>>> \.merge_file_/d
+/^=======/,/^>>>>>>> charlie/d
 w
 q
 
diff --git a/Documentation/tutorial-script/0019-alice-charlie-fixup2.ed b/Documentation/tutorial-script/0019-alice-charlie-fixup2.ed
index f1aadb4..5d531de 100644
--- a/Documentation/tutorial-script/0019-alice-charlie-fixup2.ed
+++ b/Documentation/tutorial-script/0019-alice-charlie-fixup2.ed
@@ -1,5 +1,5 @@
-/^<<<<<<< rpn\.c/,/^=======/d
-/^>>>>>>> \.merge_file_/d
+/^<<<<<<< master/,/^=======/d
+/^>>>>>>> charlie/d
 w
 q
 
diff --git a/Documentation/tutorial-script/0021-bob-alice-fixup1.ed b/Documentation/tutorial-script/0021-bob-alice-fixup1.ed
index 2783f73..df703d5 100644
--- a/Documentation/tutorial-script/0021-bob-alice-fixup1.ed
+++ b/Documentation/tutorial-script/0021-bob-alice-fixup1.ed
@@ -1,4 +1,4 @@
-/^<<<<<<< Makefile/,/^=======/d
-/^>>>>>>> \.merge_file_/d
+/^<<<<<<< master/,/^=======/d
+/^>>>>>>> origin/d
 w
 q
diff --git a/Documentation/tutorial-script/0022-bob-alice-fixup2.ed b/Documentation/tutorial-script/0022-bob-alice-fixup2.ed
index 18c90d4..d8c5746 100644
--- a/Documentation/tutorial-script/0022-bob-alice-fixup2.ed
+++ b/Documentation/tutorial-script/0022-bob-alice-fixup2.ed
@@ -1,5 +1,5 @@
 /^#include "stack\.h"/+1d
 /^#include "lexer\.h"/+1,/^#include "stack\.h"/d
-/^<<<<<<< rpn\.c/-1,/^>>>>>>> \.merge_file_/d
+/^<<<<<<< master/-1,/^>>>>>>> origin/d
 w
 q
diff --git a/Documentation/tutorial-script/script.sh b/Documentation/tutorial-script/script.sh
index bc70b77..edcebda 100755
--- a/Documentation/tutorial-script/script.sh
+++ b/Documentation/tutorial-script/script.sh
@@ -120,13 +120,13 @@ cg-update bobswork && should_fail
 # difference between her version and Bob's:
 
 #: ...
-#: <<<<<<< rpn.c
+#: <<<<<<< bob
 #: extern double pop(void);
 #: extern void push(double);
 #: extern void clear(void);
 #: 
 #: =======
-#: >>>>>>> .merge_file_5wCNZT
+#: >>>>>>> bobswork
 #: extern int getsym(void);
 #: ...
  
@@ -216,7 +216,7 @@ cg-merge bob && should_fail
 # Merge fails:
 
 #: ...
-#: <<<<<<< Makefile
+#: <<<<<<< .merge_file_l54ztH
 #:	$(CC) $(CFLAGS) $^ -lm -o $@
 #: =======
 #:	$(CC) $(CFLAGS) $^ -o $@
@@ -235,31 +235,31 @@ cg-merge charlie && should_fail
 # Merge conflicts!
 
 #: ...
-#: <<<<<<< Makefile
-#:         $(CC) $(CFLAGS) $^ -lm -o $@
-#:        
+#: <<<<<<< master
+#:	$(CC) $(CFLAGS) $^ -lm -o $@
+#:	
 #: rpn.o: stack.h
 #: stack.o: stack.h
-#: lexer.o:
+#: lexer.o:	
 #: =======
-#:         $(CC) $(CFLAGS) $^ -o $@
-#:                
+#:	$(CC) $(CFLAGS) $^ -o $@
+#:	
 #: rpn.o lexer.o: lexer.h
-#: 
-#: >>>>>>> .merge_file_huuX9C
+#:	
+#: >>>>>>> charlie
 
 ed Makefile < $TOP/0018-alice-charlie-fixup1.ed
 
 #: ...
-#: <<<<<<< rpn.c
+#: <<<<<<< master
 #: extern int getsym(void);
 #: 
 #: =======
 #: extern double pop(void);
 #: extern void push(double);
 #: extern void clear(void);
-#:
-#: >>>>>> .merge_file_qtv6VA
+#: 
+#: >>>>>>> charlie
 #: ...
 
 ed rpn.c    < $TOP/0019-alice-charlie-fixup2.ed
@@ -273,7 +273,7 @@ cg-add CONTRIBUTORS
 cg-commit -m "Add CONTRIBUTORS"
 
 # Wrong file name...
-git rename CONTRIBUTORS CREDITS
+cg-mv CONTRIBUTORS CREDITS
 cg-commit -m "Rename CONTRIBUTORS to CREDITS"
 
 
@@ -308,6 +308,7 @@ echo "Merge with 0.4" | cg-merge && shou
 # Mishandled stack.h
 ed Makefile < $TOP/0021-bob-alice-fixup1.ed
 ed rpn.c    < $TOP/0022-bob-alice-fixup2.ed
+cp stack.h~master stack.h
 ed stack.h  < $TOP/0023-bob-alice-fixup3.ed
 cg-add stack.h
 

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 3/3] Allow the tutorial script to be run by "make test"
  2006-03-03  1:11 [PATCH 1/3] cg-mv doesn't work with bash 3.1.7 due to excessive quotes Pavel Roskin
  2006-03-03  1:11 ` [PATCH 2/3] Make tutorial-script work with current cogito Pavel Roskin
@ 2006-03-03  1:11 ` Pavel Roskin
  2006-03-03  5:27 ` [PATCH 1/3] cg-mv doesn't work with bash 3.1.7 due to excessive quotes Junio C Hamano
  2 siblings, 0 replies; 8+ messages in thread
From: Pavel Roskin @ 2006-03-03  1:11 UTC (permalink / raw
  To: git, Petr Baudis



Signed-off-by: Pavel Roskin <proski@gnu.org>
---

 Documentation/Makefile                 |    4 ++++
 Documentation/tutorial-script/Makefile |    5 +++++
 Makefile                               |    1 +
 3 files changed, 10 insertions(+), 0 deletions(-)

diff --git a/Documentation/Makefile b/Documentation/Makefile
index 3aad2fb..e5508e8 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -55,7 +55,11 @@ install-html: html
 	$(INSTALL) -m755 -d $(DESTDIR)/$(htmldir)
 	$(INSTALL) $(DOC_HTML) $(DESTDIR)/$(htmldir)
 
+test:
+	make -C tutorial-script test
+
 clean:
+	make -C tutorial-script clean
 	rm -f *.xml *.html *.1 *.7 cg*.txt $(PACKAGE).txt
 
 .PRECIOUS: cg%.txt
diff --git a/Documentation/tutorial-script/Makefile b/Documentation/tutorial-script/Makefile
new file mode 100644
index 0000000..bdf384f
--- /dev/null
+++ b/Documentation/tutorial-script/Makefile
@@ -0,0 +1,5 @@
+test:
+	./script.sh
+
+clean:
+	rm -rf Playground
diff --git a/Makefile b/Makefile
index 994b182..2b53641 100644
--- a/Makefile
+++ b/Makefile
@@ -59,6 +59,7 @@ doc:
 
 test: all
 	$(MAKE) -C t/ all
+	$(MAKE) -C Documentation/ test
 
 
 

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/3] cg-mv doesn't work with bash 3.1.7 due to excessive quotes
  2006-03-03  1:11 [PATCH 1/3] cg-mv doesn't work with bash 3.1.7 due to excessive quotes Pavel Roskin
  2006-03-03  1:11 ` [PATCH 2/3] Make tutorial-script work with current cogito Pavel Roskin
  2006-03-03  1:11 ` [PATCH 3/3] Allow the tutorial script to be run by "make test" Pavel Roskin
@ 2006-03-03  5:27 ` Junio C Hamano
  2006-03-03 14:11   ` Pavel Roskin
  2006-03-03 16:34   ` Josef Weidendorfer
  2 siblings, 2 replies; 8+ messages in thread
From: Junio C Hamano @ 2006-03-03  5:27 UTC (permalink / raw
  To: Pavel Roskin; +Cc: git

Pavel Roskin <proski@gnu.org> writes:

> -	ARGS2["${#ARGS2[@]}"]="$_git_relpath${arg%/}"
> +	ARGS2[${#ARGS2[@]}]="$_git_relpath${arg%/}"

Is this an application bug?  It looks like a workaround for a
bug in the shell...

Not that I care too much either way -- I do not use shell arrays
myself ;-).

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/3] cg-mv doesn't work with bash 3.1.7 due to excessive quotes
  2006-03-03  5:27 ` [PATCH 1/3] cg-mv doesn't work with bash 3.1.7 due to excessive quotes Junio C Hamano
@ 2006-03-03 14:11   ` Pavel Roskin
  2006-03-10 20:48     ` Pavel Roskin
  2006-03-03 16:34   ` Josef Weidendorfer
  1 sibling, 1 reply; 8+ messages in thread
From: Pavel Roskin @ 2006-03-03 14:11 UTC (permalink / raw
  To: Junio C Hamano; +Cc: git

On Thu, 2006-03-02 at 21:27 -0800, Junio C Hamano wrote:
> Pavel Roskin <proski@gnu.org> writes:
> 
> > -	ARGS2["${#ARGS2[@]}"]="$_git_relpath${arg%/}"
> > +	ARGS2[${#ARGS2[@]}]="$_git_relpath${arg%/}"
> 
> Is this an application bug?  It looks like a workaround for a
> bug in the shell...

Indeed, bash 3.00.16 (FC4) is fine with the original cg-mv.  On the
other hand, bash 3.1.7 (FC development) doesn't even like this:

$ arg["0"]=0
bash: "0": syntax error: operand expected (error token is ""0"")

I don't see any relevant information in the NEWS file, so even if it's
no a bug, it's an undocumented feature :-)

Anyway, the quotes are excessive, bash is (sort of) correct to complain
about it, and I don't see any other instances of quoting array arguments
in cogito.

The quotes in question have always existed in cg-mv, they were not added
to work around anything.

-- 
Regards,
Pavel Roskin

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/3] cg-mv doesn't work with bash 3.1.7 due to excessive quotes
  2006-03-03  5:27 ` [PATCH 1/3] cg-mv doesn't work with bash 3.1.7 due to excessive quotes Junio C Hamano
  2006-03-03 14:11   ` Pavel Roskin
@ 2006-03-03 16:34   ` Josef Weidendorfer
  1 sibling, 0 replies; 8+ messages in thread
From: Josef Weidendorfer @ 2006-03-03 16:34 UTC (permalink / raw
  To: Junio C Hamano; +Cc: Pavel Roskin, git, Petr Baudis

On Friday 03 March 2006 06:27, you wrote:
> Pavel Roskin <proski@gnu.org> writes:
> 
> > -	ARGS2["${#ARGS2[@]}"]="$_git_relpath${arg%/}"
> > +	ARGS2[${#ARGS2[@]}]="$_git_relpath${arg%/}"
> 
> Is this an application bug?  It looks like a workaround for a
> bug in the shell...

This line in cg-mv is needed to work around at least two
bugs in git-mv:
* "git-mv a/ b/" not working.
  Fix was to strip all trailing slashes of args (fixed in 1.2.4)
* "cd subdir; git-mv ../file ."
  Fix is to run git-mv from base directory (see separate patch for git-mv)
I think cg-mv should be able to be a direct wrapper for git-mv with
the next maintenance release.

Pasky: do you know of other problems with git-mv?

Josef

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/3] cg-mv doesn't work with bash 3.1.7 due to excessive quotes
  2006-03-03 14:11   ` Pavel Roskin
@ 2006-03-10 20:48     ` Pavel Roskin
  0 siblings, 0 replies; 8+ messages in thread
From: Pavel Roskin @ 2006-03-10 20:48 UTC (permalink / raw
  To: Petr Baudis; +Cc: git

Hello, Petr!

On Fri, 2006-03-03 at 09:11 -0500, Pavel Roskin wrote:
> On Thu, 2006-03-02 at 21:27 -0800, Junio C Hamano wrote:
> > Pavel Roskin <proski@gnu.org> writes:
> > 
> > > -	ARGS2["${#ARGS2[@]}"]="$_git_relpath${arg%/}"
> > > +	ARGS2[${#ARGS2[@]}]="$_git_relpath${arg%/}"

Any issues with this patch?  FC5 is due in a week.  Expect and outcry
from the new bash 3.1.7 users if the fixed cogito is not available
shortly.

Bash is not as wrong as it may seem.  Left hand side in assignments is
already a special case in earlier versions of bash, just not in the
index:

bash 3.00.16 (FC4)
$ f"oo"=bar
bash: foo=bar: command not found
$ foo["0"]=bar
$

bash 3.1.7 (FC5)
$ f"oo"=bar
bash: foo=bar: command not found
$ foo["0"]=bar
bash: "0": syntax error: operand expected (error token is ""0"")
$

-- 
Regards,
Pavel Roskin

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 2/3] Make tutorial-script work with current cogito
  2006-03-03  1:11 ` [PATCH 2/3] Make tutorial-script work with current cogito Pavel Roskin
@ 2006-03-19 22:37   ` Petr Baudis
  0 siblings, 0 replies; 8+ messages in thread
From: Petr Baudis @ 2006-03-19 22:37 UTC (permalink / raw
  To: Pavel Roskin; +Cc: git

Dear diary, on Fri, Mar 03, 2006 at 02:11:57AM CET, I got a letter
where Pavel Roskin <proski@gnu.org> said that...
> Labels on merge conflict lines have changed.  There is no "git rename",
> use cg-mv instead.  In one case stack.h is not created, so copy
> stack.h~master to stack.h before fixing it.
> 
> Also fix comments in script.sh to use the new labels.
> 
> Signed-off-by: Pavel Roskin <proski@gnu.org>

Whoops, overlooked this and already fixed it on my own. Thanks anyway.

> @@ -308,6 +308,7 @@ echo "Merge with 0.4" | cg-merge && shou
>  # Mishandled stack.h
>  ed Makefile < $TOP/0021-bob-alice-fixup1.ed
>  ed rpn.c    < $TOP/0022-bob-alice-fixup2.ed
> +cp stack.h~master stack.h
>  ed stack.h  < $TOP/0023-bob-alice-fixup3.ed
>  cg-add stack.h

Isn't it enough to just kill ~master and move ~origin there, though?

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Right now I am having amnesia and deja-vu at the same time.  I think
I have forgotten this before.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2006-03-19 22:36 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-03-03  1:11 [PATCH 1/3] cg-mv doesn't work with bash 3.1.7 due to excessive quotes Pavel Roskin
2006-03-03  1:11 ` [PATCH 2/3] Make tutorial-script work with current cogito Pavel Roskin
2006-03-19 22:37   ` Petr Baudis
2006-03-03  1:11 ` [PATCH 3/3] Allow the tutorial script to be run by "make test" Pavel Roskin
2006-03-03  5:27 ` [PATCH 1/3] cg-mv doesn't work with bash 3.1.7 due to excessive quotes Junio C Hamano
2006-03-03 14:11   ` Pavel Roskin
2006-03-10 20:48     ` Pavel Roskin
2006-03-03 16:34   ` Josef Weidendorfer

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).