From: Rob Sanheim <hidden> Date: 2016-06-15 22:45:26
This is pretty trivial, but I'm a lazy typist.
Is it possible to alias 'g' to git via git config, instead of via
bash? If I do a plain bash alias then none of the nice autocompletion
from git-contrib work with 'g'.
- Rob
From: Shawn O. Pearce <hidden> Date: 2016-06-15 22:45:26
Rob Sanheim [off-list ref] wrote:
This is pretty trivial, but I'm a lazy typist.
Is it possible to alias 'g' to git via git config, instead of via
bash? If I do a plain bash alias then none of the nice autocompletion
from git-contrib work with 'g'.
No, you'll need to alias 'g' to git in bash, and then if you still
want completion you'll need to also register the compgen to call
_git completion routine. Its two lines:
alias g=git
complete -o default -o nospace -F _git g
--
Shawn.
From: Rob Sanheim <hidden> Date: 2016-06-15 22:45:26
Thanks, that did it.
On Thu, Oct 2, 2008 at 11:10 PM, Shawn O. Pearce [off-list ref] wrote:
Rob Sanheim [off-list ref] wrote:
quoted
This is pretty trivial, but I'm a lazy typist.
Is it possible to alias 'g' to git via git config, instead of via
bash? If I do a plain bash alias then none of the nice autocompletion
from git-contrib work with 'g'.
No, you'll need to alias 'g' to git in bash, and then if you still
want completion you'll need to also register the compgen to call
_git completion routine. Its two lines:
alias g=git
complete -o default -o nospace -F _git g
--
Shawn.
From: Thomas Rast <hidden> Date: 2016-06-15 22:45:26
---
Rob Sanheim wrote:
On Thu, Oct 2, 2008 at 11:10 PM, Shawn O. Pearce [off-list ref] wrote:
quoted
No, you'll need to alias 'g' to git in bash, and then if you still
want completion you'll need to also register the compgen to call
_git completion routine. Its two lines:
alias g=git
complete -o default -o nospace -F _git g
Thanks, that did it.
Actually it's not enough, you need to teach fetch, pull and push to
recognise the new alias too, as in this patch. I do wonder if there's
a better approach to those functions however, so that the "obvious"
fix suggested by Shawn would work.
- Thomas
contrib/completion/git-completion.bash | 7 ++++---
1 files changed, 4 insertions(+), 3 deletions(-)
@@ -1717,6 +1717,7 @@ _gitk ()}complete-odefault-onospace-F_gitgit+complete-odefault-onospace-F_gitgcomplete-odefault-onospace-F_gitkgitk# The following are necessary only for Cygwin, and only are needed
From: SZEDER Gábor <hidden> Date: 2016-06-15 22:45:26
We don't provide complation for git-commands in dashed form anymore,
so there is no need to keep those cases.
Signed-off-by: SZEDER Gábor <redacted>
---
On Fri, Oct 03, 2008 at 06:35:05PM +0200, Thomas Rast wrote:
Actually it's not enough, you need to teach fetch, pull and push to
recognise the new alias too, as in this patch. I do wonder if there's
a better approach to those functions however, so that the "obvious"
fix suggested by Shawn would work.