Code

Take --git-dir into consideration during bash completion.
authorShawn O. Pearce <spearce@spearce.org>
Sun, 5 Nov 2006 11:21:57 +0000 (06:21 -0500)
committerJunio C Hamano <junkio@cox.net>
Sun, 5 Nov 2006 21:36:33 +0000 (13:36 -0800)
commit873537fadc9bdc35726d1c69c46926c7f5c49dd2
tree9c2f1821776b9e3893158a619a7d72282debe0c6
parent56fc25f21e280c4f3816e989b34d08d7d7cc59fc
Take --git-dir into consideration during bash completion.

If the user has setup a command line of "git --git-dir=baz" then
anything we complete must be performed within the scope of "baz"
and not the current working directory.

This is useful with commands such as "git --git-dir=git.git log m"
to complete out "master" and view the log for the master branch of
the git.git repository.  As a nice side effect this also works for
aliases within the target repository, just as git would honor them.

Unfortunately because we still examine arguments by absolute position
in most of the more complex commands (e.g. git push) using --git-dir
with those commands will probably still cause completion to fail.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
contrib/completion/git-completion.bash