From: Junio C Hamano Date: Fri, 9 May 2008 03:06:36 +0000 (-0700) Subject: Merge branch 'sg/merge-options' (early part) X-Git-Tag: v1.5.6-rc0~79 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/ca1c9913f8ac0ccaf976d44822076e1bba5bcd94?ds=inline;hp=-c Merge branch 'sg/merge-options' (early part) * 'sg/merge-options' (early part): 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 --- ca1c9913f8ac0ccaf976d44822076e1bba5bcd94 diff --combined Documentation/config.txt index 7a91ac16fb,bef612705a..a102729fa4 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@@ -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 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 @@@ -684,36 -673,6 +684,36 @@@ specified as 'gitcvs...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..name:: - Defines a human readable name for a custom low-level - merge driver. See linkgit:gitattributes[5] for details. - - merge..driver:: - Defines the command that implements a custom low-level - merge driver. See linkgit:gitattributes[5] for details. - - merge..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[] +man..cmd:: + Specify the command to invoke the specified man viewer. The + specified command is evaluated in shell with the man page + passed as argument. (See linkgit:git-help[1].) + +man..path:: + Override the path for the given tool that may be used to + display help in the 'man' format. See linkgit:git-help[1]. + mergetool..path:: Override the path for the given tool. This is useful in case your tool is not in the PATH. @@@ -960,10 -880,6 +930,10 @@@ remote..push: The default set of "refspec" for linkgit:git-push[1]. See linkgit:git-push[1]. +remote..mirror:: + If true, pushing to this remote will automatically behave + as if the `\--mirror` option was given on the command line. + remote..skipDefaultUpdate:: If true, this remote will be skipped by default when updating using the update subcommand of linkgit:git-remote[1]. diff --combined builtin-fmt-merge-msg.c index 7077d52477,d49f5454e8..b72cb59e6a --- a/builtin-fmt-merge-msg.c +++ b/builtin-fmt-merge-msg.c @@@ -6,13 -6,18 +6,18 @@@ #include "tag.h" static const char *fmt_merge_msg_usage = - "git-fmt-merge-msg [--summary] [--no-summary] [--file ]"; + "git-fmt-merge-msg [--log] [--no-log] [--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)), @@@ -217,6 -213,7 +222,6 @@@ 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) diff --combined contrib/completion/git-completion.bash index 23db664f48,8091d2deb7..16984632d9 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@@ -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