summaryrefslogtreecommitdiff
path: root/git-merge.sh
diff options
context:
space:
mode:
authorLars Hjemli <hjemli@gmail.com>2007-09-24 00:51:43 +0200
committerJunio C Hamano <gitster@pobox.com>2007-09-23 17:14:03 -0700
commitaec7b362ad07e1a2c58051c8db653dabffee8960 (patch)
tree2c1a5325238be00cbccc71c32e8ab50483a4a3d2 /git-merge.sh
parentd38eb710d92864b0b1f7cd36f17e273e3d8c735c (diff)
downloadgit-aec7b362ad07e1a2c58051c8db653dabffee8960.tar.gz
git-merge: add support for branch.<name>.mergeoptions
This enables per branch configuration of merge options. Currently, the most useful options to specify per branch are --squash, --summary/--no-summary and possibly --strategy, but all options are supported. Note: Options containing whitespace will _not_ be handled correctly. Luckily, the only option which can include whitespace is --message and it doesn't make much sense to give that option a default value. Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-merge.sh')
-rwxr-xr-xgit-merge.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/git-merge.sh b/git-merge.sh
index 49185eb5d2..a35b15157b 100755
--- a/git-merge.sh
+++ b/git-merge.sh
@@ -168,9 +168,30 @@ parse_option () {
args_left=$#
}
+parse_config () {
+ while test $# -gt 0
+ do
+ parse_option "$@" || usage
+ while test $args_left -lt $#
+ do
+ shift
+ done
+ done
+}
+
test $# != 0 || usage
have_message=
+
+if branch=$(git-symbolic-ref -q HEAD)
+then
+ mergeopts=$(git config "branch.${branch#refs/heads/}.mergeoptions")
+ if test -n "$mergeopts"
+ then
+ parse_config $mergeopts
+ fi
+fi
+
while parse_option "$@"
do
while test $args_left -lt $#