Merge branch 'ab/pull-rebase-config'
authorJunio C Hamano <gitster@pobox.com>
Fri, 9 Dec 2011 21:37:01 +0000 (13:37 -0800)
committerJunio C Hamano <gitster@pobox.com>
Fri, 9 Dec 2011 21:37:01 +0000 (13:37 -0800)
* ab/pull-rebase-config:
pull: introduce a pull.rebase option to enable --rebase

1  2 
Documentation/config.txt
Documentation/git-pull.txt
git-pull.sh
diff --combined Documentation/config.txt
index 5a841da6d4cd86c4340abf001f735a37035d198f,256d27c3b51b301b2011b310b3c76e235e83c1c3..8a7d2d4cb1c0dd200b1d7fc98fe3b5e78acba755
@@@ -45,10 -45,9 +45,10 @@@ lines.  Variables may belong directly t
  You can have `[section]` if you have `[section "subsection"]`, but you
  don't need to.
  
 -There is also a case insensitive alternative `[section.subsection]` syntax.
 -In this syntax, subsection names follow the same restrictions as for section
 -names.
 +There is also a deprecated `[section.subsection]` syntax. With this
 +syntax, the subsection name is converted to lower-case and is also
 +compared case sensitively. These subsection names follow the same
 +restrictions as section names.
  
  All the other lines (and the remainder of the line after the section
  header) are recognized as setting variables, in the form
@@@ -148,7 -147,7 +148,7 @@@ advice.*:
  
  core.fileMode::
        If false, the executable bit differences between the index and
 -      the working copy are ignored; useful on broken filesystems like FAT.
 +      the working tree are ignored; useful on broken filesystems like FAT.
        See linkgit:git-update-index[1].
  +
  The default is true, except linkgit:git-clone[1] or linkgit:git-init[1]
@@@ -180,7 -179,7 +180,7 @@@ is created
  
  core.trustctime::
        If false, the ctime differences between the index and the
 -      working copy are ignored; useful when the inode change time
 +      working tree are ignored; useful when the inode change time
        is regularly modified by something outside Git (file system
        crawlers and some backup systems).
        See linkgit:git-update-index[1]. True by default.
@@@ -293,7 -292,7 +293,7 @@@ core.ignoreStat:
        If true, commands which modify both the working tree and the index
        will mark the updated paths with the "assume unchanged" bit in the
        index. These marked files are then assumed to stay unchanged in the
 -      working copy, until you mark them otherwise manually - Git will not
 +      working tree, until you mark them otherwise manually - Git will not
        detect the file changes by lstat() calls. This is useful on systems
        where those are very slow, such as Microsoft Windows.
        See linkgit:git-update-index[1].
@@@ -345,9 -344,7 +345,9 @@@ core.logAllRefUpdates:
        SHA1, the date/time and the reason of the update, but
        only when the file exists.  If this configuration
        variable is set to true, missing "$GIT_DIR/logs/<ref>"
 -      file is automatically created for branch heads.
 +      file is automatically created for branch heads (i.e. under
 +      refs/heads/), remote refs (i.e. under refs/remotes/),
 +      note refs (i.e. under refs/notes/), and the symbolic ref HEAD.
  +
  This information can be used to determine what commit
  was the tip of a branch "2 days ago".
@@@ -474,12 -471,6 +474,12 @@@ core.editor:
        variable when it is set, and the environment variable
        `GIT_EDITOR` is not set.  See linkgit:git-var[1].
  
 +sequence.editor::
 +      Text editor used by `git rebase -i` for editing the rebase insn file.
 +      The value is meant to be interpreted by the shell when it is used.
 +      It can be overridden by the `GIT_SEQUENCE_EDITOR` environment variable.
 +      When not configured the default commit message editor is used instead.
 +
  core.pager::
        The command that git will use to paginate output.  Can
        be overridden with the `GIT_PAGER` environment
@@@ -677,15 -668,17 +677,17 @@@ branch.<name>.mergeoptions:
  branch.<name>.rebase::
        When true, rebase the branch <name> on top of the fetched branch,
        instead of merging the default branch from the default remote when
-       "git pull" is run.
-       *NOTE*: this is a possibly dangerous operation; do *not* use
-       it unless you understand the implications (see linkgit:git-rebase[1]
-       for details).
+       "git pull" is run. See "pull.rebase" for doing this in a non
+       branch-specific manner.
+ +
+ *NOTE*: this is a possibly dangerous operation; do *not* use
+ it unless you understand the implications (see linkgit:git-rebase[1]
+ for details).
  
  browser.<tool>.cmd::
        Specify the command to invoke the specified browser. The
        specified command is evaluated in shell with the URLs passed
 -      as arguments. (See linkgit:git-web--browse[1].)
 +      as arguments. (See linkgit:git-web{litdd}browse[1].)
  
  browser.<tool>.path::
        Override the path for the given tool that may be used to
