I have the same need, and thanks for the aliases, now I can do it :).
> Now it would be cool, to have an alias to cd into a specific subdir of the 
> git 
> worktree and have zsh (or bash) auto completion for this like
> git clone git://git.kernel.org/pub/scm/git/git.git
> cd git/gitweb/static/js/lib (just to be somewhere deep)
> cdgit con<tab>/com<tab> (becomes: cdgit contrib/completion)
> Somebody with zsh/bash skills who already did this?

I'm no zsh expert but a potential solution on zsh could be the use of
*hashes*. An hash is a shortcut in zsh. For example, having the following :

hash -d github=$HOME/src/github

You can use do things like :

cd ~github/vdemeester

And zsh completion work as usual.

Having a code in zshrc that update the hash for the current git root
directory (or clean it if not in a git working directory) would do the

But it's zsh-only and I'm not sure if it would be better or worst in
term of performance

  __o       Vincent Demeester
 _<_\,_     http://vincent.demeester.fr
(_)|'(_)    GPG: 68FDEBFE

Attachment: signature.asc
Description: OpenPGP digital signature

vcs-home mailing list

Reply via email to