From: Manlio Perillo <manlio.perillo@gmail.com>
To: Marc Khouzam <marc.khouzam@ericsson.com>
Cc: 'Junio C Hamano' <gitster@pobox.com>,
'Michael J Gruber' <git@drmicha.warpmail.net>,
'wookietreiber' <kizkizzbangbang@googlemail.com>,
"'git@vger.kernel.org'" <git@vger.kernel.org>
Subject: Re: [feature request] git add completion should exclude staged content
Date: Wed, 30 Jan 2013 19:24:03 +0100 [thread overview]
Message-ID: <51096543.9050100@gmail.com> (raw)
In-Reply-To: <E59706EF8DB1D147B15BECA3322E4BDC097A7E@eusaamb103.ericsson.se>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Il 30/01/2013 15:06, Marc Khouzam ha scritto:
> [...]
>> I will try to update the patch, with your latest suggestions (avoid
>> tricky POSIX shell syntax, and CDPATH issue - if I remember
>> correctly),
>> and with an update for the t/t9902-completion.sh test (that I
>> completely
>> missed).
>
> Hi Manlio,
>
Hi.
> I'm trying to update git-completion.tcsh to work properly with
> your nice new completion feature. But I'm having trouble with
> the missing '/' at the end of directories.
>
> The new logic in git-completion.bash tells bash that 'filenames'
> completion is ongoing so bash will add a '/' after directories.
> Sadly, tcsh won't do that, so it would be simpler if
> git-completion.bash added the '/' itself. I looked at the
> git-completion.bash script changes and I noticed that for
> bash version < 4, you have to add the '/' yourself.
The compatible version is not only required for Bash; you can use it for
other shells.
Try to redefine the __git_index_file_list_filter function to use the
version that adds a slash to directory names.
> I also noticed the following comment:
>
> # XXX if we append a slash to directory names when using
> # `compopt -o filenames`, Bash will append another slash.
> # This is pretty stupid, and this the reason why we have to
> # define a compatible version for this function.
>
> So I gather you would rather add a '/' all the time to deal
> with older bash version transparently. This would be great
> for tcsh also. I'm trying to figure out
> when bash mis-behaves when you add the '/' all the time?
> When I try it (I have bash 4.1.5(1)-release) I didn't run
> into the double slash problem you mention in the comment.
>
I'm using the same version: 4.1.5(1), on Debian stable.
> I'm hoping we can straighten this out and have
> git-completion.bash add the '/' all the time.
>
> Could you explain when the problem happens?
>
Bash 4.1.5(1) always adds an additional slash for directories.
I have tested it right now: change the filter function to use the
compatible version:
__git_index_file_list_filter ()
{
# Default to Bash >= 4.x
__git_index_file_list_filter_compat
}
Then running `git add <TAB>` inside the git repository, I get this file
completion list:
$ git add <TAB>
contrib//
> Thanks
>
Thanks to you
Manlio
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAlEJZUMACgkQscQJ24LbaUQUGACgkMG/bZrJKBzlZ8toEQwmggQX
m9kAn2ATJbSp87kOkoCCc00eHmh71r3y
=D9iu
-----END PGP SIGNATURE-----
next prev parent reply other threads:[~2013-01-30 18:24 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-26 17:21 [feature request] git add completion should exclude staged content wookietreiber
2013-01-27 23:00 ` Junio C Hamano
2013-01-28 9:26 ` Manlio Perillo
2013-01-28 12:52 ` Michael J Gruber
2013-01-28 14:02 ` Manlio Perillo
2013-01-28 16:22 ` Michael J Gruber
2013-01-28 17:52 ` Junio C Hamano
2013-01-28 20:16 ` Manlio Perillo
2013-01-30 14:06 ` Marc Khouzam
2013-01-30 18:24 ` Manlio Perillo [this message]
2013-01-30 18:55 ` Marc Khouzam
2013-01-30 19:58 ` Manlio Perillo
2013-01-28 20:13 ` Manlio Perillo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51096543.9050100@gmail.com \
--to=manlio.perillo@gmail.com \
--cc=git@drmicha.warpmail.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=kizkizzbangbang@googlemail.com \
--cc=marc.khouzam@ericsson.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).