Merge commit 'sg/merge-options^' into jk/renamelimit
authorJunio C Hamano <gitster@pobox.com>
Sat, 3 May 2008 20:18:20 +0000 (13:18 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sat, 3 May 2008 20:18:20 +0000 (13:18 -0700)
* commit 'sg/merge-options^':
merge, pull: add '--(no-)log' command line option
fmt-merge-msg: add '--(no-)log' options and 'merge.log' config variable
add 'merge.stat' config variable
merge, pull: introduce '--(no-)stat' option
doc: moved merge.* config variables into separate merge-config.txt

1  2 
Documentation/config.txt
builtin-fmt-merge-msg.c
contrib/completion/git-completion.bash
diff --combined Documentation/config.txt
index 824e416e9f8157d54d3f37e0e520fff5f9a125c0,bef612705ab9424a33d15cb93af149a112a0fcc4..3cad707be07c1941ec3f1b472d938400248cd3e4
@@@ -234,13 -234,7 +234,13 @@@ core.worktree:
        used in combination with repositories found automatically in
        a .git directory (i.e. $GIT_DIR is not set).
        This can be overridden by the GIT_WORK_TREE environment
 -      variable and the '--work-tree' command line option.
 +      variable and the '--work-tree' command line option. It can be
 +      a absolute path or relative path to the directory specified by
 +      --git-dir or GIT_DIR.
 +      Note: If --git-dir or GIT_DIR are specified but none of
 +      --work-tree, GIT_WORK_TREE and core.worktree is specified,
 +      the current working directory is regarded as the top directory
 +      of your working tree.
  
  core.logAllRefUpdates::
        Enable the reflog. Updates to a ref <ref> is logged to the file
@@@ -267,12 -261,7 +267,12 @@@ core.sharedRepository:
        group-writable). When 'all' (or 'world' or 'everybody'), the
        repository will be readable by all users, additionally to being
        group-shareable. When 'umask' (or 'false'), git will use permissions
 -      reported by umask(2). See linkgit:git-init[1]. False by default.
 +      reported by umask(2). When '0xxx', where '0xxx' is an octal number,
 +      files in the repository will have this mode value. '0xxx' will override
 +      user's umask value, and thus, users with a safe umask (0077) can use
 +      this option. Examples: '0660' is equivalent to 'group'. '0640' is a
 +      repository that is group-readable but not group-writable.
 +      See linkgit:git-init[1]. False by default.
  
  core.warnAmbiguousRefs::
        If true, git will warn you if the ref name you passed it is ambiguous
@@@ -779,37 -768,7 +779,7 @@@ man.viewer:
        Specify the programs that may be used to display help in the
        'man' format. See linkgit:git-help[1].
  
- merge.summary::
-       Whether to include summaries of merged commits in newly created
-       merge commit messages. False by default.
- merge.tool::
-       Controls which merge resolution program is used by
-       linkgit:git-mergetool[1].  Valid built-in values are: "kdiff3",
-       "tkdiff", "meld", "xxdiff", "emerge", "vimdiff", "gvimdiff", and
-       "opendiff".  Any other value is treated is custom merge tool
-       and there must be a corresponing mergetool.<tool>.cmd option.
- merge.verbosity::
-       Controls the amount of output shown by the recursive merge
-       strategy.  Level 0 outputs nothing except a final error
-       message if conflicts were detected. Level 1 outputs only
-       conflicts, 2 outputs conflicts and file changes.  Level 5 and
-       above outputs debugging information.  The default is level 2.
-       Can be overridden by 'GIT_MERGE_VERBOSITY' environment variable.
- merge.<driver>.name::
-       Defines a human readable name for a custom low-level
-       merge driver.  See linkgit:gitattributes[5] for details.
- merge.<driver>.driver::
-       Defines the command that implements a custom low-level
-       merge driver.  See linkgit:gitattributes[5] for details.
- merge.<driver>.recursive::
-       Names a low-level merge driver to be used when
-       performing an internal merge between common ancestors.
-       See linkgit:gitattributes[5] for details.
+ include::merge-config.txt[]
  
  mergetool.<tool>.path::
        Override the path for the given tool.  This is useful in case
diff --combined builtin-fmt-merge-msg.c
index 7077d524776e748e0add4ff85478cd62512add15,d49f5454e8d77a090fca28ce5f5b7db93f14287b..b72cb59e6a6aab33e7170826242d82785e4fa1e4
@@@ -6,13 -6,18 +6,18 @@@
  #include "tag.h"
  
  static const char *fmt_merge_msg_usage =
