Go to file
SZEDER Gábor 424cce832d bash: support user-supplied completion scripts for user's git commands
The bash completion script already provides support to complete
aliases, options and refs for aliases (if the alias can be traced back
to a supported git command by __git_aliased_command()), and the user's
custom git commands, but it does not support the options of the user's
custom git commands (of course; how could it know about the options of
a custom git command?).  Users of such custom git commands could
extend git's bash completion script by writing functions to support
their commands, but they might have issues with it: they might not
have the rights to modify a system-wide git completion script, and
they will need to track and merge upstream changes in the future.

This patch addresses this by providing means for users to supply
custom completion scriplets for their custom git commands without
modifying the main git bash completion script.

Instead of having a huge hard-coded list of command-completion
function pairs (in _git()), the completion script will figure out
which completion function to call based on the command's name.  That
is, when completing the options of 'git foo', the main completion
script will check whether the function '_git_foo' is declared, and if
declared, it will invoke that function to perform the completion.  If
such a function is not declared, it will fall back to complete file
names.  So, users will only need to provide this '_git_foo' completion
function in a separate file, source that file, and it will be used the
next time they press TAB after 'git foo '.

There are two git commands (stage and whatchanged), for which the
completion functions of other commands were used, therefore they
got their own completion function.

Signed-off-by: SZEDER Gábor <szeder@ira.uka.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2010-02-24 08:32:20 -08:00
Documentation Git 1.7.0 2010-02-12 15:45:05 -08:00
block-sha1
compat Implement pthread_cond_broadcast on Windows 2010-01-29 19:42:40 -08:00
contrib bash: support user-supplied completion scripts for user's git commands 2010-02-24 08:32:20 -08:00
git-gui Merge git://repo.or.cz/git-gui 2010-02-07 15:52:28 -08:00
git_remote_helpers
gitk-git Merge git://git.kernel.org/pub/scm/gitk/gitk 2010-02-05 21:22:59 -08:00
gitweb gitweb: Simplify (and fix) chop_str 2010-02-03 17:14:00 -08:00
perl
ppc
t Sync with 1.6.6.2 2010-02-10 13:46:15 -08:00
templates
xdiff Merge branch 'jc/conflict-marker-size' 2010-01-20 20:28:51 -08:00
.gitattributes
.gitignore Add test-run-command to .gitignore 2010-01-25 09:42:31 -08:00
.mailmap
COPYING Update COPYING with GPLv2 with new FSF address 2010-01-17 14:29:37 -08:00
GIT-VERSION-GEN Git 1.7.0 2010-02-12 15:45:05 -08:00
INSTALL
Makefile Merge branch 'jh/gitweb-caching' (early part) 2010-02-02 21:48:22 -08:00
README
RelNotes Git 1.6.6.2 2010-02-10 13:44:11 -08:00
abspath.c
advice.c Merge branch 'mm/conflict-advice' 2010-01-20 14:42:59 -08:00
advice.h Merge branch 'mm/conflict-advice' 2010-01-20 14:42:59 -08:00
alias.c
alloc.c
archive-tar.c
archive-zip.c
archive.c Merge branch 'jc/conflict-marker-size' 2010-01-20 20:28:51 -08:00
archive.h
attr.c git_attr(): fix function signature 2010-01-16 20:39:59 -08:00
attr.h git_attr(): fix function signature 2010-01-16 20:39:59 -08:00
base85.c Merge branch 'maint-1.6.2' into maint-1.6.3 2010-01-18 21:29:47 -08:00
bisect.c Merge branch 'jc/symbol-static' 2010-01-20 14:37:25 -08:00
bisect.h builtin-rev-list.c: mark file-local function static 2010-01-11 23:16:16 -08:00
blob.c Replace parse_blob() with an explanatory comment 2010-01-18 17:04:02 -08:00
blob.h Replace parse_blob() with an explanatory comment 2010-01-18 17:04:02 -08:00
branch.c branch: warn and refuse to set a branch as a tracking branch of itself. 2010-01-18 17:46:28 -08:00
branch.h
builtin-add.c Remove diff machinery dependency from read-cache 2010-01-21 17:05:13 -08:00
builtin-annotate.c
builtin-apply.c Merge branch 'ag/patch-header-verify' 2010-01-20 20:28:51 -08:00
builtin-archive.c Merge branch 'maint' 2010-02-07 15:52:12 -08:00
builtin-bisect--helper.c
builtin-blame.c Merge branch 'maint-1.6.5' into maint 2010-02-08 21:53:54 -08:00
builtin-branch.c Merge branch 'jc/branch-d' 2010-01-22 16:08:19 -08:00
builtin-bundle.c
builtin-cat-file.c
builtin-check-attr.c git_attr(): fix function signature 2010-01-16 20:39:59 -08:00
builtin-check-ref-format.c
builtin-checkout-index.c
builtin-checkout.c Merge branch 'jc/maint-1.6.1-checkout-m-custom-merge' into maint 2010-02-10 12:54:15 -08:00
builtin-clean.c git-clean: fix the description of the default behavior 2010-02-04 15:12:13 -08:00
builtin-clone.c Merge branch 'tc/clone-v-progress' 2010-01-17 15:58:58 -08:00
builtin-commit-tree.c commit-tree: remove unused #define 2010-01-25 09:53:12 -08:00
builtin-commit.c Merge branch 'nd/status-partial-refresh' 2010-01-20 20:28:50 -08:00
builtin-config.c Merge branch 'jh/maint-config-file-prefix' into maint 2010-02-10 13:02:05 -08:00
builtin-count-objects.c Merge branch 'maint-1.6.3' into maint-1.6.4 2010-01-18 21:37:06 -08:00
builtin-describe.c
builtin-diff-files.c
builtin-diff-index.c
builtin-diff-tree.c
builtin-diff.c
builtin-fast-export.c
builtin-fetch-pack.c
builtin-fetch.c
builtin-fmt-merge-msg.c
builtin-for-each-ref.c
builtin-fsck.c Update git fsck --full short description to mention packs 2010-02-05 13:01:45 -08:00
builtin-gc.c
builtin-grep.c Revert 30816237 and 7e62265 2010-02-05 09:27:25 -08:00
builtin-hash-object.c make "git hash-object" a built-in 2010-01-21 20:07:06 -08:00
builtin-help.c
builtin-index-pack.c make "index-pack" a built-in 2010-01-22 10:10:27 -08:00
builtin-init-db.c
builtin-log.c Merge branch 'jc/maint-limit-note-output' 2010-01-22 16:08:01 -08:00
builtin-ls-files.c Merge branch 'jc/cache-unmerge' 2010-01-20 14:46:35 -08:00
builtin-ls-remote.c
builtin-ls-tree.c
builtin-mailinfo.c
builtin-mailsplit.c
builtin-merge-base.c
builtin-merge-file.c Merge branch 'jc/conflict-marker-size' 2010-01-20 20:28:51 -08:00
builtin-merge-index.c make "merge-index" a built-in 2010-01-22 10:01:21 -08:00
builtin-merge-ours.c
builtin-merge-recursive.c Make "subtree" part more orthogonal to the rest of merge-recursive. 2010-01-17 22:46:28 -08:00
builtin-merge-tree.c merge-tree: remove unnecessary call of git_extract_argv0_path 2010-01-22 10:01:06 -08:00
builtin-merge.c Merge branch 'ap/merge-backend-opts' 2010-01-20 20:28:50 -08:00
builtin-mktag.c make "mktag" a built-in 2010-01-22 10:01:33 -08:00
builtin-mktree.c
builtin-mv.c git-mv: fix moving more than one source to a single destination 2010-01-22 14:31:30 -08:00
builtin-name-rev.c
builtin-pack-objects.c Revert "pack-objects: fix pack generation when using pack_size_limit" 2010-02-08 10:56:21 -08:00
builtin-pack-redundant.c make "git pack-redundant" a built-in 2010-01-22 10:07:14 -08:00
builtin-pack-refs.c
builtin-patch-id.c make "git patch-id" a built-in 2010-01-21 22:06:12 -08:00
builtin-prune-packed.c
builtin-prune.c
builtin-push.c fix off-by-one allocation error 2010-01-29 09:56:12 -08:00
builtin-read-tree.c Merge branch 'jc/fix-tree-walk' 2010-01-24 17:35:58 -08:00
builtin-receive-pack.c
builtin-reflog.c
builtin-remote.c Merge branch 'bg/maint-remote-update-default' into maint 2010-01-20 13:23:59 -08:00
builtin-replace.c
builtin-rerere.c Make 'rerere forget' work from a subdirectory. 2010-01-21 00:42:20 -08:00
builtin-reset.c Merge branch 'cc/reset-more' 2010-01-13 11:58:56 -08:00
builtin-rev-list.c builtin-rev-list.c: mark file-local function static 2010-01-11 23:16:16 -08:00
builtin-rev-parse.c Merge branch 'il/rev-glob' 2010-01-22 16:08:16 -08:00
builtin-revert.c Merge branch 'mm/conflict-advice' 2010-01-20 14:42:59 -08:00
builtin-rm.c rm: only refresh entries that we may touch 2010-01-19 15:04:23 -08:00
builtin-send-pack.c
builtin-shortlog.c
builtin-show-branch.c
builtin-show-ref.c
builtin-stripspace.c
builtin-symbolic-ref.c
builtin-tag.c
builtin-tar-tree.c
builtin-unpack-file.c make "git unpack-file" a built-in 2010-01-22 10:02:16 -08:00
builtin-unpack-objects.c
builtin-update-index.c Merge branch 'jc/cache-unmerge' 2010-01-20 14:46:35 -08:00
builtin-update-ref.c
builtin-update-server-info.c
builtin-upload-archive.c
builtin-var.c make "git var" a built-in 2010-01-21 22:04:42 -08:00
builtin-verify-pack.c
builtin-verify-tag.c
builtin-write-tree.c
builtin.h make "index-pack" a built-in 2010-01-22 10:10:27 -08:00
bundle.c
bundle.h
cache-tree.c
cache-tree.h
cache.h Merge branch 'jc/maint-reflog-bad-timestamp' into maint 2010-02-10 13:02:43 -08:00
check-builtins.sh
check-racy.c
check_bindir
color.c
color.h
combine-diff.c
command-list.txt
commit.c Merge branch 'maint-1.6.5' into maint 2010-01-29 23:36:13 -08:00
commit.h Merge branch 'jc/maint-limit-note-output' 2010-01-22 16:08:01 -08:00
config.c Merge branch 'jc/ident' 2010-01-20 14:39:52 -08:00
config.mak.in Make NO_PTHREADS the sole thread configuration variable 2010-01-31 11:50:50 -08:00
configure.ac Merge branch 'bw/no-python-autoconf' 2010-02-02 21:48:13 -08:00
connect.c Merge branch 'il/maint-colon-address' 2010-01-27 14:56:42 -08:00
convert.c Merge branch 'jc/conflict-marker-size' 2010-01-20 20:28:51 -08:00
copy.c
csum-file.c
csum-file.h
ctype.c
daemon.c Merge branch 'il/maint-colon-address' 2010-01-27 14:56:42 -08:00
date.c Merge branch 'jc/maint-reflog-bad-timestamp' 2010-01-27 14:57:37 -08:00
decorate.c
decorate.h
delta.h
diff-delta.c
diff-lib.c Merge branch 'jl/diff-submodule-ignore' 2010-01-26 22:53:13 -08:00
diff-no-index.c
diff.c Merge branch 'jl/diff-submodule-ignore' 2010-01-26 22:53:13 -08:00
diff.h Merge branch 'jc/fix-tree-walk' 2010-01-24 17:35:58 -08:00
diffcore-break.c
diffcore-delta.c
diffcore-order.c
diffcore-pickaxe.c
diffcore-rename.c
diffcore.h Performance optimization for detection of modified submodules 2010-01-18 17:28:21 -08:00
dir.c Fix memory corruption when .gitignore does not end by \n 2010-01-20 20:01:52 -08:00
dir.h Merge branch 'nd/sparse' 2010-01-13 11:58:34 -08:00
editor.c
entry.c Merge branch 'jc/symbol-static' 2010-01-20 14:37:25 -08:00
environment.c Merge branch 'nd/sparse' 2010-01-13 11:58:34 -08:00
exec_cmd.c
exec_cmd.h
fast-import.c fast-import: count --max-pack-size in bytes 2010-02-04 15:12:17 -08:00
fetch-pack.h
fixup-builtins
fsck.c
fsck.h
generate-cmdlist.sh
git-add--interactive.perl
git-am.sh am: switch --resolved to --continue 2010-02-11 22:10:00 -08:00
git-archimport.perl
git-bisect.sh
git-compat-util.h Merge branch 'il/maint-xmallocz' into maint 2010-02-10 13:02:16 -08:00
git-cvsexportcommit.perl
git-cvsimport.perl cvsimport: standarize system() calls to external git tools 2010-01-19 12:22:19 -08:00
git-cvsserver.perl Merge branch 'gp/maint-cvsserver' 2010-01-28 00:46:33 -08:00
git-difftool--helper.sh Make difftool.prompt fall back to mergetool.prompt 2010-01-22 15:57:45 -08:00
git-difftool.perl difftool: Add '-x' and as an alias for '--extcmd' 2010-01-15 15:04:31 -08:00
git-filter-branch.sh Merge branch 'maint' 2010-02-11 23:06:32 -08:00
git-instaweb.sh fix portability issues with $ in double quotes 2010-01-26 15:16:54 -08:00
git-lost-found.sh
git-merge-octopus.sh
git-merge-one-file.sh
git-merge-resolve.sh
git-mergetool--lib.sh add shebang line to git-mergetool--lib.sh 2010-01-29 09:56:51 -08:00
git-mergetool.sh
git-notes.sh
git-parse-remote.sh
git-pull.sh pull: re-fix command line generation 2010-01-24 10:11:27 -08:00
git-quiltimport.sh
git-rebase--interactive.sh work around an obnoxious bash "safety feature" on OpenBSD 2010-01-26 19:16:02 -08:00
git-rebase.sh rebase: don't invoke the pager for each commit summary 2010-01-30 08:42:42 -08:00
git-relink.perl
git-repack.sh
git-request-pull.sh
git-send-email.perl
git-sh-setup.sh Use $(git rev-parse --show-toplevel) in cd_to_toplevel(). 2010-01-11 19:47:52 -08:00
git-stash.sh
git-submodule.sh git status: Show uncommitted submodule changes too when enabled 2010-01-17 15:55:11 -08:00
git-svn.perl git-svn: persistent memoization 2010-02-04 23:33:25 -08:00
git-web--browse.sh
git.c Revert 30816237 and 7e62265 2010-02-05 09:27:25 -08:00
git.spec.in RPM packaging: use %global inside %{!?...} 2010-01-31 11:33:44 -08:00
graph.c
graph.h
grep.c grep: simplify assignment of ->fixed 2010-02-03 12:03:40 -08:00
grep.h Threaded grep 2010-01-26 09:20:07 -08:00
hash.c
hash.h
help.c
help.h
hex.c slim down "git show-index" 2010-01-21 20:03:45 -08:00
http-backend.c
http-fetch.c
http-push.c
http-walker.c
http.c http.c: mark file-local functions static 2010-01-12 01:06:08 -08:00
http.h http.c: mark file-local functions static 2010-01-12 01:06:08 -08:00
ident.c ident.c: replace fprintf with fputs to suppress compiler warning 2010-01-19 15:25:38 -08:00
imap-send.c Merge branch 'maint' 2010-02-08 21:54:10 -08:00
levenshtein.c
levenshtein.h
list-objects.c
list-objects.h
ll-merge.c Merge branch 'jc/conflict-marker-size' 2010-01-20 20:28:51 -08:00
ll-merge.h Merge branch 'jc/conflict-marker-size' 2010-01-20 20:28:51 -08:00
lockfile.c lockfile: show absolute filename in unable_to_lock_message 2010-01-12 15:48:24 -08:00
log-tree.c Fix "log" family not to be too agressive about showing notes 2010-01-20 19:57:02 -08:00
log-tree.h
mailmap.c mailmap.c: remove unused function 2010-01-12 01:06:09 -08:00
mailmap.h mailmap.c: remove unused function 2010-01-12 01:06:09 -08:00
match-trees.c Make "subtree" part more orthogonal to the rest of merge-recursive. 2010-01-17 22:46:28 -08:00
merge-file.c merge-tree: use ll_merge() not xdl_merge() 2010-01-16 23:45:33 -08:00
merge-recursive.c Merge branch 'maint' 2010-01-21 20:08:31 -08:00
merge-recursive.h Merge branch 'ap/merge-backend-opts' 2010-01-20 20:28:50 -08:00
name-hash.c
notes.c
notes.h
object.c object.c: remove unused functions 2010-01-17 22:49:36 -08:00
object.h object.c: remove unused functions 2010-01-17 22:49:36 -08:00
pack-check.c
pack-refs.c
pack-refs.h
pack-revindex.c
pack-revindex.h
pack-write.c make "index-pack" a built-in 2010-01-22 10:10:27 -08:00
pack.h make "index-pack" a built-in 2010-01-22 10:10:27 -08:00
pager.c
parse-options.c Merge branch 'jc/symbol-static' 2010-01-20 14:37:25 -08:00
parse-options.h Merge branch 'jc/symbol-static' 2010-01-20 14:37:25 -08:00
patch-delta.c Fix integer overflow in patch_delta() 2010-01-26 12:57:59 -08:00
patch-ids.c
patch-ids.h
path.c ignore duplicated slashes in make_relative_path() 2010-01-22 15:34:56 -08:00
pkt-line.c
pkt-line.h
preload-index.c Make ce_uptodate() trustworthy again 2010-01-24 00:15:29 -08:00
pretty.c Merge branch 'jc/maint-limit-note-output' 2010-01-22 16:08:01 -08:00
progress.c
progress.h
quote.c Fix invalid read in quote_c_style_counted 2010-02-06 10:55:03 -08:00
quote.h quote.c: mark file-local function static 2010-01-12 01:06:08 -08:00
reachable.c
reachable.h
read-cache.c Correct spelling of 'REUC' extension 2010-02-02 09:54:34 -08:00
reflog-walk.c
reflog-walk.h
refs.c rev-parse --branches/--tags/--remotes=pattern 2010-01-20 12:30:25 -08:00
refs.h rev-parse --branches/--tags/--remotes=pattern 2010-01-20 12:30:25 -08:00
remote-curl.c Merge branch 'maint' 2010-01-21 20:08:31 -08:00
remote.c
remote.h
replace_object.c
rerere.c rerere: fix too-short initialization 2010-01-28 09:30:14 -08:00
rerere.h Merge branch 'jc/cache-unmerge' 2010-01-20 14:46:35 -08:00
resolve-undo.c build: make code "-Wpointer-arith" clean 2010-02-01 22:04:03 -08:00
resolve-undo.h build: make code "-Wpointer-arith" clean 2010-02-01 22:04:03 -08:00
revision.c Fix log -g this@{upstream} 2010-01-26 13:49:50 -08:00
revision.h Fix "log" family not to be too agressive about showing notes 2010-01-20 19:57:02 -08:00
run-command.c Merge branch 'js/exec-error-report' 2010-01-20 14:44:12 -08:00
run-command.h
send-pack.h
server-info.c
setup.c Merge branch 'bk/fix-relative-gitdir-file' 2010-01-20 14:38:34 -08:00
sha1-lookup.c
sha1-lookup.h
sha1_file.c Merge branch 'il/maint-xmallocz' 2010-01-27 14:56:38 -08:00
sha1_name.c reject @{-1} not at beginning of object name 2010-01-28 12:12:50 -08:00
shallow.c
shell.c
shortlog.h
show-index.c slim down "git show-index" 2010-01-21 20:03:45 -08:00
sideband.c
sideband.h
sigchain.c
sigchain.h
strbuf.c Merge branch 'ap/merge-backend-opts' 2010-01-20 20:28:50 -08:00
strbuf.h Merge branch 'jc/maint-strbuf-add-fix-doubling' 2010-01-20 14:43:09 -08:00
string-list.c
string-list.h
submodule.c Fix memory leak in submodule.c 2010-01-31 10:25:23 -08:00
submodule.h Teach diff --submodule that modified submodule directory is dirty 2010-01-24 21:04:31 -08:00
symlinks.c symlinks.c: remove unused functions 2010-01-17 22:49:36 -08:00
tag.c
tag.h
tar.h
test-chmtime.c
test-ctype.c
test-date.c
test-delta.c
test-dump-cache-tree.c
test-genrandom.c
test-index-version.c
test-match-trees.c
test-parse-options.c
test-path-utils.c
test-run-command.c start_command: detect execvp failures early 2010-01-10 10:15:03 -08:00
test-sha1.c
test-sha1.sh
test-sigchain.c
thread-utils.c
thread-utils.h
trace.c
transport-helper.c Merge branch 'js/exec-error-report' 2010-01-20 14:44:12 -08:00
transport.c transport_get(): drop unnecessary check for !remote 2010-01-27 12:22:37 -08:00
transport.h Merge branch 'il/push-set-upstream' 2010-01-20 14:40:48 -08:00
tree-diff.c Performance optimization for detection of modified submodules 2010-01-18 17:28:21 -08:00
tree-walk.c
tree-walk.h
tree.c
tree.h
unimplemented.sh
unpack-trees.c Merge branch 'jc/fix-tree-walk' 2010-01-24 17:35:58 -08:00
unpack-trees.h Merge branch 'jc/fix-tree-walk' 2010-01-24 17:35:58 -08:00
upload-pack.c
usage.c
userdiff.c git_attr(): fix function signature 2010-01-16 20:39:59 -08:00
userdiff.h
utf8.c utf8.c: mark file-local function static 2010-01-12 01:06:09 -08:00
utf8.h utf8.c: mark file-local function static 2010-01-12 01:06:09 -08:00
walker.c
walker.h
wrap-for-bin.sh
wrapper.c Add xmallocz() 2010-01-26 12:57:53 -08:00
write_or_die.c
ws.c git_attr(): fix function signature 2010-01-16 20:39:59 -08:00
wt-status.c Merge branch 'jl/submodule-diff' 2010-01-22 16:08:10 -08:00
wt-status.h
xdiff-interface.c
xdiff-interface.h

