Merge branch 'mg/complete-cherry-mark-to-log'
authorJunio C Hamano <gitster@pobox.com>
Wed, 13 Apr 2016 21:12:39 +0000 (14:12 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 13 Apr 2016 21:12:40 +0000 (14:12 -0700)
The completion scripts (in contrib/) did not include the
"--cherry-mark" option when completing "git log <HT>".

* mg/complete-cherry-mark-to-log:
completion: complete --cherry-mark for git log

1  2 
contrib/completion/git-completion.bash
index ffe60048c1e50a2b3d9282cbab09721710232fbe,531ee2ddf086047b4df747c543a1b593b4668e87..34024754d9296b56c194a7959afb7b7f28402457
@@@ -10,7 -10,6 +10,7 @@@
  #    *) local and remote tag names
  #    *) .git/remotes file names
  #    *) git 'subcommands'
 +#    *) git email aliases for git-send-email
  #    *) tree paths within 'ref:path/to/file' expressions
  #    *) file paths within current working directory and index
  #    *) common --long-options
@@@ -664,11 -663,10 +664,11 @@@ __git_list_porcelain_commands (
                check-mailmap)    : plumbing;;
                check-ref-format) : plumbing;;
                checkout-index)   : plumbing;;
 +              column)           : internal helper;;
                commit-tree)      : plumbing;;
                count-objects)    : infrequent;;
 -              credential-cache) : credentials helper;;
 -              credential-store) : credentials helper;;
 +              credential)       : credentials;;
 +              credential-*)     : credentials helper;;
                cvsexportcommit)  : export;;
                cvsimport)        : import;;
                cvsserver)        : daemon;;
  __git_porcelain_commands=
  __git_compute_porcelain_commands ()
  {
 -      __git_compute_all_commands
        test -n "$__git_porcelain_commands" ||
        __git_porcelain_commands=$(__git_list_porcelain_commands)
  }
  
 -__git_pretty_aliases ()
 +# Lists all set config variables starting with the given section prefix,
 +# with the prefix removed.
 +__git_get_config_variables ()
  {
 -      local i IFS=$'\n'
 -      for i in $(git --git-dir="$(__gitdir)" config --get-regexp "pretty\..*" 2>/dev/null); do
 -              case "$i" in
 -              pretty.*)
 -                      i="${i#pretty.}"
 -                      echo "${i/ */}"
 -                      ;;
 -              esac
 +      local section="$1" i IFS=$'\n'
 +      for i in $(git --git-dir="$(__gitdir)" config --name-only --get-regexp "^$section\..*" 2>/dev/null); do
 +              echo "${i#$section.}"
        done
  }
  
 +__git_pretty_aliases ()
 +{
 +      __git_get_config_variables "pretty"
 +}
 +
  __git_aliases ()
  {
 -      local i IFS=$'\n'
 -      for i in $(git --git-dir="$(__gitdir)" config --get-regexp "alias\..*" 2>/dev/null); do
 -              case "$i" in
 -              alias.*)
 -                      i="${i#alias.}"
 -                      echo "${i/ */}"
 -                      ;;
 -              esac
 -      done
 +      __git_get_config_variables "alias"
  }
  
  # __git_aliased_command requires 1 argument
@@@ -1169,7 -1174,7 +1169,7 @@@ __git_diff_common_options="--stat --num
                        --no-prefix --src-prefix= --dst-prefix=
                        --inter-hunk-context=
                        --patience --histogram --minimal
 -                      --raw --word-diff
 +                      --raw --word-diff --word-diff-regex=
                        --dirstat --dirstat= --dirstat-by-file
                        --dirstat-by-file= --cumulative
                        --diff-algorithm=
