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>
This commit is contained in:

committed by
Junio C Hamano

parent
d38eb710d9
commit
aec7b362ad
21
git-merge.sh
21
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 $#
|
||||
|
Reference in New Issue
Block a user