Code

git-merge: warn when -m provided on a fast forward
authorJ. Bruce Fields <bfields@fieldses.org>
Sun, 11 Mar 2007 16:28:56 +0000 (12:28 -0400)
committerJunio C Hamano <junkio@cox.net>
Mon, 12 Mar 2007 06:49:20 +0000 (23:49 -0700)
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>
git-merge.sh

index 4afcd95316c01e5d1811184c615c4da574ab0717..6ce62c860a3732e1239e216fb7492a126216be67 100755 (executable)
@@ -294,7 +294,12 @@ f,*)
        git-update-index --refresh 2>/dev/null
        new_head=$(git-rev-parse --verify "$1^0") &&
        git-read-tree -v -m -u --exclude-per-directory=.gitignore $head "$new_head" &&
-       finish "$new_head" "Fast forward" || exit
+       msg="Fast forward"
+       if test -n "$have_message"
+       then
+               msg="$msg (no commit created; -m option ignored)"
+       fi
+       finish "$new_head" "$msg" || exit
        dropsave
        exit 0
        ;;