Skip to content

Commit 5072a32

Browse files
hjemligitster
authored andcommitted
Teach git-pull about --[no-]ff, --no-squash and --commit
These options are supported by git-merge, but git-pull didn't know about them. Signed-off-by: Lars Hjemli <hjemli@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent e2b7eaf commit 5072a32

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

git-pull.sh

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Fetch one or more remote refs and merge it/them into the current HEAD.
66

7-
USAGE='[-n | --no-summary] [--no-commit] [-s strategy]... [<fetch-options>] <repo> <head>...'
7+
USAGE='[-n | --no-summary] [--[no-]commit] [--[no-]squash] [--[no-]ff] [-s strategy]... [<fetch-options>] <repo> <head>...'
88
LONG_USAGE='Fetch one or more remote refs and merge it/them into the current HEAD.'
99
SUBDIRECTORY_OK=Yes
1010
. git-sh-setup
@@ -15,7 +15,7 @@ cd_to_toplevel
1515
test -z "$(git ls-files -u)" ||
1616
die "You are in the middle of a conflicted merge."
1717

18-
strategy_args= no_summary= no_commit= squash=
18+
strategy_args= no_summary= no_commit= squash= no_ff=
1919
while :
2020
do
2121
case "$1" in
@@ -27,8 +27,16 @@ do
2727
;;
2828
--no-c|--no-co|--no-com|--no-comm|--no-commi|--no-commit)
2929
no_commit=--no-commit ;;
30+
--c|--co|--com|--comm|--commi|--commit)
31+
no_commit=--commit ;;
3032
--sq|--squ|--squa|--squas|--squash)
3133
squash=--squash ;;
34+
--no-sq|--no-squ|--no-squa|--no-squas|--no-squash)
35+
squash=--no-squash ;;
36+
--ff)
37+
no_ff=--ff ;;
38+
--no-ff)
39+
no_ff=--no-ff ;;
3240
-s=*|--s=*|--st=*|--str=*|--stra=*|--strat=*|--strate=*|\
3341
--strateg=*|--strategy=*|\
3442
-s|--s|--st|--str|--stra|--strat|--strate|--strateg|--strategy)
@@ -133,5 +141,5 @@ then
133141
fi
134142

135143
merge_name=$(git fmt-merge-msg <"$GIT_DIR/FETCH_HEAD") || exit
136-
exec git-merge $no_summary $no_commit $squash $strategy_args \
144+
exec git-merge $no_summary $no_commit $squash $no_ff $strategy_args \
137145
"$merge_name" HEAD $merge_head

0 commit comments

Comments
 (0)