Update bash completion header documentation
[gitweb.git] / contrib / completion / git-completion.bash
index 994474502854b398a3b736aae1618df9d1946693..48ba3f8e81e7899d2b4cb764704e83dcb58a0e1a 100755 (executable)
@@ -1,8 +1,9 @@
 #
 # bash completion support for core Git.
 #
-# Copyright (C) 2006,2007 Shawn Pearce
+# Copyright (C) 2006,2007 Shawn O. Pearce <spearce@spearce.org>
 # Conceptually based on gitcompletion (http://gitweb.hawaga.org.uk/).
+# Distributed under the GNU General Public License, version 2.0.
 #
 # The contained completion routines provide support for completing:
 #
@@ -11,6 +12,7 @@
 #    *) .git/remotes file names
 #    *) git 'subcommands'
 #    *) tree paths within 'ref:path/to/file' expressions
+#    *) common --long-options
 #
 # To use these routines:
 #
 #       are currently in a git repository.  The %s token will be
 #       the name of the current branch.
 #
+# To submit patches:
+#
+#    *) Read Documentation/SubmittingPatches
+#    *) Send all patches to the current maintainer:
+#
+#       "Shawn O. Pearce" <spearce@spearce.org>
+#
+#    *) Always CC the Git mailing list:
+#
+#       git@vger.kernel.org
+#
 
 __gitdir ()
 {
@@ -579,7 +592,7 @@ _git_log ()
                __gitcomp "
                        --max-count= --max-age= --since= --after=
                        --min-age= --before= --until=
-                       --root --not --topo-order --date-order
+                       --root --topo-order --date-order
                        --no-merges
                        --abbrev-commit --abbrev=
                        --relative-date
@@ -896,6 +909,26 @@ _git_reset ()
        __gitcomp "$(__git_refs)"
 }
 
+_git_shortlog ()
+{
+       local cur="${COMP_WORDS[COMP_CWORD]}"
+       case "$cur" in
+       --*)
+               __gitcomp "
+                       --max-count= --max-age= --since= --after=
+                       --min-age= --before= --until=
+                       --no-merges
+                       --author= --committer= --grep=
+                       --all-match
+                       --not --all
+                       --numbered --summary
+                       "
+               return
+               ;;
+       esac
+       __git_complete_revlist
+}
+
 _git_show ()
 {
        local cur="${COMP_WORDS[COMP_CWORD]}"
@@ -967,6 +1000,7 @@ _git ()
        rebase)      _git_rebase ;;
        remote)      _git_remote ;;
        reset)       _git_reset ;;
+       shortlog)    _git_shortlog ;;
        show)        _git_show ;;
        show-branch) _git_log ;;
        whatchanged) _git_log ;;
@@ -1012,6 +1046,7 @@ complete -o default -o nospace -F _git_rebase git-rebase
 complete -o default -o nospace -F _git_config git-config
 complete -o default -o nospace -F _git_remote git-remote
 complete -o default -o nospace -F _git_reset git-reset
+complete -o default -o nospace -F _git_shortlog git-shortlog
 complete -o default -o nospace -F _git_show git-show
 complete -o default -o nospace -F _git_log git-show-branch
 complete -o default -o nospace -F _git_log git-whatchanged
@@ -1034,6 +1069,7 @@ complete -o default -o nospace -F _git_merge_base git-merge-base.exe
 complete -o default -o nospace -F _git_name_rev git-name-rev.exe
 complete -o default -o nospace -F _git_push git-push.exe
 complete -o default -o nospace -F _git_config git-config
+complete -o default -o nospace -F _git_shortlog git-shortlog.exe
 complete -o default -o nospace -F _git_show git-show.exe
 complete -o default -o nospace -F _git_log git-show-branch.exe
 complete -o default -o nospace -F _git_log git-whatchanged.exe