Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] _git: offer files relative to current directory



On Tue, Dec 08, 2009 at 11:50:18AM +0100, Nikolai Weibull wrote:
> On Tue, Dec 8, 2009 at 11:48, ÅtÄpÃn NÄmec <stepnem@xxxxxxxxx> wrote:
> 
> > In a repository where `git status' reports the following changed files:
> > # Â Â Â modified: Â doc/tags
> > # Â Â Â modified: Â filetype.vim
> > # Â Â Â modified: Â ftplugin/vim.vim
> > # Â Â Â modified: Â ftplugin/zsh.vim
> > # Â Â Â modified: Â indent/sh.vim
> > # Â Â Â modified: Â plugin/utl.vim
> > # Â Â Â modified: Â snippets/_.snippets
> > # Â Â Â modified: Â syntax/elisp.vim
> > # Â Â Â modified: Â syntax/sh.vim
> > # Â Â Â modified: Â syntax/vim.vim
> >
> > `git commit <tab>' only suggests:
> > doc      filetype.vim Âftplugin   Âindent    Âplugin    Âsnippets   Âsyntax
> 
> Whyâs that wrong?  Completing git commit syntax hopefully adds a slash
> and lets you complete the files in the sub-folder, right?

    Yes, you're right, even though I still prefer when `git ci <tab>' shows
and completes all the files immediately, not forcing me into first
deleting the completed slash and then continue completing the files in
the directory... But I guess Alexey's version might actually be more
consistent with Zsh's behaviour in that regard in other similar
situations. So, sorry for that point.

    Unfortunately, there seem to be other problems:
When I enter the doc directory in the above structure, `git commit
<tab>' only shows:

.. tags

instead of all the other changed files/directories (displayed relative
to the current subdirectory). Wasn't exactly that the problem we are
solving here?


    ÅtÄpÃn

P.S.: Well now I think about it, of course you can just continue to
"manually" complete the `..', so in my case I have to first complete
../, then delete and recomplete the '/' or add and delete a space, then
continue similarly to get to the other files. Maybe it is the behaviour
you expect and like, but for me it's really suboptimal. Maybe it's just
some problem in my setup? Anyway, with my solution, git ci <tab> always
completes and shows all the files relative to the current directory,
i.e. in the form git-commit will accept, *immediately*. I still very
much prefer that behaviour.



Messages sorted by: Reverse Date, Date, Thread, Author