git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Clean up after failed "git merge" in the tutorial script

From
PRPavel Roskin <proski@gnu.org>
Date
Mar 22, 2006, 04:07 UTC
Message-ID
<20060322040733.29189.75397.stgit@dv.roinet.com>
From: Pavel Roskin <proski@gnu.org>

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

Signed-off-by: Pavel Roskin <proski@gnu.org>
---
 .../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(-)
diff --git a/Documentation/tutorial-script/0017-alice-bob-fixup.ed b/Documentation/tutorial-script/0017-alice-bob-fixup.ed
index ad04eb7..1b06f4e 100644
--- a/Documentation/tutorial-script/0017-alice-bob-fixup.ed
+++ b/Documentation/tutorial-script/0017-alice-bob-fixup.ed
@@ -1,5 +1,5 @@
-/^<<<<<<< Makefile/d
+/^<<<<<<< master/d
 /^=======/,/^=======/+1d
-/^>>>>>>> \.merge_file_/d
+/^>>>>>>> bob/d
 w
 q
diff --git a/Documentation/tutorial-script/0021-bob-alice-fixup1.ed b/Documentation/tutorial-script/0021-bob-alice-fixup1.ed
deleted file mode 100644
index df703d5..0000000
--- a/Documentation/tutorial-script/0021-bob-alice-fixup1.ed
+++ /dev/null
@@ -1,4 +0,0 @@
-/^<<<<<<< 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
deleted file mode 100644
index d8c5746..0000000
--- a/Documentation/tutorial-script/0022-bob-alice-fixup2.ed
+++ /dev/null
@@ -1,5 +0,0 @@
-/^#include "stack\.h"/+1d
-/^#include "lexer\.h"/+1,/^#include "stack\.h"/d
-/^<<<<<<< master/-1,/^>>>>>>> origin/d
-w
-q
diff --git a/Documentation/tutorial-script/0023-bob-alice-fixup3.ed b/Documentation/tutorial-script/0023-bob-alice-fixup3.ed
deleted file mode 100644
index fea2fc7..0000000
--- a/Documentation/tutorial-script/0023-bob-alice-fixup3.ed
+++ /dev/null
@@ -1,4 +0,0 @@
-/^#endif/s;^#endif.*;#endif /* STACK_H */;
-w
-q
-
diff --git a/Documentation/tutorial-script/script.sh b/Documentation/tutorial-script/script.sh
index 0401954..f07dfc1 100755
--- a/Documentation/tutorial-script/script.sh
+++ b/Documentation/tutorial-script/script.sh
@@ -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
Message 1 of 1 in “Clean up after failed "git merge" in the tutorial script”
  1. Clean up after failed "git merge" in the tutorial scriptPavel Roskin, Mar 22, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.