@@@ -864,13 -857,6 +866,13 @@@ fetch.recurseSubmodules:
        when its superproject retrieves a commit that updates the submodule's
        reference.
  
 +fetch.fsckObjects::
 +      If it is set to true, git-fetch-pack will check all fetched
 +      objects. It will abort in the case of a malformed object or a
 +      broken link. The result of an abort are only dangling objects.
 +      Defaults to false. If not set, the value of `transfer.fsckObjects`
 +      is used instead.
 +
  fetch.unpackLimit::
        If the number of objects fetched over the git native
        transfer is below this
@@@ -1078,23 -1064,6 +1080,23 @@@ All gitcvs variables except for 'gitcvs
  is one of "ext" and "pserver") to make them apply only for the given
  access method.
  
 +gitweb.category::
 +gitweb.description::
 +gitweb.owner::
 +gitweb.url::
 +      See linkgit:gitweb[1] for description.
 +
 +gitweb.avatar::
 +gitweb.blame::
 +gitweb.grep::
 +gitweb.highlight::
 +gitweb.patches::
 +gitweb.pickaxe::
 +gitweb.remote_heads::
 +gitweb.showsizes::
 +gitweb.snapshot::
 +      See linkgit:gitweb.conf[5] for description.
 +
  grep.lineNumber::
        If set to true, enable '-n' option by default.
  
@@@ -1229,14 -1198,6 +1231,14 @@@ http.proxy:
        environment variable (see linkgit:curl[1]).  This can be overridden
        on a per-remote basis; see remote.<name>.proxy
  
 +http.cookiefile::
 +      File containing previously stored cookie lines which should be used
 +      in the git http session, if they match the server. The file format
 +      of the file to read cookies from should be plain HTTP headers or
 +      the Netscape/Mozilla cookie file format (see linkgit:curl[1]).
 +      NOTE that the file specified with http.cookiefile is only used as
 +      input. No cookies will be stored in the file.
 +
  http.sslVerify::
        Whether to verify the SSL certificate when fetching or pushing
        over HTTPS. Can be overridden by the 'GIT_SSL_NO_VERIFY' environment
@@@ -1484,8 -1445,7 +1486,8 @@@ notes.rewriteRef:
        You may also specify this configuration several times.
  +
  Does not have a default value; you must configure this variable to
 -enable note rewriting.
 +enable note rewriting.  Set it to `refs/notes/commits` to enable
 +rewriting for the default commit notes.
  +
  This setting can be overridden with the `GIT_NOTES_REWRITE_REF`
  environment variable, which must be a colon separated list of refs or
@@@ -1590,6 -1550,16 +1592,16 @@@ pretty.<name>:
        Note that an alias with the same name as a built-in format
        will be silently ignored.
  
+ pull.rebase::
+       When true, rebase branches on top of the fetched branch, instead
+       of merging the default branch from the default remote when "git
+       pull" is run. See "branch.<name>.rebase" for setting this on a
+       per-branch basis.
+ +
+ *NOTE*: this is a possibly dangerous operation; do *not* use
+ it unless you understand the implications (see linkgit:git-rebase[1]
+ for details).
  pull.octopus::
        The default merge strategy to use when pulling multiple branches
        at once.
@@@ -1627,8 -1597,7 +1639,8 @@@ receive.fsckObjects:
        If it is set to true, git-receive-pack will check all received
        objects. It will abort in the case of a malformed object or a
        broken link. The result of an abort are only dangling objects.
 -      Defaults to false.
 +      Defaults to false. If not set, the value of `transfer.fsckObjects`
 +      is used instead.
  
  receive.unpackLimit::
        If the number of objects received in a push is below this
@@@ -1863,11 -1832,6 +1875,11 @@@ tar.umask:
        archiving user's umask will be used instead.  See umask(2) and
        linkgit:git-archive[1].
  
 +transfer.fsckObjects::
 +      When `fetch.fsckObjects` or `receive.fsckObjects` are
 +      not set, the value of this variable is used instead.
 +      Defaults to false.
 +
  transfer.unpackLimit::
        When `fetch.unpackLimit` or `receive.unpackLimit` are
        not set, the value of this variable is used instead.
index e1da46876682e9d95a7505e1bc116cbe07f2ec61,756909cb10f62c44321653bfd5c32fc306c60653..0f18ec891ac75effb102a445a93bdcf4432bb697
@@@ -8,7 -8,6 +8,7 @@@ git-pull - Fetch from and merge with an
  
  SYNOPSIS
  --------
 +[verse]
  'git pull' [options] [<repository> [<refspec>...]]
  
  
