path: root/
diff options
authorGerrit Pape <>2008-03-03 09:22:03 (GMT)
committerJunio C Hamano <>2008-03-03 21:38:30 (GMT)
commite6d1f76ccf9de037c5479acdd9b6211e80145142 (patch)
tree4d76faa0fca57f3a3809ff9457fb34abdf762458 /
parentf23d1f76273a59b030ea1028016e6a9fc9679d2c (diff)
git-e6d1f76ccf9de037c5479acdd9b6211e80145142.tar.bz2 better handling of combined --squash,--no-ff,--no-commit options
git-merge used to use either the --squash,--no-squash, --no-ff,--ff, --no-commit,--commit option, whichever came last in the command line. This lead to some un-intuitive behavior, having git merge --no-commit --no-ff <branch> actually commit the merge. Now git-merge respects --no-commit together with --no-ff, as well as other combinations of the options. However, this broke a selftest in t/ which expected to have --no-ff completely override the --squash option, so that git merge --squash --no-ff <branch> fast-forwards, and makes a merge commit; combining --squash with --no-ff doesn't really make sense though, and is now refused by git-merge. The test is adapted to test --no-ff without the preceding --squash, and another test is added to make sure the --squash --no-ff combination is refused. The unexpected behavior was reported by John Goerzen through Signed-off-by: Gerrit Pape <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to '')
1 files changed, 11 insertions, 6 deletions
diff --git a/ b/
index 1c123a3..03cd398 100755
--- a/
+++ b/
@@ -37,6 +37,7 @@ use_strategies=
+squash= no_commit=
dropsave() {
@@ -152,17 +153,21 @@ parse_config () {
show_diffstat=t ;;
- allow_fast_forward=t squash=t no_commit=t ;;
+ test "$allow_fast_forward" = t ||
+ die "You cannot combine --squash with --no-ff."
+ squash=t no_commit=t ;;
- allow_fast_forward=t squash= no_commit= ;;
+ squash= no_commit= ;;
- allow_fast_forward=t squash= no_commit= ;;
+ no_commit= ;;
- allow_fast_forward=t squash= no_commit=t ;;
+ no_commit=t ;;
- allow_fast_forward=t squash= no_commit= ;;
+ allow_fast_forward=t ;;
- allow_fast_forward=false squash= no_commit= ;;
+ test "$squash" != t ||
+ die "You cannot combine --squash with --no-ff."
+ allow_fast_forward=f ;;
case " $all_strategies " in