Skip to contentSkip to conversation

Improve error message in rebase conflict

PATCH In review Ramkumar Ramachandra 2 participants 3 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Improve error message in rebase conflict

When the index is unchanged during a rebase conflict resolution, prompt the user to "git add", or alternatively drop the patch using "git rebase --skip".

---
 git-am.sh     |    4 +++-
 git-rebase.sh |    4 ++--
 2 files changed, 5 insertions(+), 3 deletions(-)
git-am.sh +3 -1
index 87ffae2..3c46f60 100755
@@ -725,7 +725,9 @@ do
 		# working tree.
 		resolved=
 		git diff-index --quiet --cached HEAD -- && {
-			echo "No changes - did you forget to use 'git add'?"
+			echo "No changes - did you forget to use 'git add'? " \
+				"If you dropped the changes introduced by the patch, " \
+				"you should use \"$cmdline --skip\"."
 			stop_here_user_resolve $this
 		}
 		unmerged=$(git ls-files -u)
git-rebase.sh +2 -2
index 44f5c65..60cc0e9 100755
@@ -217,8 +217,8 @@ do
 			die "No rebase in progress?"
 
 		git diff-files --quiet --ignore-submodules || {
-			echo "You must edit all merge conflicts and then"
-			echo "mark them as resolved using git add"
+			echo "You must edit all merge conflicts and then" \
+			    "mark them as resolved using 'git add'"
 			exit 1
 		}
 		if test -d "$dotest"
Signature · 1 line
1.7.1
#1 lore raw

Heya,

Quoted 5 lines · Ramkumar Ramachandra

               git diff-files --quiet --ignore-submodules || {
-                       echo "You must edit all merge conflicts and then"
-                       echo "mark them as resolved using git add"
+                       echo "You must edit all merge conflicts and then" \
+                           "mark them as resolved using 'git add'"

Why is this change not described in the commit message? :)

Signature · 3 lines
Cheers,

Sverre Rabbelier
#2 lore raw

Hi,

Quoted 1 line · Sverre Rabbelier

Why is this change not described in the commit message? :)

I thought it was too trivial to describe. Anyway, here's one:
++ Additionally, fix a line break in a message in git-rebase.sh

-- Ram