README

////////////////////////////////////////////////////////////////

	GIT - the stupid content tracker

////////////////////////////////////////////////////////////////

"git" can mean anything, depending on your mood.

 - random three-letter combination that is pronounceable, and not
   actually used by any common UNIX command.  The fact that it is a
   mispronunciation of "get" may or may not be relevant.
 - stupid. contemptible and despicable. simple. Take your pick from the
   dictionary of slang.
 - "global information tracker": you're in a good mood, and it actually
   works for you. Angels sing, and a light suddenly fills the room.
 - "goddamn idiotic truckload of sh*t": when it breaks

Git is a fast, scalable, distributed revision control system with an
unusually rich command set that provides both high-level operations
and full access to internals.

Git is an Open Source project covered by the GNU General Public License.
It was originally written by Linus Torvalds with help of a group of
hackers around the net. It is currently maintained by Junio C Hamano.

Please read the file INSTALL for installation instructions.

See Documentation/gittutorial.txt to get started, then see
Documentation/everyday.txt for a useful minimum set of commands, and
Documentation/git-commandname.txt for documentation of each command.
If git has been correctly installed, then the tutorial can also be
read with "man gittutorial" or "git help tutorial", and the
documentation of each command with "man git-commandname" or "git help
commandname".

CVS users may also want to read Documentation/gitcvs-migration.txt
("man gitcvs-migration" or "git help cvs-migration" if git is
installed).

Many Git online resources are accessible from http://git-scm.com/
including full documentation and Git related tools.

The user discussion and development of Git take place on the Git
mailing list -- everyone is welcome to post bug reports, feature
requests, comments and patches to git@vger.kernel.org. To subscribe
to the list, send an email with just "subscribe git" in the body to
majordomo@vger.kernel.org. The mailing list archives are available at
http://marc.theaimsgroup.com/?l=git and other archival sites.

The messages titled "A note from the maintainer", "What's in
git.git (stable)" and "What's cooking in git.git (topics)" and
the discussion following them on the mailing list give a good
reference for project status, development direction and
remaining tasks.