[PATCH 1/3] cg-mv doesn't work with bash 3.1.7 due to excessive quotes

Subsystems: the rest

STALE3712d

4 messages, 2 authors, 2016-06-15 · open the first message on its own page

[PATCH 1/3] cg-mv doesn't work with bash 3.1.7 due to excessive quotes

From: Pavel Roskin <hidden>
Date: 2016-06-15 22:42:20


Signed-off-by: Pavel Roskin <redacted>
---

 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[@]}"

[PATCH 3/3] Allow the tutorial script to be run by "make test"

From: Pavel Roskin <hidden>
Date: 2016-06-15 22:42:20


Signed-off-by: Pavel Roskin <redacted>
---

 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
 
 
 

[PATCH 2/3] Make tutorial-script work with current cogito

From: Pavel Roskin <hidden>
Date: 2016-06-15 22:42:20

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 <redacted>
---

 .../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
 

Re: [PATCH 2/3] Make tutorial-script work with current cogito

From: Petr Baudis <hidden>
Date: 2016-06-15 22:42:21

Dear diary, on Fri, Mar 03, 2006 at 02:11:57AM CET, I got a letter
where Pavel Roskin [off-list ref] 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 <redacted>
Whoops, overlooked this and already fixed it on my own. Thanks anyway.
quoted hunk
@@ -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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help