-       "git-fmt-merge-msg [--summary] [--no-summary] [--file <file>]";
+       "git-fmt-merge-msg [--log] [--no-log] [--file <file>]";
  
  static int merge_summary;
  
  static int fmt_merge_msg_config(const char *key, const char *value)
  {
-       if (!strcmp("merge.summary", key))
+       static int found_merge_log = 0;
+       if (!strcmp("merge.log", key)) {
+               found_merge_log = 1;
+               merge_summary = git_config_bool(key, value);
+       }
+       if (!found_merge_log && !strcmp("merge.summary", key))
                merge_summary = git_config_bool(key, value);
        return 0;
  }
@@@ -201,15 -206,6 +206,15 @@@ static void shortlog(const char *name, 
                        continue;
  
                bol = strstr(commit->buffer, "\n\n");
 +              if (bol) {
 +                      unsigned char c;
 +                      do {
 +                              c = *++bol;
 +                      } while (isspace(c));
 +                      if (!c)
 +                              bol = NULL;
 +              }
 +
                if (!bol) {
                        append_to_list(&subjects, xstrdup(sha1_to_hex(
                                                        commit->object.sha1)),
                        continue;
                }
  
 -              bol += 2;
                eol = strchr(bol, '\n');
                if (eol) {
                        oneline = xmemdupz(bol, eol - bol);
@@@ -258,9 -255,10 +263,10 @@@ int cmd_fmt_merge_msg(int argc, const c
        git_config(fmt_merge_msg_config);
  
        while (argc > 1) {
-               if (!strcmp(argv[1], "--summary"))
+               if (!strcmp(argv[1], "--log") || !strcmp(argv[1], "--summary"))
                        merge_summary = 1;
-               else if (!strcmp(argv[1], "--no-summary"))
+               else if (!strcmp(argv[1], "--no-log")
+                               || !strcmp(argv[1], "--no-summary"))
                        merge_summary = 0;
                else if (!strcmp(argv[1], "-F") || !strcmp(argv[1], "--file")) {
                        if (argc < 3)
index 23db664f48057b7fa778f0b265510d5b95457c16,8091d2deb7d01f79b15d31812dd733aca479f03b..16984632d984006e2f2867a26714086bf3045ca3
@@@ -152,7 -152,7 +152,7 @@@ __git_heads (
                done
                return
        fi
 -      for i in $(git-ls-remote "$1" 2>/dev/null); do
 +      for i in $(git ls-remote "$1" 2>/dev/null); do
                case "$is_hash,$i" in
                y,*) is_hash=n ;;
                n,*^{}) is_hash=y ;;
@@@ -173,7 -173,7 +173,7 @@@ __git_tags (
                done
                return
        fi
 -      for i in $(git-ls-remote "$1" 2>/dev/null); do
 +      for i in $(git ls-remote "$1" 2>/dev/null); do
                case "$is_hash,$i" in
                y,*) is_hash=n ;;
                n,*^{}) is_hash=y ;;
@@@ -200,7 -200,7 +200,7 @@@ __git_refs (
                done
                return
        fi
 -      for i in $(git-ls-remote "$dir" 2>/dev/null); do
 +      for i in $(git ls-remote "$dir" 2>/dev/null); do
                case "$is_hash,$i" in
                y,*) is_hash=n ;;
                n,*^{}) is_hash=y ;;
@@@ -223,7 -223,7 +223,7 @@@ __git_refs2 (
  __git_refs_remotes ()
  {
        local cmd i is_hash=y
 -      for i in $(git-ls-remote "$1" 2>/dev/null); do
 +      for i in $(git ls-remote "$1" 2>/dev/null); do
                case "$is_hash,$i" in
                n,refs/heads/*)
                        is_hash=y
@@@ -641,7 -641,6 +641,7 @@@ _git_diff (
                        --ignore-all-space --exit-code --quiet --ext-diff
                        --no-ext-diff
                        --no-prefix --src-prefix= --dst-prefix=
 +                      --base --ours --theirs
                        "
                return
                ;;
@@@ -780,7 -779,7 +780,7 @@@ _git_merge (
                ;;
        --*)
                __gitcomp "
-                       --no-commit --no-summary --squash --strategy
+                       --no-commit --no-stat --log --no-log --squash --strategy
                        "
                return
        esac
@@@ -1053,7 -1052,6 +1053,7 @@@ _git_remote (
        local subcommands="add rm show prune update"
        local subcommand="$(__git_find_subcommand "$subcommands")"
        if [ -z "$subcommand" ]; then
 +              __gitcomp "$subcommands"
                return
        fi
  
@@@ -1346,14 -1344,9 +1346,14 @@@ _git (
  _gitk ()
  {
        local cur="${COMP_WORDS[COMP_CWORD]}"
 +      local g="$(git rev-parse --git-dir 2>/dev/null)"
 +      local merge=""
 +      if [ -f $g/MERGE_HEAD ]; then
 +              merge="--merge"
 +      fi
        case "$cur" in
        --*)
 -              __gitcomp "--not --all"
 +              __gitcomp "--not --all $merge"
                return
                ;;
        esac