Merge branch 'rr/completion-format-coverletter'
authorJunio C Hamano <gitster@pobox.com>
Mon, 13 Jan 2014 19:33:38 +0000 (11:33 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 13 Jan 2014 19:33:38 +0000 (11:33 -0800)
The bash/zsh completion code did not know about format.coverLetter
among many format.* configuration variables.

* rr/completion-format-coverletter:
completion: complete format.coverLetter

1  2 
contrib/completion/git-completion.bash
index 4fe5ce31bd99e5c5307761c947d4661241ec3c24,39b81f7a685beccd0b291a2deb50a7fb0285e953..8aaf214b7da7b45cc4018c5faac8e08d772547b4
@@@ -178,9 -178,9 +178,9 @@@ _get_comp_words_by_ref (
  }
  fi
  
 -__gitcompadd ()
 +__gitcompappend ()
  {
 -      local i=0
 +      local i=${#COMPREPLY[@]}
        for x in $1; do
                if [[ "$x" == "$3"* ]]; then
                        COMPREPLY[i++]="$2$x$4"
        done
  }
  
 +__gitcompadd ()
 +{
 +      COMPREPLY=()
 +      __gitcompappend "$@"
 +}
 +
  # Generates completion reply, appending a space to possible completion words,
  # if necessary.
  # It accepts 1 to 4 arguments:
@@@ -224,14 -218,6 +224,14 @@@ __gitcomp (
        esac
  }
  
 +# Variation of __gitcomp_nl () that appends to the existing list of
 +# completion candidates, COMPREPLY.
 +__gitcomp_nl_append ()
 +{
 +      local IFS=$'\n'
 +      __gitcompappend "$1" "${2-}" "${3-$cur}" "${4- }"
 +}
 +
  # Generates completion reply from newline-separated possible completion words
  # by appending a space to all of them.
  # It accepts 1 to 4 arguments:
  #    appended.
  __gitcomp_nl ()
  {
 -      local IFS=$'\n'
 -      __gitcompadd "$1" "${2-}" "${3-$cur}" "${4- }"
 +      COMPREPLY=()
 +      __gitcomp_nl_append "$@"
  }
  
  # Generates completion reply with compgen from newline-separated possible
@@@ -1841,7 -1827,6 +1841,7 @@@ _git_config (
        branch.*)
                local pfx="${cur%.*}." cur_="${cur#*.}"
                __gitcomp_nl "$(__git_heads)" "$pfx" "$cur_" "."
 +              __gitcomp_nl_append $'autosetupmerge\nautosetuprebase\n' "$pfx" "$cur_"
                return
                ;;
        guitool.*.*)
        remote.*)
                local pfx="${cur%.*}." cur_="${cur#*.}"
                __gitcomp_nl "$(__git_remotes)" "$pfx" "$cur_" "."
 +              __gitcomp_nl_append "pushdefault" "$pfx" "$cur_"
                return
                ;;
        url.*.*)
                fetch.unpackLimit
                format.attach
                format.cc
+               format.coverLetter
                format.headers
                format.numbered
                format.pretty