{"thread":{"id":"32732","subject":"[feature request] git add completion should exclude staged content","startedAt":"2013-01-26T17:21:37Z","lastAt":"2013-01-30T19:58:01Z","messageCount":13,"participants":["wookietreiber","Junio C Hamano","Manlio Perillo","Michael J Gruber","Marc Khouzam"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"207882","messageId":"20130126172137.GB5852@mobster.11n_AP_Router","threadId":"32732","inReplyTo":null,"subject":"[feature request] git add completion should exclude staged content","fromName":"wookietreiber","fromEmail":"kizkizzbangbang@googlemail.com","sentAt":"2013-01-26T17:21:37Z","receivedAt":"2013-01-26T17:21:37Z","isPatch":false,"sender":{"key":"kizkizzbangbang@googlemail.com","avatar":null},"body":"Dear Git Hackers,\n\nI have a feature request for `git add` auto completion:\n\n`git add` auto completion suggests all files / directories, filtered by nothing. I guess it would be\nmuch nicer (as in increasing productivity) if it would only suggest unstaged content, as reported by\n`git status`, because that would be the only content one would be able to add.\n\nExample:\n\n    $ git status\n    # On branch develop\n    # Changes to be committed:\n    #   (use \"git reset HEAD <file>...\" to unstage)\n    #\n    #       modified:   src/main/scala/XYChart.scala\n    #\n    # Untracked files:\n    #   (use \"git add <file>...\" to include in what will be committed)\n    #\n    #       notes/0.2.0.markdown\n\n    $ git add <auto-complete>\n    build.sbt              .ensime                .git/                  project/               scalastyle-config.xml  todo\n    COPYING                .ensime_lucene/        notes/                 README.md              src/\n    $ git add\n\nWhere it should be:\n\n    $ git add <auto-complete>\n    $ git add notes/0.2.0.markdown\n\n... because `notes/0.2.0.markdown` is the only thing I can add.\n\n\n-- \n\nBeste Grüße / Best Regards\nChristian Krause aka wookietreiber\n\n-----------------------------------------------------------------------\n\nEGAL WIE DICHT DU BIST, GOETHE WAR DICHTER.\n"},{"id":"208000","messageId":"7vip6iteod.fsf@alter.siamese.dyndns.org","threadId":"32732","inReplyTo":"20130126172137.GB5852@mobster.11n_AP_Router","subject":"Re: [feature request] git add completion should exclude staged content","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-01-27T23:00:02Z","receivedAt":"2013-01-27T23:00:02Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"wookietreiber <kizkizzbangbang@googlemail.com> writes:\n\n> I have a feature request for `git add` auto completion:\n>\n> `git add` auto completion suggests all files / directories,\n> filtered by nothing. I guess it would be much nicer (as in\n> increasing productivity) if it would only suggest unstaged\n> content, as reported by `git status`, because that would be the\n> only content one would be able to add.\n\nI think that is what Manlio Perillo tried to do with the stalled\nmp/complete-paths topic that is queued in 'pu'.\n\nManlio, any progress?\n"},{"id":"208076","messageId":"5106444F.2040007@gmail.com","threadId":"32732","inReplyTo":"7vip6iteod.fsf@alter.siamese.dyndns.org","subject":"Re: [feature request] git add completion should exclude staged content","fromName":"Manlio Perillo","fromEmail":"manlio.perillo@gmail.com","sentAt":"2013-01-28T09:26:39Z","receivedAt":"2013-01-28T09:26:39Z","isPatch":false,"sender":{"key":"manlio.perillo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6217088?v=4"},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nIl 28/01/2013 00:00, Junio C Hamano ha scritto:\n> wookietreiber <kizkizzbangbang@googlemail.com> writes:\n> \n>> I have a feature request for `git add` auto completion:\n>>\n>> `git add` auto completion suggests all files / directories,\n>> filtered by nothing. I guess it would be much nicer (as in\n>> increasing productivity) if it would only suggest unstaged\n>> content, as reported by `git status`, because that would be the\n>> only content one would be able to add.\n> \n> I think that is what Manlio Perillo tried to do with the stalled\n> mp/complete-paths topic that is queued in 'pu'.\n> \n> Manlio, any progress?\n\nWell, I assumed that the patch was stalled due to missing review from\ngit completion experts...\n\nFor this reason I have not updated it with your latest suggestions,\nwaiting for the review (also, because now I'm busy with other projects).\n\nFor the OP: the last patch can be found in the mailing list archive,\nwith the subject:\n\t[PATCH v5] git-completion.bash: add support for path completion\nand date:\n\tFri, 11 Jan 2013 19:48:43 +0100\n\nCan you please test it?\n\n\n\n\nRegards   Manlio\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1.4.10 (GNU/Linux)\nComment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/\n\niEYEARECAAYFAlEGRE8ACgkQscQJ24LbaUSX9ACfUMBH/X6lVH4V7FUaB2wlqj8C\neYQAnAzuYwhYhDvkW3d29IeqHsDFyWBT\n=BpRi\n-----END PGP SIGNATURE-----\n"},{"id":"208086","messageId":"51067487.9050505@drmicha.warpmail.net","threadId":"32732","inReplyTo":"5106444F.2040007@gmail.com","subject":"Re: [feature request] git add completion should exclude staged content","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2013-01-28T12:52:23Z","receivedAt":"2013-01-28T12:52:23Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Manlio Perillo venit, vidit, dixit 28.01.2013 10:26:\n> Il 28/01/2013 00:00, Junio C Hamano ha scritto:\n>> wookietreiber <kizkizzbangbang@googlemail.com> writes:\n> \n>>> I have a feature request for `git add` auto completion:\n>>>\n>>> `git add` auto completion suggests all files / directories,\n>>> filtered by nothing. I guess it would be much nicer (as in\n>>> increasing productivity) if it would only suggest unstaged\n>>> content, as reported by `git status`, because that would be the\n>>> only content one would be able to add.\n> \n>> I think that is what Manlio Perillo tried to do with the stalled\n>> mp/complete-paths topic that is queued in 'pu'.\n> \n>> Manlio, any progress?\n> \n> Well, I assumed that the patch was stalled due to missing review from\n> git completion experts...\n> \n> For this reason I have not updated it with your latest suggestions,\n> waiting for the review (also, because now I'm busy with other projects).\n> \n> For the OP: the last patch can be found in the mailing list archive,\n> with the subject:\n> \t[PATCH v5] git-completion.bash: add support for path completion\n> and date:\n> \tFri, 11 Jan 2013 19:48:43 +0100\n> \n> Can you please test it?\n> \n> \n> \n> \n> Regards   Manlio\n> \n\nI haven't looked at the patch, but in the example above, untracked\nfiles) could be added as well (unless you use -u), so maybe the scope\nshould depend on the option? If the new completion code kept me from\nadding untracked files easily it wouldn't be an improvement.\n\nMichael\n"},{"id":"208087","messageId":"510684FB.80104@gmail.com","threadId":"32732","inReplyTo":"51067487.9050505@drmicha.warpmail.net","subject":"Re: [feature request] git add completion should exclude staged content","fromName":"Manlio Perillo","fromEmail":"manlio.perillo@gmail.com","sentAt":"2013-01-28T14:02:35Z","receivedAt":"2013-01-28T14:02:35Z","isPatch":false,"sender":{"key":"manlio.perillo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6217088?v=4"},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nIl 28/01/2013 13:52, Michael J Gruber ha scritto:\n> Manlio Perillo venit, vidit, dixit 28.01.2013 10:26:\n>> Il 28/01/2013 00:00, Junio C Hamano ha scritto:\n>>> wookietreiber <kizkizzbangbang@googlemail.com> writes:\n>>\n>>>> I have a feature request for `git add` auto completion:\n>>>>\n> [...]\n>> For the OP: the last patch can be found in the mailing list archive,\n>> with the subject:\n>> \t[PATCH v5] git-completion.bash: add support for path completion\n>> and date:\n>> \tFri, 11 Jan 2013 19:48:43 +0100\n>>\n>> Can you please test it?\n>>\n> \n> I haven't looked at the patch, but in the example above, untracked\n> files) could be added as well (unless you use -u), so maybe the scope\n> should depend on the option? If the new completion code kept me from\n> adding untracked files easily it wouldn't be an improvement.\n> \n\nThe patch will suggest (for git add command), all the files that are\ncandidate to be added to the index file.\n\nPlease, test it and report any behaviour you think is incorrect.\n\n\nRegards   Manlio\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1.4.10 (GNU/Linux)\nComment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/\n\niEYEARECAAYFAlEGhPsACgkQscQJ24LbaUTYOwCdFagTRkHzUHoFwy3U+Vz6tAzE\ntVIAnj8fAbyGrlNUoUgI4ZshwOtlEH8v\n=jy8R\n-----END PGP SIGNATURE-----\n"},{"id":"208088","messageId":"5106A5CE.3000800@drmicha.warpmail.net","threadId":"32732","inReplyTo":"510684FB.80104@gmail.com","subject":"Re: [feature request] git add completion should exclude staged content","fromName":"Michael J Gruber","fromEmail":"git@drmicha.warpmail.net","sentAt":"2013-01-28T16:22:38Z","receivedAt":"2013-01-28T16:22:38Z","isPatch":false,"sender":{"key":"git@grubix.eu","avatar":"https://avatars.githubusercontent.com/u/233215?v=4"},"body":"Manlio Perillo venit, vidit, dixit 28.01.2013 15:02:\n> Il 28/01/2013 13:52, Michael J Gruber ha scritto:\n>> Manlio Perillo venit, vidit, dixit 28.01.2013 10:26:\n>>> Il 28/01/2013 00:00, Junio C Hamano ha scritto:\n>>>> wookietreiber <kizkizzbangbang@googlemail.com> writes:\n>>>\n>>>>> I have a feature request for `git add` auto completion:\n>>>>>\n>> [...]\n>>> For the OP: the last patch can be found in the mailing list archive,\n>>> with the subject:\n>>> \t[PATCH v5] git-completion.bash: add support for path completion\n>>> and date:\n>>> \tFri, 11 Jan 2013 19:48:43 +0100\n>>>\n>>> Can you please test it?\n>>>\n> \n>> I haven't looked at the patch, but in the example above, untracked\n>> files) could be added as well (unless you use -u), so maybe the scope\n>> should depend on the option? If the new completion code kept me from\n>> adding untracked files easily it wouldn't be an improvement.\n> \n> \n> The patch will suggest (for git add command), all the files that are\n> candidate to be added to the index file.\n> \n> Please, test it and report any behaviour you think is incorrect.\n\nOK, that seems to work and to be quite helpful.\n\nMinor nit: \"git add -u\" could use the same fileset as \"git commit\". But\nI don't know whether completion can act upon the presence of options.\nCurrently, it also includes untracked files (just like without -u) but\nomits unmodified and ignored ones, which is already quite an improvement.\n\nI won't be able to review the completion code but may contribute a few\nlines to t/t9902-completion.sh, possibly.\n\nMichael\n"},{"id":"208093","messageId":"7vd2wpxki1.fsf@alter.siamese.dyndns.org","threadId":"32732","inReplyTo":"5106A5CE.3000800@drmicha.warpmail.net","subject":"Re: [feature request] git add completion should exclude staged content","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2013-01-28T17:52:54Z","receivedAt":"2013-01-28T17:52:54Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael J Gruber <git@drmicha.warpmail.net> writes:\n> Manlio Perillo venit, vidit, dixit 28.01.2013 15:02:\n>> Please, test it and report any behaviour you think is incorrect.\n>\n> OK, that seems to work and to be quite helpful.\n>\n> Minor nit: \"git add -u\" could use the same fileset as \"git commit\". But\n> I don't know whether completion can act upon the presence of options.\n> Currently, it also includes untracked files (just like without -u) but\n> omits unmodified and ignored ones, which is already quite an improvement.\n>\n> I won't be able to review the completion code but may contribute a few\n> lines to t/t9902-completion.sh, possibly.\n\nThanks both for commenting.  I'll find time to read it over again\nand perhaps we can merge it to 'next' and advertise it in the next\nissue of \"What's cooking\" report to ask for wider testing to move it\nforward.\n"},{"id":"208111","messageId":"5106DBE5.6040507@gmail.com","threadId":"32732","inReplyTo":"5106A5CE.3000800@drmicha.warpmail.net","subject":"Re: [feature request] git add completion should exclude staged content","fromName":"Manlio Perillo","fromEmail":"manlio.perillo@gmail.com","sentAt":"2013-01-28T20:13:25Z","receivedAt":"2013-01-28T20:13:25Z","isPatch":false,"sender":{"key":"manlio.perillo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6217088?v=4"},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nIl 28/01/2013 17:22, Michael J Gruber ha scritto:\n> [...]\n>> The patch will suggest (for git add command), all the files that are\n>> candidate to be added to the index file.\n>>\n>> Please, test it and report any behaviour you think is incorrect.\n> \n> OK, that seems to work and to be quite helpful.\n> \n> Minor nit: \"git add -u\" could use the same fileset as \"git commit\". But\n> I don't know whether completion can act upon the presence of options.\n\nIt is possible, but I have not implemented since I was not sure about it\nand I wanted to avoid to make the patch more hard to review.\n\nI will work on it after the patch is approved.\n\n> Currently, it also includes untracked files (just like without -u) but\n> omits unmodified and ignored ones, which is already quite an improvement.\n> \n> I won't be able to review the completion code but may contribute a few\n> lines to t/t9902-completion.sh, possibly.\n> \n\nAh, I missed this test; thanks.\n\nThe proposed patch must update it.\n\n\n\nRegards  Manlio\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1.4.10 (GNU/Linux)\nComment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/\n\niEYEARECAAYFAlEG2+UACgkQscQJ24LbaURstACfdNxuFvaokBSTls20bSQ7jPHA\n8I0An3fX6oRKuc2lzAgPVBLjsbjbw91V\n=igwr\n-----END PGP SIGNATURE-----\n"},{"id":"208113","messageId":"5106DC87.7090607@gmail.com","threadId":"32732","inReplyTo":"7vd2wpxki1.fsf@alter.siamese.dyndns.org","subject":"Re: [feature request] git add completion should exclude staged content","fromName":"Manlio Perillo","fromEmail":"manlio.perillo@gmail.com","sentAt":"2013-01-28T20:16:07Z","receivedAt":"2013-01-28T20:16:07Z","isPatch":false,"sender":{"key":"manlio.perillo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6217088?v=4"},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nIl 28/01/2013 18:52, Junio C Hamano ha scritto:\n> [...]\n> \n> Thanks both for commenting.  I'll find time to read it over again\n> and perhaps we can merge it to 'next' and advertise it in the next\n> issue of \"What's cooking\" report to ask for wider testing to move it\n> forward.\n\nThanks.\n\nI will try to update the patch, with your latest suggestions (avoid\ntricky POSIX shell syntax, and CDPATH issue - if I remember correctly),\nand with an update for the t/t9902-completion.sh test (that I completely\nmissed).\n\n\n\nRegards  Manlio\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1.4.10 (GNU/Linux)\nComment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/\n\niEYEARECAAYFAlEG3IcACgkQscQJ24LbaUTR/wCfSC/kHxseKAQ9rnK2ba/WwND1\ncmsAn2CuHpRs2VjippTwkT5O3ul9cQKb\n=5Way\n-----END PGP SIGNATURE-----\n"},{"id":"208265","messageId":"E59706EF8DB1D147B15BECA3322E4BDC097A7E@eusaamb103.ericsson.se","threadId":"32732","inReplyTo":"5106DC87.7090607@gmail.com","subject":"RE: [feature request] git add completion should exclude staged content","fromName":"Marc Khouzam","fromEmail":"marc.khouzam@ericsson.com","sentAt":"2013-01-30T14:06:44Z","receivedAt":"2013-01-30T14:06:44Z","isPatch":false,"sender":{"key":"marc.khouzam@ericsson.com","avatar":"https://gravatar.com/avatar/de564e23ad14e2945f9f1cdb4d0227c935b5b54c39576a304d47caa3e23dcd33?d=mp&s=160"},"body":"\n> -----Original Message-----\n> From: git-owner@vger.kernel.org \n> [mailto:git-owner@vger.kernel.org] On Behalf Of Manlio Perillo\n> Sent: Monday, January 28, 2013 3:16 PM\n> To: Junio C Hamano\n> Cc: Michael J Gruber; wookietreiber; git@vger.kernel.org\n> Subject: Re: [feature request] git add completion should \n> exclude staged content\n> \n> -----BEGIN PGP SIGNED MESSAGE-----\n> Hash: SHA1\n> \n> Il 28/01/2013 18:52, Junio C Hamano ha scritto:\n> > [...]\n> > \n> > Thanks both for commenting.  I'll find time to read it over again\n> > and perhaps we can merge it to 'next' and advertise it in the next\n> > issue of \"What's cooking\" report to ask for wider testing to move it\n> > forward.\n> \n> Thanks.\n> \n> I will try to update the patch, with your latest suggestions (avoid\n> tricky POSIX shell syntax, and CDPATH issue - if I remember \n> correctly),\n> and with an update for the t/t9902-completion.sh test (that I \n> completely\n> missed).\n\nHi Manlio,\n\nI'm trying to update git-completion.tcsh to work properly with\nyour nice new completion feature.  But I'm having trouble with \nthe missing '/' at the end of directories.\n\nThe new logic in git-completion.bash tells bash that 'filenames'\ncompletion is ongoing so bash will add a '/' after directories.\nSadly, tcsh won't do that, so it would be simpler if\ngit-completion.bash added the '/' itself.  I looked at the \ngit-completion.bash script changes and I noticed that for \nbash version < 4, you have to add the '/' yourself.  \nI also noticed the following comment:\n\n # XXX if we append a slash to directory names when using\n # `compopt -o filenames`, Bash will append another slash.\n # This is pretty stupid, and this the reason why we have to\n # define a compatible version for this function.\n\nSo I gather you would rather add a '/' all the time to deal\nwith older bash version transparently.  This would be great\nfor tcsh also.  I'm trying to figure out\nwhen bash mis-behaves when you add the '/' all the time?\nWhen I try it (I have bash 4.1.5(1)-release) I didn't run\ninto the double slash problem you mention in the comment.\n\nI'm hoping we can straighten this out and have\ngit-completion.bash add the '/' all the time.\n\nCould you explain when the problem happens?\n\nThanks\n\nMarc\n"},{"id":"208287","messageId":"51096543.9050100@gmail.com","threadId":"32732","inReplyTo":"E59706EF8DB1D147B15BECA3322E4BDC097A7E@eusaamb103.ericsson.se","subject":"Re: [feature request] git add completion should exclude staged content","fromName":"Manlio Perillo","fromEmail":"manlio.perillo@gmail.com","sentAt":"2013-01-30T18:24:03Z","receivedAt":"2013-01-30T18:24:03Z","isPatch":false,"sender":{"key":"manlio.perillo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6217088?v=4"},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nIl 30/01/2013 15:06, Marc Khouzam ha scritto:\n> [...]\n>> I will try to update the patch, with your latest suggestions (avoid\n>> tricky POSIX shell syntax, and CDPATH issue - if I remember \n>> correctly),\n>> and with an update for the t/t9902-completion.sh test (that I \n>> completely\n>> missed).\n> \n> Hi Manlio,\n> \n\nHi.\n\n> I'm trying to update git-completion.tcsh to work properly with\n> your nice new completion feature.  But I'm having trouble with \n> the missing '/' at the end of directories.\n> \n> The new logic in git-completion.bash tells bash that 'filenames'\n> completion is ongoing so bash will add a '/' after directories.\n> Sadly, tcsh won't do that, so it would be simpler if\n> git-completion.bash added the '/' itself.  I looked at the \n> git-completion.bash script changes and I noticed that for \n> bash version < 4, you have to add the '/' yourself.\n\nThe compatible version is not only required for Bash; you can use it for\nother shells.\n\nTry to redefine the __git_index_file_list_filter function to use the\nversion that adds a slash to directory names.\n\n\n> I also noticed the following comment:\n> \n>  # XXX if we append a slash to directory names when using\n>  # `compopt -o filenames`, Bash will append another slash.\n>  # This is pretty stupid, and this the reason why we have to\n>  # define a compatible version for this function.\n> \n> So I gather you would rather add a '/' all the time to deal\n> with older bash version transparently.  This would be great\n> for tcsh also.  I'm trying to figure out\n> when bash mis-behaves when you add the '/' all the time?\n> When I try it (I have bash 4.1.5(1)-release) I didn't run\n> into the double slash problem you mention in the comment.\n> \n\nI'm using the same version: 4.1.5(1), on Debian stable.\n\n> I'm hoping we can straighten this out and have\n> git-completion.bash add the '/' all the time.\n> \n> Could you explain when the problem happens?\n> \n\nBash 4.1.5(1) always adds an additional slash for directories.\nI have tested it right now: change the filter function to use the\ncompatible version:\n\n__git_index_file_list_filter ()\n{\n\t# Default to Bash >= 4.x\n\t__git_index_file_list_filter_compat\n}\n\n\nThen running `git add <TAB>` inside the git repository, I get this file\ncompletion list:\n\n$ git add <TAB>\ncontrib//\n\n\n> Thanks\n> \n\n\nThanks to you\n\nManlio\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1.4.10 (GNU/Linux)\nComment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/\n\niEYEARECAAYFAlEJZUMACgkQscQJ24LbaUQUGACgkMG/bZrJKBzlZ8toEQwmggQX\nm9kAn2ATJbSp87kOkoCCc00eHmh71r3y\n=D9iu\n-----END PGP SIGNATURE-----\n"},{"id":"208299","messageId":"E59706EF8DB1D147B15BECA3322E4BDC097E39@eusaamb103.ericsson.se","threadId":"32732","inReplyTo":"51096543.9050100@gmail.com","subject":"RE: [feature request] git add completion should exclude staged content","fromName":"Marc Khouzam","fromEmail":"marc.khouzam@ericsson.com","sentAt":"2013-01-30T18:55:35Z","receivedAt":"2013-01-30T18:55:35Z","isPatch":false,"sender":{"key":"marc.khouzam@ericsson.com","avatar":"https://gravatar.com/avatar/de564e23ad14e2945f9f1cdb4d0227c935b5b54c39576a304d47caa3e23dcd33?d=mp&s=160"},"body":"\n> -----Original Message-----\n> From: git-owner@vger.kernel.org \n> [mailto:git-owner@vger.kernel.org] On Behalf Of Manlio Perillo\n> Sent: Wednesday, January 30, 2013 1:24 PM\n> To: Marc Khouzam\n> Cc: 'Junio C Hamano'; 'Michael J Gruber'; 'wookietreiber'; \n> 'git@vger.kernel.org'\n> Subject: Re: [feature request] git add completion should \n> exclude staged content\n> \n> -----BEGIN PGP SIGNED MESSAGE-----\n> Hash: SHA1\n> \n> Il 30/01/2013 15:06, Marc Khouzam ha scritto:\n> > [...]\n> >> I will try to update the patch, with your latest suggestions (avoid\n> >> tricky POSIX shell syntax, and CDPATH issue - if I remember \n> >> correctly),\n> >> and with an update for the t/t9902-completion.sh test (that I \n> >> completely\n> >> missed).\n> > \n> > Hi Manlio,\n> > \n> \n> Hi.\n> \n> > I'm trying to update git-completion.tcsh to work properly with\n> > your nice new completion feature.  But I'm having trouble with \n> > the missing '/' at the end of directories.\n> > \n> > The new logic in git-completion.bash tells bash that 'filenames'\n> > completion is ongoing so bash will add a '/' after directories.\n> > Sadly, tcsh won't do that, so it would be simpler if\n> > git-completion.bash added the '/' itself.  I looked at the \n> > git-completion.bash script changes and I noticed that for \n> > bash version < 4, you have to add the '/' yourself.\n> \n> The compatible version is not only required for Bash; you can \n> use it for\n> other shells.\n> \n> Try to redefine the __git_index_file_list_filter function to use the\n> version that adds a slash to directory names.\n\nI hadn't thought of that!\nAlthough I would prefer not to have special cases like that,\nit does work well.\nThanks!\n\n> > I also noticed the following comment:\n> > \n> >  # XXX if we append a slash to directory names when using\n> >  # `compopt -o filenames`, Bash will append another slash.\n> >  # This is pretty stupid, and this the reason why we have to\n> >  # define a compatible version for this function.\n> > \n> > So I gather you would rather add a '/' all the time to deal\n> > with older bash version transparently.  This would be great\n> > for tcsh also.  I'm trying to figure out\n> > when bash mis-behaves when you add the '/' all the time?\n> > When I try it (I have bash 4.1.5(1)-release) I didn't run\n> > into the double slash problem you mention in the comment.\n> > \n> \n> I'm using the same version: 4.1.5(1), on Debian stable.\n> \n> > I'm hoping we can straighten this out and have\n> > git-completion.bash add the '/' all the time.\n> > \n> > Could you explain when the problem happens?\n> > \n> \n> Bash 4.1.5(1) always adds an additional slash for directories.\n> I have tested it right now: change the filter function to use the\n> compatible version:\n> \n> __git_index_file_list_filter ()\n> {\n> \t# Default to Bash >= 4.x\n> \t__git_index_file_list_filter_compat\n> }\n> \n> \n> Then running `git add <TAB>` inside the git repository, I get \n> this file\n> completion list:\n> \n> $ git add <TAB>\n> contrib//\n\nOk, I see.  The double-slash is visible in the completion list\nbut it does not appear on the command-line when bash automatically\nadds it.  So if you typed \n  git add contri<tab>\nyou will properly get\n  git add contrib/\nThat is the case I was looking at.\nI understand why you cannot put that second slash in the code now.\n\nThanks\n\n> \n> \n> > Thanks\n> > \n> \n> \n> Thanks to you\n> \n> Manlio\n> -----BEGIN PGP SIGNATURE-----\n> Version: GnuPG v1.4.10 (GNU/Linux)\n> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/\n> \n> iEYEARECAAYFAlEJZUMACgkQscQJ24LbaUQUGACgkMG/bZrJKBzlZ8toEQwmggQX\n> m9kAn2ATJbSp87kOkoCCc00eHmh71r3y\n> =D9iu\n> -----END PGP SIGNATURE-----\n> --\n> To unsubscribe from this list: send the line \"unsubscribe git\" in\n> the body of a message to majordomo@vger.kernel.org\n> More majordomo info at  http://vger.kernel.org/majordomo-info.html\n> "},{"id":"208308","messageId":"51097B49.6070301@gmail.com","threadId":"32732","inReplyTo":"E59706EF8DB1D147B15BECA3322E4BDC097E39@eusaamb103.ericsson.se","subject":"Re: [feature request] git add completion should exclude staged content","fromName":"Manlio Perillo","fromEmail":"manlio.perillo@gmail.com","sentAt":"2013-01-30T19:58:01Z","receivedAt":"2013-01-30T19:58:01Z","isPatch":false,"sender":{"key":"manlio.perillo@gmail.com","avatar":"https://avatars.githubusercontent.com/u/6217088?v=4"},"body":"-----BEGIN PGP SIGNED MESSAGE-----\nHash: SHA1\n\nIl 30/01/2013 19:55, Marc Khouzam ha scritto:\n> [...]\n>>>> The new logic in git-completion.bash tells bash that 'filenames'\n>>>> completion is ongoing so bash will add a '/' after directories.\n>>>> Sadly, tcsh won't do that, so it would be simpler if\n>>>> git-completion.bash added the '/' itself.  I looked at the \n>>>> git-completion.bash script changes and I noticed that for \n>>>> bash version < 4, you have to add the '/' yourself.\n> \n> The compatible version is not only required for Bash; you can \n> use it for\n> other shells.\n> \n> Try to redefine the __git_index_file_list_filter function to use the\n> version that adds a slash to directory names.\n> \n>> I hadn't thought of that!\n>> Although I would prefer not to have special cases like that,\n>> it does work well.\n\nThe zsh compatible code does something like this; this is the reason I\ntried to do the same thing, in order to keep coding consistent.\n\n> [...]\n>\n> Bash 4.1.5(1) always adds an additional slash for directories.\n> I have tested it right now: change the filter function to use the\n> compatible version:\n> \n> __git_index_file_list_filter ()\n> {\n> \t# Default to Bash >= 4.x\n> \t__git_index_file_list_filter_compat\n> }\n> \n> \n> Then running `git add <TAB>` inside the git repository, I get \n> this file\n> completion list:\n> \n> $ git add <TAB>\n> contrib//\n> \n>> Ok, I see.  The double-slash is visible in the completion list\n>> but it does not appear on the command-line when bash automatically\n>> adds it.\n\nRight; that's why I wrote in the comment that Bash behaviour \"seems\" stupid.\nBut probably that comment should be remove or changed for the final\nversion of the patch; I'll leave that to a Bash expert.\n\n> [...]\n\n\nRegards  Manlio\n-----BEGIN PGP SIGNATURE-----\nVersion: GnuPG v1.4.10 (GNU/Linux)\nComment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/\n\niEYEARECAAYFAlEJe0kACgkQscQJ24LbaUScGgCeMDDdprJMgnYtFzqnFQamhfvU\nBikAniMkwbOEVkkomOd9G0m3KY44f/9O\n=c8rC\n-----END PGP SIGNATURE-----\n"}]}