@@@ -1312,7 -1317,6 +1312,7 @@@ _git_grep (
                        --full-name --line-number
                        --extended-regexp --basic-regexp --fixed-strings
                        --perl-regexp
 +                      --threads
                        --files-with-matches --name-only
                        --files-without-match
                        --max-depth
@@@ -1339,15 -1343,15 +1339,15 @@@ _git_help (
  {
        case "$cur" in
        --*)
 -              __gitcomp "--all --info --man --web"
 +              __gitcomp "--all --guides --info --man --web"
                return
                ;;
        esac
        __git_compute_all_commands
        __gitcomp "$__git_all_commands $(__git_aliases)
                attributes cli core-tutorial cvs-migration
 -              diffcore gitk glossary hooks ignore modules
 -              namespaces repository-layout tutorial tutorial-2
 +              diffcore everyday gitk glossary hooks ignore modules
 +              namespaces repository-layout revisions tutorial tutorial-2
                workflows
                "
  }
@@@ -1458,6 -1462,7 +1458,7 @@@ _git_log (
                        --relative-date --date=
                        --pretty= --format= --oneline
                        --show-signature
+                       --cherry-mark
                        --cherry-pick
                        --graph
                        --decorate --decorate=
@@@ -1669,10 -1674,7 +1670,10 @@@ _git_push (
  _git_rebase ()
  {
        local dir="$(__gitdir)"
 -      if [ -d "$dir"/rebase-apply ] || [ -d "$dir"/rebase-merge ]; then
 +      if [ -f "$dir"/rebase-merge/interactive ]; then
 +              __gitcomp "--continue --skip --abort --edit-todo"
 +              return
 +      elif [ -d "$dir"/rebase-apply ] || [ -d "$dir"/rebase-merge ]; then
                __gitcomp "--continue --skip --abort"
                return
        fi
                        --preserve-merges --stat --no-stat
                        --committer-date-is-author-date --ignore-date
                        --ignore-whitespace --whitespace=
 -                      --autosquash --fork-point --no-fork-point
 -                      --autostash
 +                      --autosquash --no-autosquash
 +                      --fork-point --no-fork-point
 +                      --autostash --no-autostash
 +                      --verify --no-verify
 +                      --keep-empty --root --force-rebase --no-ff
 +                      --exec
                        "
  
                return
@@@ -1718,15 -1716,6 +1719,15 @@@ __git_send_email_suppresscc_options="au
  
  _git_send_email ()
  {
 +      case "$prev" in
 +      --to|--cc|--bcc|--from)
 +              __gitcomp "
 +              $(git --git-dir="$(__gitdir)" send-email --dump-aliases 2>/dev/null)
 +              "
 +              return
 +              ;;
 +      esac
 +
        case "$cur" in
        --confirm=*)
                __gitcomp "
                        " "" "${cur##--thread=}"
                return
                ;;
 +      --to=*|--cc=*|--bcc=*|--from=*)
 +              __gitcomp "
 +              $(git --git-dir="$(__gitdir)" send-email --dump-aliases 2>/dev/null)
 +              " "" "${cur#--*=}"
 +              return
 +              ;;
        --*)
                __gitcomp "--annotate --bcc --cc --cc-cmd --chain-reply-to
                        --compose --confirm= --dry-run --envelope-sender
@@@ -1798,7 -1781,15 +1799,7 @@@ __git_config_get_set_variables (
                c=$((--c))
        done
  
 -      git --git-dir="$(__gitdir)" config $config_file --list 2>/dev/null |
 -      while read -r line
 -      do
 -              case "$line" in
 -              *.*=*)
 -                      echo "${line/=*/}"
 -                      ;;
 -              esac
 -      done
 +      git --git-dir="$(__gitdir)" config $config_file --name-only --list 2>/dev/null
  }
  
  _git_config ()
                return
                ;;
        branch.*.rebase)
 -              __gitcomp "false true"
 +              __gitcomp "false true preserve interactive"
                return
                ;;
        remote.pushdefault)
                        --get --get-all --get-regexp
                        --add --unset --unset-all
                        --remove-section --rename-section
 +                      --name-only
                        "
                return
                ;;
                core.sparseCheckout
                core.symlinks
                core.trustctime
 +              core.untrackedCache
                core.warnAmbiguousRefs
                core.whitespace
                core.worktree
                http.noEPSV
                http.postBuffer
                http.proxy
 +              http.sslCipherList
 +              http.sslVersion
                http.sslCAInfo
                http.sslCAPath
                http.sslCert
@@@ -2274,7 -2261,12 +2275,7 @@@ _git_remote (
                __git_complete_remote_or_refspec
                ;;
        update)
 -              local i c='' IFS=$'\n'
 -              for i in $(git --git-dir="$(__gitdir)" config --get-regexp "remotes\..*" 2>/dev/null); do
 -                      i="${i#remotes.}"
 -                      c="$c ${i/ */}"
 -              done
 -              __gitcomp "$c"
 +              __gitcomp "$(__git_get_config_variables "remotes")"
                ;;
        *)
                ;;
@@@ -2301,11 -2293,6 +2302,11 @@@ _git_reset (
  
  _git_revert ()
  {
 +      local dir="$(__gitdir)"
 +      if [ -f "$dir"/REVERT_HEAD ]; then
 +              __gitcomp "--continue --quit --abort"
 +              return
 +      fi
        case "$cur" in
        --*)
                __gitcomp "--edit --mainline --no-edit --no-commit --signoff"
@@@ -2374,7 -2361,7 +2375,7 @@@ _git_show_branch (
        case "$cur" in
        --*)
                __gitcomp "
 -                      --all --remotes --topo-order --current --more=
 +                      --all --remotes --topo-order --date-order --current --more=
                        --list --independent --merge-base --no-name
                        --color --no-color
                        --sha1-name --sparse --topics --reflog
  
  _git_stash ()
  {
 -      local save_opts='--keep-index --no-keep-index --quiet --patch'
 +      local save_opts='--all --keep-index --no-keep-index --quiet --patch --include-untracked'
        local subcommands='save list show apply clear drop pop create branch'
        local subcommand="$(__git_find_on_cmdline "$subcommands")"
        if [ -z "$subcommand" ]; then
                apply,--*|pop,--*)
                        __gitcomp "--index --quiet"
                        ;;
 -              show,--*|drop,--*|branch,--*)
 +              drop,--*)
 +                      __gitcomp "--quiet"
 +                      ;;
 +              show,--*|branch,--*)
 +                      ;;
 +              branch,*)
 +                      if [ $cword -eq 3 ]; then
 +                              __gitcomp_nl "$(__git_refs)";
 +                      else
 +                              __gitcomp_nl "$(git --git-dir="$(__gitdir)" stash list \
 +                                              | sed -n -e 's/:.*//p')"
 +                      fi
                        ;;
 -              show,*|apply,*|drop,*|pop,*|branch,*)
 +              show,*|apply,*|drop,*|pop,*)
                        __gitcomp_nl "$(git --git-dir="$(__gitdir)" stash list \
                                        | sed -n -e 's/:.*//p')"
                        ;;