summaryrefslogtreecommitdiff
path: root/contrib/completion
AgeCommit message (Collapse)AuthorFilesLines
2008-03-10bash: fix long option with argument double completionLibravatar SZEDER Gábor1-7/+15
Pressing TAB right after 'git command --long-option=' results in 'git command --long-option=--long-option=' when the long option requires an argument, but we don't provide completion for its arguments (e.g. commit --author=, apply --exclude=). This patch detects these long options and provides empty completion array for them. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-03-10bash: Add more long options to be completed with "git --<TAB>"Libravatar Teemu Likonen1-0/+3
Add the following long options to be completed with command "git": --paginate --work-tree= --help Signed-off-by: Teemu Likonen <tlikonen@iki.fi> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-03-10bash: use __gitdir when completing 'git rebase' optionsLibravatar SZEDER Gábor1-2/+2
When doing completion of rebase options in a subdirectory of the work tree during an ongoing rebase, wrong options were offered because of the hardcoded .git/.dotest-merge path. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-03-10bash: Remove completion of core.legacyheaders optionLibravatar Shawn O. Pearce1-1/+0
This option is no longer recognized by git. Completing it is not worthwhile. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-03-10bash: add 'git svn' subcommands and optionsLibravatar SZEDER Gábor1-1/+80
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-03-10bash: add new 'git stash' subcommandsLibravatar SZEDER Gábor1-1/+1
Namely 'save', 'drop', 'pop' and 'create' Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-03-10bash: refactor searching for subcommands on the command lineLibravatar SZEDER Gábor1-39/+32
This patch adds the __git_find_subcommand function, which takes one argument: a string containing all subcommands separated by spaces. The function searches through the command line whether a subcommand is already present. The first found subcommand will be printed to standard output. This enables us to remove code duplications from completion functions for commands having subcommands. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-03-10bash: remove unnecessary conditions when checking for subcommandsLibravatar SZEDER Gábor1-4/+4
Checking emptyness of $command is sufficient. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-03-10bash: Properly quote the GIT_DIR at all times to fix subdirectory paths with ↵Libravatar Kevin Ballard1-4/+4
spaces Signed-off-by: Kevin Ballard <kevin@sb.org> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2008-03-08Merge branch 'jc/am'Libravatar Junio C Hamano1-1/+9
* jc/am: am: --rebasing am: remove support for -d .dotest am: read from the right mailbox when started from a subdirectory
2008-03-05bash: git-branch -d and -m lists only local branchesLibravatar SZEDER Gábor1-1/+18
But still all branches are listed, if -r is present Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-05bash: add git-branch optionsLibravatar SZEDER Gábor1-1/+10
Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-03-05am: --rebasingLibravatar Junio C Hamano1-1/+9
The new option --rebasing is used internally for rebase to tell am that it is being used for its purpose. This would leave .dotest/rebasing to help "completion" scripts tell if the ongoing operation is am or rebase. Also the option at the same time stands for --binary, -3 and -k which are always given when rebase drives am as its backend. Using the information "am" leaves, git-completion.bash tells ongoing rebase and am apart. Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-27completion: support format-patch's --cover-letter optionLibravatar Johannes Schindelin1-0/+1
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-24Use git-describe --exact-match in bash prompt on detached HEADLibravatar Shawn O. Pearce1-1/+4
Most of the time when I am on a detached HEAD and I am not doing a rebase or bisect operation the working directory is sitting on a tagged release of the repository. Showing the tag name instead of the commit SHA-1 is much more descriptive and a much better reminder of the state of this working directory. Now that git-describe --exact-match is available as a cheap means of obtaining the exact annotated tag or nothing at all, we can favor the annotated tag name over the abbreviated commit SHA-1. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-02-06Improve bash prompt to detect various states like an unfinished mergeLibravatar Robin Rosenberg1-4/+33
This patch makes the git prompt (when enabled) show if a merge or a rebase is unfinished. It also detects if a bisect is being done as well as detached checkouts. An uncompleted git-am cannot be distinguised from a rebase (the non-interactive version). Instead of having an even longer prompt we simply ignore that and hope the power users that use git-am knows the difference. Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com> Acked-by: Shawn O. Pearce <spearce@spearce.org>
2008-01-19Update git-completion for new 'remote rm' optionLibravatar Dan McGee1-3/+3
Signed-off-by: Dan McGee <dpmcgee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2008-01-17Officially deprecate repo-config.Libravatar Junio C Hamano1-1/+1
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-12-16teach bash completion to treat commands with "--" as a helperLibravatar Jeff King1-2/+1
There is a convention that commands containing a double-dash are implementation details and not to be used by mortals. We should automatically remove them from the completion suggestions as such. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-11-28bash completion: add diff optionsLibravatar Johannes Schindelin1-0/+14
I use "git diff" (the porcelain) really often, and am almost as often annoyed that the completions do not know how to complete something simple as --cached. Now they do. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-10-30No longer install git-svnimport, move to contrib/examplesLibravatar Gerrit Pape1-1/+0
This has been proposed for a few times without much reaction from the list. Actually remove it to see who screams. Signed-off-by: Gerrit Pape <pape@smarden.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-09-25Move convert-objects to contrib.Libravatar Matt Kraai1-1/+0
convert-objects was needed to convert from an old-style repository, which hashed the compressed contents and used a different date format. Such repositories are presumably no longer common and, if such conversions are necessary, should be done by writing a frontend for git-fast-import. Linus, the original author, is OK with moving it to contrib. Signed-off-by: Matt Kraai <kraai@ftbfs.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-31Teach bash about completing arguments for git-tagLibravatar Shawn O. Pearce1-0/+58
Lately I have been doing a lot of calls to `git tag -d` and also to `git tag -v`. In both such cases being able to complete the names of existing tags saves the fingers some typing effort. We now look for the -d or -v option to git-tag in the bash completion support and offer up existing tag names as possible choices for these. When creating a new tag we now also offer bash completion support for the second argument to git-tag (the object to be tagged) as this can often be a specific existing branch name and is not necessarily the current HEAD. If the -f option is being used to recreate an existing tag we now also offer completion support on the existing tag names for the first argument of git-tag, helping to the user to reselect the prior tag name that they are trying to replace. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-08-29completion: also complete git-log's --left-right and --cherry-pick optionLibravatar Johannes Schindelin1-0/+1
Both --left-right and --cherry-pick are particularly long to type, so help the user there. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-08-23Teach bash about git-submodule and its subcommandsLibravatar Shawn O. Pearce1-0/+27
The git-submodule command is new in 1.5.3 and contains a number of useful subcommands for working on submodules. We usually try to offer the subcommands of a git command in the bash completion, so here they are for git-submodule. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-08-23Teach bash to complete ref arguments to git-describeLibravatar Shawn O. Pearce1-0/+8
I'm often finding that I need to run git-describe on very long remote tracking branch names, to find out what tagged revision the remote tracking branch is now at (or not at). Typing out the ref names is painful, so bash completion on them is a very useful feature. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-08-23Update bash completion with new 1.5.3 command line optionsLibravatar Shawn O. Pearce1-6/+26
A number of commands have learned new tricks as part of git 1.5.3. If these are long options (--foo) we tend to support them in the bash completion, as it makes the user's task of using the option slightly easier. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-08-19git-completion.bash - add support for git-bundleLibravatar Mark Levedahl1-0/+32
Signed-off-by: Mark Levedahl <mdl123@verizon.net> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-08-04git-completion: add "git stash"Libravatar Junio C Hamano1-0/+7
This is a new addition to 1.5.3; let's teach it to the completion before the final release. [sp: Added missing git-stash completion configuration] Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-06-24Teach bash how to complete +refspec on git-pushLibravatar Shawn O. Pearce1-0/+3
Using `git push origin +foo` to forcefully overwrite the remote branch named foo is a common idiom, especially since + is shorter than the long option --force and can be specified on a per-branch basis. We now complete `git push origin +foo` just like we do the standard `git push origin foo`. The leading + on a branch refspec does not alter the completion. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-06-22Avoid src:dst syntax as default bash completion for git pushLibravatar Shawn O. Pearce1-1/+1
Raimund Bauer just discovered that the default bash completion for a local branch name in a git-push line is not the best choice when the branch does not exist on the remote system. In the past we have always completed the local name 'test' as "test:test", indicating that the destination name is the same as the local name. But this fails when "test" does not yet exist on the remote system, as there is no "test" branch for it to match the name against. Fortunately git-push does the right thing when given just the local branch, as it assumes you want to use the same name in the destination repository. So we now offer "test" as the completion in a git-push line, and let git-push assume that is also the remote branch name. We also still support the remote branch completion after the :, but only if the user manually adds the colon before trying to get a completion. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-05-24Update bash completion for git-config optionsLibravatar Shawn O. Pearce1-2/+12
A few new configuration options grew out of the woodwork during the 1.5.2 series. Most of these are pretty easy to support a completion of, so we do so. I wanted to also add completion support for the <driver> part of merge.<driver>.name but to do that we have to look at all of the .gitattributes files and guess what the unique set of <driver> strings would be. Since this appears to be non-trivial I'm punting on it at this time. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-05-24Teach bash completion about recent log long optionsLibravatar Shawn O. Pearce1-2/+2
(Somewhat) recently git-log learned about --reverse (to show commits in the opposite order) and a looong time ago I think it learned about --raw (to show the raw diff, rather than a unified diff). These are both useful options, so we should make them easy for the user to complete. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-05-24Teach bash completion about 'git remote update'Libravatar Shawn O. Pearce1-2/+14
Recently the git-remote command grew an update subcommand, which can be used to execute git-fetch across multiple repositories in a single step. These can be configured with the 'remotes.*' configuration options, so we can offer completion for any name that matches and appears to be useful to git-remote update. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-05-24Update bash completion header documentationLibravatar Shawn O. Pearce1-1/+14
1) Added a note about supporting the long options for most commands, as we have been doing so for quite some time. 2) Include a notice that these routines are covered by the GPL, as that may not be obvious, even though they are distributed as part of the core Git distribution. 3) Added a short section on how to send patches to the routines, and to whom they should get sent to. Currently that is me, as I am the active maintainer. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-05-24Remove a duplicate --not option in bash completionLibravatar Shawn O. Pearce1-1/+1
This was just me being silly; I put the --not option into the completion list twice. There's no duplicates shown in the shell as the shell removes them before showing them to the user. But we really don't need the duplicates in the source script either. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-05-24Teach bash completion about git-shortlogLibravatar Shawn O. Pearce1-0/+23
We've had completion for git-log for quite some time, but just today I noticed we don't have it for the new builtin shortlog that runs git-log internally. This is indeed a handy thing to have completion for, especially when your branch names are of the Very-Very-Long-and-Hard/To-Type/Variety/That-Some-Use. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-05-24Hide the plumbing diff-{files,index,tree} from bash completionLibravatar Shawn O. Pearce1-3/+3
The diff-* programs are meant to be plumbing for the diff frontend; most end users aren't invoking these commands directly. Consequently we should avoid showing them as possible completions. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-05-21Update bash completion to ignore some more plumbing commandsLibravatar Jonas Fonseca1-0/+3
[sp: Modified Jonas' original patch to keep checkout-index as a a valid completion.] Signed-off-by: Jonas Fonseca <fonseca@diku.dk> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-04-23Add clean.requireForce option, and add -f option to git-clean to override itLibravatar Josh Triplett1-0/+1
Add a new configuration option clean.requireForce. If set, git-clean will refuse to run, unless forced with the new -f option, or not acting due to -n. Signed-off-by: Josh Triplett <josh@freedesktop.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-12Remove git-diff-stages.Libravatar Junio C Hamano1-1/+0
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-12Remove git-resolve.Libravatar Junio C Hamano1-1/+0
Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-11bash: Hide git-fast-import.Libravatar Shawn O. Pearce1-0/+1
The new git-fast-import command is not intended to be invoked directly by an end user. So offering it as a possible completion for a subcommand is not very useful. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
2007-02-05bash: Complete git-remote subcommands.Libravatar Shawn O. Pearce1-0/+28
Completing the 3 core subcommands to git-remote, along with the names of remotes for 'show' and 'prune' (which take only existing remotes) is handy. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-05bash: Support git-rebase -m continuation completion.Libravatar Shawn O. Pearce1-1/+1
Apparently `git-rebase -m` uses a metadata directory within .git (.git/.dotest-merge) rather than .dotest used by git-am (and git-rebase without the -m option). This caused the completion code to not offer --continue, --skip or --abort when working within a `git-rebase -m` session. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-05bash: Support git-bisect and its subcommands.Libravatar Shawn O. Pearce1-0/+31
We now offer completion support for git-bisect's subcommands, as well as ref name completion on the good/bad/reset subcommands. This should make interacting with git-bisect slightly easier on the fingers. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-05bash: Support --add completion to git-config.Libravatar Shawn O. Pearce1-1/+1
We've recently added --add as an argument to git-config, but I missed putting it into the earlier round of git-config updates within the bash completion. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-05bash: Hide git-resolve, its deprecated.Libravatar Shawn O. Pearce1-0/+1
Don't offer resolve as a possible subcommand completion. If you read the top of the script, there is a big warning about how it will go away soon in the near future. People should not be using it. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-05bash: Offer --prune completion for git-gc.Libravatar Shawn O. Pearce1-0/+14
I'm lazy. I don't want to type out --prune if bash can do it for me with --<tab>. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>
2007-02-05bash: Hide diff-stages from completion.Libravatar Shawn O. Pearce1-0/+1
Apparently nobody really makes use of git-diff-stages, as nobody has complained that it is not supported by the git-diff frontend. Since its likely this will go away in the future, we should not offer it as a possible subcommand completion. Signed-off-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <junkio@cox.net>