@@@ -108,7 -107,7 +108,7 @@@ include::merge-options.txt[
        fetched, the rebase uses that information to avoid rebasing
        non-local changes.
  +
- See `branch.<name>.rebase` and `branch.autosetuprebase` in
+ See `pull.rebase`, `branch.<name>.rebase` and `branch.autosetuprebase` in
  linkgit:git-config[1] if you want to make `git pull` always use
  `{litdd}rebase` instead of merging.
  +
diff --combined git-pull.sh
index 9868a0bfb478707b361f664a252870b3d1939138,277ed40cdb2d448fd8745972e30428bd266ed3b0..d8b64d7a67a19f1821a26c3ec82c0953db717be6
@@@ -9,29 -9,28 +9,29 @@@ LONG_USAGE='Fetch one or more remote re
  SUBDIRECTORY_OK=Yes
  OPTIONS_SPEC=
  . git-sh-setup
 -set_reflog_action "pull $*"
 -require_work_tree
 +. git-sh-i18n
 +set_reflog_action "pull${1+ $*}"
 +require_work_tree_exists
  cd_to_toplevel
  
  
  die_conflict () {
      git diff-index --cached --name-status -r --ignore-submodules HEAD --
      if [ $(git config --bool --get advice.resolveConflict || echo true) = "true" ]; then
 -      die "Pull is not possible because you have unmerged files.
 +      die "$(gettext "Pull is not possible because you have unmerged files.
  Please, fix them up in the work tree, and then use 'git add/rm <file>'
 -as appropriate to mark resolution, or use 'git commit -a'."
 +as appropriate to mark resolution, or use 'git commit -a'.")"
      else
 -      die "Pull is not possible because you have unmerged files."
 +      die "$(gettext "Pull is not possible because you have unmerged files.")"
      fi
  }
  
  die_merge () {
      if [ $(git config --bool --get advice.resolveConflict || echo true) = "true" ]; then
 -      die "You have not concluded your merge (MERGE_HEAD exists).
 -Please, commit your changes before you can merge."
 +      die "$(gettext "You have not concluded your merge (MERGE_HEAD exists).
 +Please, commit your changes before you can merge.")"
      else
 -      die "You have not concluded your merge (MERGE_HEAD exists)."
 +      die "$(gettext "You have not concluded your merge (MERGE_HEAD exists).")"
      fi
  }
  
@@@ -44,6 -43,10 +44,10 @@@ merge_args
  curr_branch=$(git symbolic-ref -q HEAD)
  curr_branch_short="${curr_branch#refs/heads/}"
  rebase=$(git config --bool branch.$curr_branch_short.rebase)
+ if test -z "$rebase"
+ then
+       rebase=$(git config --bool pull.rebase)
+ fi
  dry_run=
  while :
  do
        --d|--dr|--dry|--dry-|--dry-r|--dry-ru|--dry-run)
                dry_run=--dry-run
                ;;
 -      -h|--h|--he|--hel|--help|--help-|--help-a|--help-al|--help-all)
 +      -h|--help-all)
                usage
                ;;
        *)
@@@ -186,7 -189,7 +190,7 @@@ test true = "$rebase" && 
                # On an unborn branch
                if test -f "$GIT_DIR/index"
                then
 -                      die "updating an unborn branch with changes added to the index"
 +                      die "$(gettext "updating an unborn branch with changes added to the index")"
                fi
        else
                require_clean_work_tree "pull with rebase" "Please commit or stash them."
@@@ -217,17 -220,17 +221,17 @@@ the
        # $orig_head commit, but we are merging into $curr_head.
        # First update the working tree to match $curr_head.
  
 -      echo >&2 "Warning: fetch updated the current branch head."
 -      echo >&2 "Warning: fast-forwarding your working tree from"
 -      echo >&2 "Warning: commit $orig_head."
 +      eval_gettextln "Warning: fetch updated the current branch head.
 +Warning: fast-forwarding your working tree from
 +Warning: commit \$orig_head." >&2
        git update-index -q --refresh
        git read-tree -u -m "$orig_head" "$curr_head" ||
 -              die 'Cannot fast-forward your working tree.
 +              die "$(eval_gettext "Cannot fast-forward your working tree.
  After making sure that you saved anything precious from
 -$ git diff '$orig_head'
 +$ git diff \$orig_head
  output, run
  $ git reset --hard
 -to recover.'
 +to recover.")"
  
  fi
  
@@@ -242,11 -245,11 +246,11 @@@ case "$merge_head" i
  ?*' '?*)
        if test -z "$orig_head"
        then
 -              die "Cannot merge multiple branches into empty head"
 +              die "$(gettext "Cannot merge multiple branches into empty head")"
        fi
        if test true = "$rebase"
        then
 -              die "Cannot rebase onto multiple branches"
 +              die "$(gettext "Cannot rebase onto multiple branches")"
        fi
        ;;
  esac