summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: aec7b36)
raw | patch | inline | side by side (parent: aec7b36)
author | Lars Hjemli <hjemli@gmail.com> | |
Sun, 23 Sep 2007 22:51:44 +0000 (00:51 +0200) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 24 Sep 2007 00:14:03 +0000 (17:14 -0700) |
These options can be used to override --no-commit and --squash, which is
needed since --no-commit and --squash now can be specified as default merge
options in $GIT_DIR/config.
The change also introduces slightly different behavior for --no-commit:
when specified, it explicitly overrides --squash. Earlier,
'git merge --squash --no-commit' would result in a squashed merge (i.e. no
$GIT_DIR/MERGE_HEAD was created) but with this patch the command will
behave as if --squash hadn't been specified.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
needed since --no-commit and --squash now can be specified as default merge
options in $GIT_DIR/config.
The change also introduces slightly different behavior for --no-commit:
when specified, it explicitly overrides --squash. Earlier,
'git merge --squash --no-commit' would result in a squashed merge (i.e. no
$GIT_DIR/MERGE_HEAD was created) but with this patch the command will
behave as if --squash hadn't been specified.
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/merge-options.txt | patch | blob | history | |
git-merge.sh | patch | blob | history | |
t/t7600-merge.sh | patch | blob | history |
index d64c259bb35d3140b371e8717a2553146d3f92f5..0464a346450437493effa497757582c19bb0a5dd 100644 (file)
not autocommit, to give the user a chance to inspect and
further tweak the merge result before committing.
+--commit::
+ Perform the merge and commit the result. This option can
+ be used to override --no-commit.
+
--squash::
Produce the working tree and index state as if a real
merge happened, but do not actually make a commit or
top of the current branch whose effect is the same as
merging another branch (or more in case of an octopus).
+--no-squash::
+ Perform the merge and commit the result. This option can
+ be used to override --squash.
+
-s <strategy>, \--strategy=<strategy>::
Use the given merge strategy; can be supplied more than
once to specify them in the order they should be tried.
diff --git a/git-merge.sh b/git-merge.sh
index a35b15157bd2838175e8400e67ca272b39b8e921..a0fc60602a512c05159e1665fb812941ab020606 100755 (executable)
--- a/git-merge.sh
+++ b/git-merge.sh
# Copyright (c) 2005 Junio C Hamano
#
-USAGE='[-n] [--summary] [--no-commit] [--squash] [-s <strategy>] [-m=<merge-message>] <commit>+'
+USAGE='[-n] [--summary] [--[no-]commit] [--[no-]squash] [-s <strategy>] [-m=<merge-message>] <commit>+'
SUBDIRECTORY_OK=Yes
. git-sh-setup
show_diffstat=t ;;
--sq|--squ|--squa|--squas|--squash)
squash=t no_commit=t ;;
+ --no-sq|--no-squ|--no-squa|--no-squas|--no-squash)
+ squash= no_commit= ;;
+ --c|--co|--com|--comm|--commi|--commit)
+ squash= no_commit= ;;
--no-c|--no-co|--no-com|--no-comm|--no-commi|--no-commit)
- no_commit=t ;;
+ squash= no_commit=t ;;
-s=*|--s=*|--st=*|--str=*|--stra=*|--strat=*|--strate=*|\
--strateg=*|--strategy=*|\
-s|--s|--st|--str|--stra|--strat|--strate|--strateg|--strategy)
diff --git a/t/t7600-merge.sh b/t/t7600-merge.sh
index 110974cd01ad0fa613eb50555af6e547dabb1f49..b0ef488c2955f9c5d267d8dc1311614fce4cbf3f 100755 (executable)
--- a/t/t7600-merge.sh
+++ b/t/t7600-merge.sh
test_debug 'gitk --all'
+test_expect_success 'merge c1 with c2 (override --no-commit)' '
+ git reset --hard c1 &&
+ git config branch.master.mergeoptions "--no-commit" &&
+ test_tick &&
+ git merge --commit c2 &&
+ verify_merge file result.1-5 msg.1-5 &&
+ verify_parents $c1 $c2
+'
+
+test_debug 'gitk --all'
+
+test_expect_success 'merge c1 with c2 (override --squash)' '
+ git reset --hard c1 &&
+ git config branch.master.mergeoptions "--squash" &&
+ test_tick &&
+ git merge --no-squash c2 &&
+ verify_merge file result.1-5 msg.1-5 &&
+ verify_parents $c1 $c2
+'
+
+test_debug 'gitk --all'
+
test_done