@matheusbsbs / matheus-bagliano / commits / be242d576c
Fork 0

git-merge: warn when -m provided on a fast forward

Warn the user that the "-m" option is ignored in the case of a fast forward. That may save some confusion in the case where the user doesn't know about fast forwards yet and may not realize that the behavior here is intentional. Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu> Signed-off-by: Junio C Hamano <junkio@cox.net>

J. Bruce Fields committed Mar 11, 2007 at 12:28 UTC be242d576c4457bec1cb748b144eb287e98ac0b5
1 file changed +6 -1
git-merge.sh
+6 -1
@@ -294,7 +294,12 @@ f,*)
294 git-update-index --refresh 2>/dev/null
295 new_head=$(git-rev-parse --verify "$1^0") &&
296 git-read-tree -v -m -u --exclude-per-directory=.gitignore $head "$new_head" &&
297 - finish "$new_head" "Fast forward" || exit
297 + msg="Fast forward"
298 + if test -n "$have_message"
299 + then
300 + msg="$msg (no commit created; -m option ignored)"
301 + fi
302 + finish "$new_head" "$msg" || exit
303 dropsave
304 exit 0
305 ;;