Skip to contentSkip to conversation

Clean up after failed "git merge" in the tutorial script

PATCH New Pavel Roskin 1 participant 1 message Jun 15, 2016 Documentation

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Clean up after failed "git merge" in the tutorial script

From: Pavel Roskin <[email protected]>

Failed "git merge" in the tutorial script leaves some damage to the working directory. Use cg-reset to clean up the mess.

This eliminates conflicts in the final merge. Adjust code accordingly, remove unused fixup scripts.

Adjust 0017-alice-bob-fixup.ed to deal with merge conflict from cg-merge rather than "git merge".

---

 .../tutorial-script/0017-alice-bob-fixup.ed        |    4 ++--
 .../tutorial-script/0021-bob-alice-fixup1.ed       |    4 ----
 .../tutorial-script/0022-bob-alice-fixup2.ed       |    5 -----
 .../tutorial-script/0023-bob-alice-fixup3.ed       |    4 ----
 Documentation/tutorial-script/script.sh            |   18 ++++--------------
 5 files changed, 6 insertions(+), 29 deletions(-)
Documentation/tutorial-script/0017-alice-bob-fixup.ed +2 -2
index ad04eb7..1b06f4e 100644
@@ -1,5 +1,5 @@
-/^<<<<<<< Makefile/d
+/^<<<<<<< master/d
 /^=======/,/^=======/+1d
-/^>>>>>>> \.merge_file_/d
+/^>>>>>>> bob/d
 w
 q
Documentation/tutorial-script/0021-bob-alice-fixup1.ed deleted +0 -4
deleted file mode 100644
index df703d5..0000000
@@ -1,4 +0,0 @@
-/^<<<<<<< master/,/^=======/d
-/^>>>>>>> origin/d
-w
-q
Documentation/tutorial-script/0022-bob-alice-fixup2.ed deleted +0 -5
deleted file mode 100644
index d8c5746..0000000
@@ -1,5 +0,0 @@
-/^#include "stack\.h"/+1d
-/^#include "lexer\.h"/+1,/^#include "stack\.h"/d
-/^<<<<<<< master/-1,/^>>>>>>> origin/d
-w
-q
Documentation/tutorial-script/0023-bob-alice-fixup3.ed deleted +0 -4
deleted file mode 100644
index fea2fc7..0000000
@@ -1,4 +0,0 @@
-/^#endif/s;^#endif.*;#endif /* STACK_H */;
-w
-q
-
Documentation/tutorial-script/script.sh +4 -14
index 0401954..f07dfc1 100755
@@ -222,12 +222,13 @@ git merge "Integrate changes from Bob an
 
 # Automatic 3-way merge fails! Have to do it step by step
 
+cg-reset
 cg-merge bob && should_fail
 
 # Merge fails:
 
 #: ...
-#: <<<<<<< Makefile
+#: <<<<<<< master
 #:	$(CC) $(CFLAGS) $^ -lm -o $@
 #: =======
 #:	$(CC) $(CFLAGS) $^ -o $@
@@ -235,7 +236,7 @@ cg-merge bob && should_fail
 #: rpn.o: stack.h
 #: stack.o: stack.h
 #: lexer.o:	
-#: >>>>>>> .merge_file_iNhznP
+#: >>>>>>> bob
 
 ed Makefile < $TOP/0017-alice-bob-fixup.ed
 
@@ -313,18 +314,7 @@ cg-fetch
 git verify-tag rpn-0.4 && should_fail
 
 # Everything's OK, integrate the changes
-echo "Merge with 0.4" | cg-merge && should_fail
-
-# Merge conflicts in Makefile, rpn.c
-ed Makefile < $TOP/0021-bob-alice-fixup1.ed
-ed rpn.c    < $TOP/0022-bob-alice-fixup2.ed
-# Resolve conflicting addition of two versions of stack.h
-rm stack.h~master
-mv stack.h~origin stack.h
-cg-add stack.h
-
-# Now commit the whole
-cg-commit -m "Merge with 0.4"
+cg-merge
 
 # Great, we are done.
 trap - exit