From: Junio C Hamano Date: Thu, 27 Feb 2014 22:01:11 +0000 (-0800) Subject: Merge branch 'da/pull-ff-configuration' X-Git-Tag: v2.0.0-rc0~165 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/7da5fd6895af9066ad4684e333c57f4086589c2f?ds=inline;hp=-c Merge branch 'da/pull-ff-configuration' "git pull" learned to pay attention to pull.ff configuration variable. * da/pull-ff-configuration: pull: add --ff-only to the help text pull: add pull.ff configuration --- 7da5fd6895af9066ad4684e333c57f4086589c2f diff --combined Documentation/config.txt index a23392ca6a,7443f15bf4..7eec746950 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@@ -567,10 -567,6 +567,10 @@@ be passed to the shell by Git, which wi command to `LESS=FRSX less -+S`. The environment tells the command to set the `S` option to chop long lines but the command line resets it to the default to fold long lines. ++ +Likewise, when the `LV` environment variable is unset, Git sets it +to `-c`. You can override this setting by exporting `LV` with +another value or setting `core.pager` to `lv +c`. core.whitespace:: A comma separated list of common whitespace problems to @@@ -992,14 -988,6 +992,14 @@@ commit.cleanup: have to remove the help lines that begin with `#` in the commit log template yourself, if you do this). +commit.gpgsign:: + + A boolean to specify whether all commits should be GPG signed. + Use of this option when doing operations such as rebase can + result in a large number of commits being signed. It may be + convenient to use an agent to avoid typing your GPG passphrase + several times. + commit.status:: A boolean to enable/disable inclusion of status information in the commit message template when using an editor to prepare the commit @@@ -1889,6 -1877,16 +1889,16 @@@ pretty.: Note that an alias with the same name as a built-in format will be silently ignored. + pull.ff:: + By default, Git does not create an extra merge commit when merging + a commit that is a descendant of the current commit. Instead, the + tip of the current branch is fast-forwarded. When set to `false`, + this variable tells Git to create an extra merge commit in such + a case (equivalent to giving the `--no-ff` option from the command + line). When set to `only`, only such fast-forward merges are + allowed (equivalent to giving the `--ff-only` option from the + command line). + pull.rebase:: When true, rebase branches on top of the fetched branch, instead of merging the default branch from the default remote when "git @@@ -2038,10 -2036,6 +2048,10 @@@ receive.updateserverinfo: If set to true, git-receive-pack will run git-update-server-info after receiving data from git-push and updating refs. +receive.shallowupdate:: + If set to true, .git/shallow can be updated when new refs + require new shallow roots. Otherwise those refs are rejected. + remote.pushdefault:: The remote to push to by default. Overrides `branch..remote` for all branches, and is overridden by @@@ -2103,8 -2097,8 +2113,8 @@@ remote..vcs: remote..prune:: When set to true, fetching from this remote by default will also - remove any remote-tracking branches which no longer exist on the - remote (as if the `--prune` option was give on the command line). + remove any remote-tracking references that no longer exist on the + remote (as if the `--prune` option was given on the command line). Overrides `fetch.prune` settings, if any. remotes.:: diff --combined git-pull.sh index 0a5aa2c821,d17a461b3d..def7cc0e23 --- a/git-pull.sh +++ b/git-pull.sh @@@ -4,7 -4,7 +4,7 @@@ # # Fetch one or more remote refs and merge it/them into the current HEAD. - USAGE='[-n | --no-stat] [--[no-]commit] [--[no-]squash] [--[no-]ff] [--[no-]rebase|--rebase=preserve] [-s strategy]... [] ...' + USAGE='[-n | --no-stat] [--[no-]commit] [--[no-]squash] [--[no-]ff|--ff-only] [--[no-]rebase|--rebase=preserve] [-s strategy]... [] ...' LONG_USAGE='Fetch one or more remote refs and integrate it/them with the current HEAD.' SUBDIRECTORY_OK=Yes OPTIONS_SPEC= @@@ -52,6 -52,21 +52,21 @@@ if test -z "$rebase then rebase=$(bool_or_string_config pull.rebase) fi + + # Setup default fast-forward options via `pull.ff` + pull_ff=$(git config pull.ff) + case "$pull_ff" in + false) + no_ff=--no-ff + break + ;; + only) + ff_only=--ff-only + break + ;; + esac + + dry_run= while : do @@@ -172,7 -187,7 +187,7 @@@ error_on_no_merge_candidates () do case "$opt" in -t|--t|--ta|--tag|--tags) - echo "Fetching tags only, you probably meant:" + echo "It doesn't make sense to pull all tags; you probably meant:" echo " git fetch --tags" exit 1 esac @@@ -229,7 -244,15 +244,7 @@@ test true = "$rebase" && test -n "$curr_branch" && . git-parse-remote && remoteref="$(get_remote_merge_branch "$@" 2>/dev/null)" && - oldremoteref="$(git rev-parse -q --verify "$remoteref")" && - for reflog in $(git rev-list -g $remoteref 2>/dev/null) - do - if test "$reflog" = "$(git merge-base $reflog $curr_branch)" - then - oldremoteref="$reflog" - break - fi - done + oldremoteref=$(git merge-base --fork-point "$remoteref" $curr_branch 2>/dev/null) } orig_head=$(git rev-parse -q --verify HEAD) git fetch $verbosity $progress $dry_run $recurse_submodules --update-head-ok "$@" || exit 1