@matheusbsbs / matheus-bagliano / commits / 8cc01e5019
Fork 0

[PATCH] More descriptive messages for conflict cases in merges

The merge strategies can give more descriptive error messages for conflict cases if they are given the actual branch names instead of the SHA1s. Signed-off-by: Fredrik Kuivinen <freku045@student.liu.se> Signed-off-by: Junio C Hamano <junkio@cox.net>

Fredrik Kuivinen committed Sep 25, 2005 at 16:49 UTC 8cc01e5019e0dc9a86bba4cba414b46627fe0424
1 file changed +4 -3
git-merge.sh
+4 -3
@@ -71,6 +71,7 @@ test "$#" -le 2 && usage ;# we need at least two heads.
71
72 merge_msg="$1"
73 shift
74 +head_arg="$1"
75 head=$(git-rev-parse --verify "$1"^0) || usage
76 shift
77
@@ -86,7 +87,7 @@ echo "$head" >"$GIT_DIR/ORIG_HEAD"
87
88 case "$#,$common" in
89 *,'')
89 - die "Unable to find common commit between $head and $*"
90 + die "Unable to find common commit between $head_arg and $*"
91 ;;
92 1,"$1")
93 # If head can reach all the merge then we are up to date.
@@ -147,7 +148,7 @@ do
148 }
149 echo "Trying merge strategy $strategy..."
150 wt_strategy=$strategy
150 - git-merge-$strategy $common -- $head "$@" || {
151 + git-merge-$strategy $common -- $head_arg "$@" || {
152
153 # The backend exits with 1 when conflicts are left to be resolved,
154 # with 2 when it does not handle the given merge at all.
@@ -202,7 +203,7 @@ case "$best_strategy" in
203 echo "Rewinding the tree to pristine..."
204 git reset --hard $head
205 echo "Using the $best_strategy to prepare resolving by hand."
205 - git-merge-$best_strategy $common -- $head "$@"
206 + git-merge-$best_strategy $common -- $head_arg "$@"
207 ;;
208 esac
209 for remote