summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d9a680a)
raw | patch | inline | side by side (parent: d9a680a)
author | Jonathan Nieder <jrnieder@gmail.com> | |
Tue, 17 Aug 2010 07:10:17 +0000 (02:10 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 18 Aug 2010 21:02:05 +0000 (14:02 -0700) |
Port v1.6.6-rc0~62^2 (Teach 'git merge' and 'git pull' the option
--ff-only, 2009-10-29) to the old merge script.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
--ff-only, 2009-10-29) to the old merge script.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/examples/git-merge.sh | patch | blob | history |
index 410fa3c815680c3f9894b82bfa43545da91c75cb..dfd6e17946946825ad7a486e90d35a9f310020e6 100755 (executable)
squash create a single commit instead of doing a merge
commit perform a commit if the merge succeeds (default)
ff allow fast-forward (default)
+ff-only abort if fast-forward is not possible
s,strategy= merge strategy to use
X= option for selected merge strategy
m,message= message to be used for the merge commit (if any)
xopt=
allow_fast_forward=t
+fast_forward_only=
allow_trivial_merge=t
squash= no_commit= log_arg=
--no-ff)
test "$squash" != t ||
die "You cannot combine --squash with --no-ff."
+ test "$fast_forward_only" != t ||
+ die "You cannot combine --ff-only with --no-ff."
allow_fast_forward=f ;;
+ --ff-only)
+ test "$allow_fast_forward" != f ||
+ die "You cannot combine --ff-only with --no-ff."
+ fast_forward_only=t ;;
-s|--strategy)
shift
case " $all_strategies " in
# We are not doing octopus, not fast-forward, and have only
# one common.
git update-index --refresh 2>/dev/null
- case "$allow_trivial_merge" in
- t)
+ case "$allow_trivial_merge,$fast_forward_only" in
+ t,)
# See if it is really trivial.
git var GIT_COMMITTER_IDENT >/dev/null || exit
echo "Trying really trivial in-index merge..."
;;
esac
+if test "$fast_forward_only" = t
+then
+ die "Not possible to fast-forward, aborting."
+fi
+
# We are going to make a new commit.
git var GIT_COMMITTER_IDENT >/dev/null || exit