Merge branch 'tb/complete-diff-ignore-blank-lines'
authorJunio C Hamano <gitster@pobox.com>
Fri, 19 Sep 2014 18:38:38 +0000 (11:38 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 19 Sep 2014 18:38:38 +0000 (11:38 -0700)
* tb/complete-diff-ignore-blank-lines:
completion: Add --ignore-blank-lines for diff

1  2 
contrib/completion/git-completion.bash
index 06bf262087768d98450cb589eb8f8fcc51ed2f74,731ca47af8f84ab8b38756d36b35b98a19829e81..5ea5b82d2b6c54111c059a1c844c6e9f0b3d3a79
  #        source ~/.git-completion.sh
  #    3) Consider changing your PS1 to also show the current branch,
  #       see git-prompt.sh for details.
 +#
 +# If you use complex aliases of form '!f() { ... }; f', you can use the null
 +# command ':' as the first command in the function body to declare the desired
 +# completion style.  For example '!f() { : git commit ; ... }; f' will
 +# tell the completion to use commit completion.  This also works with aliases
 +# of form "!sh -c '...'".  For example, "!sh -c ': git commit ; ... '".
  
  case "$COMP_WORDBREAKS" in
  *:*) : great ;;
@@@ -787,10 -781,6 +787,10 @@@ __git_aliased_command (
                -*)     : option ;;
                *=*)    : setting env ;;
                git)    : git itself ;;
 +              \(\))   : skip parens of shell function definition ;;
 +              {)      : skip start of shell helper function ;;
 +              :)      : skip null command ;;
 +              \'*)    : skip opening quote after sh -c ;;
                *)
                        echo "$word"
                        return
@@@ -1175,8 -1165,8 +1175,8 @@@ __git_diff_common_options="--stat --num
                        --full-index --binary --abbrev --diff-filter=
                        --find-copies-harder
                        --text --ignore-space-at-eol --ignore-space-change
-                       --ignore-all-space --exit-code --quiet --ext-diff
-                       --no-ext-diff
+                       --ignore-all-space --ignore-blank-lines --exit-code
+                       --quiet --ext-diff --no-ext-diff
                        --no-prefix --src-prefix= --dst-prefix=
                        --inter-hunk-context=
                        --patience --histogram --minimal
@@@ -1621,33 -1611,12 +1621,33 @@@ _git_pull (
  
  __git_push_recurse_submodules="check on-demand"
  
 +__git_complete_force_with_lease ()
 +{
 +      local cur_=$1
 +
 +      case "$cur_" in
 +      --*=)
 +              ;;
 +      *:*)
 +              __gitcomp_nl "$(__git_refs)" "" "${cur_#*:}"
 +              ;;
 +      *)
 +              __gitcomp_nl "$(__git_refs)" "" "$cur_"
 +              ;;
 +      esac
 +}
 +
  _git_push ()
  {
        case "$prev" in
        --repo)
                __gitcomp_nl "$(__git_remotes)"
                return
 +              ;;
 +      --recurse-submodules)
 +              __gitcomp "$__git_push_recurse_submodules"
 +              return
 +              ;;
        esac
        case "$cur" in
        --repo=*)
                __gitcomp "$__git_push_recurse_submodules" "" "${cur##--recurse-submodules=}"
                return
                ;;
 +      --force-with-lease=*)
 +              __git_complete_force_with_lease "${cur##--force-with-lease=}"
 +              return
 +              ;;
        --*)
                __gitcomp "
                        --all --mirror --tags --dry-run --force --verbose
 +                      --quiet --prune --delete --follow-tags
                        --receive-pack= --repo= --set-upstream
 -                      --recurse-submodules=
 +                      --force-with-lease --force-with-lease= --recurse-submodules=
                "
                return
                ;;