{"thread":{"id":"38970","subject":"Re: git-completion.tcsh","startedAt":"2015-04-01T09:55:19Z","lastAt":"2015-04-24T14:37:21Z","messageCount":5,"participants":["SZEDER Gábor","Perry Rajnovic","Marc Khouzam"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"258815","messageId":"20150401115519.Horde.JM0TEyhacRn5LYAEffMggQ1@webmail.informatik.kit.edu","threadId":"38970","inReplyTo":null,"subject":"Re: git-completion.tcsh","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2015-04-01T09:55:19Z","receivedAt":"2015-04-01T09:55:19Z","isPatch":false,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"\nQuoting Perry Rajnovic <perry.rajnovic@gmail.com>:\n\n> When using the auto-completion included with git for tcsh, several\n> commands do directly completion with an additional space appended to\n> the end, which defeats the ability to complete to a deeper\n> sub-directory.\n>\n> For example, if I have a git repository including the following:\n> basedir/foo/bar/somefile.c\n>\n> (works as expected, git add)\n> $ cd basedir\n> $ git add f<tab>\n> $ git add foo/\n> $ git add foo/b<tab>\n> $ git add foo/bar/\n> $ git add foo/bar/s<tab>\n> $ git add foo/bar/somefile.c\n>\n> (works not as expected, git rm)\n> $ cd basedir\n> $ git rm f<tab>\n> $ git rm foo\n> $ git rm foo<backspace>/b<tab>\n> $ git rm foo/bar\n> there’s a trailing space after foo and bar in the above lines, which\n> means it’s not possible to initiate completion or immediately start\n> typing, i must back-space before continuing.\n>\n> I’m fairly certain i’ve seen this for other commands as  well, but\n> i’m not sure to what extent this occurs throughout the commands.\n>\n> Environment info:\n> OS: Darwin 14.1.0 Darwin Kernel Version 14.1.0: Thu Feb 26 19:26:47\n> PST  2015; root:xnu-2782.10.73~1/RELEASE_X86_64 x86_64 (OSX 10.10.2)\n> Apple Terminal Version 2.5.1 (343.6)\n> git version 2.3.2 (via MacPorts)\n> tcsh 6.17.00 (Astron) 2009-07-10 (x86_64-apple-darwin) options\n> wide,nls,dl,al,kan,sm,rh,color,filec\n\nThe tcsh completion script is just a wrapper, it relies on the bash  \ncompletion script to do the heavy lifting and tunnels its output int  \ntcsh's completion infrastructure.\nCould you try bash completion in your environment first to see,  \nwhether it's a bash completion issue that I can't reproduce or an  \nissue with the tcsh wrapper?\n\nCc'ing Marc, author of the tcsh wrapper.\n\n\nGábor\n"},{"id":"259199","messageId":"481BCBD7-457B-4AFB-B878-1417C8C5940C@gmail.com","threadId":"38970","inReplyTo":"20150401115519.Horde.JM0TEyhacRn5LYAEffMggQ1@webmail.informatik.kit.edu","subject":"Re: git-completion.tcsh","fromName":"Perry Rajnovic","fromEmail":"perry.rajnovic@gmail.com","sentAt":"2015-04-09T04:41:13Z","receivedAt":"2015-04-09T04:41:13Z","isPatch":false,"sender":{"key":"perry.rajnovic@gmail.com","avatar":null},"body":"Gábor,\n\nI updated git to include the macports install with bash completion.  under bash it does not exhibit the problem as I described it. To be sure that the completion scripts installed via macports weren’t newer/different (the .bash completion file had a few minor diffs from what I had been using), i reinstalled the tcsh completion using those files, but the same behavior happened.\n\nSo i’m seeing what you’re seeing, bash completion works fine, it’s likely to be something in the wrapper handling.\n\n(updated) environment\nDarwin 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05 PDT 2015; root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64 (OS X 10.10.3)\nApple Terminal Version 2.5.3 (343.7)\ngit 2.3.4 (+bash_completion, via MacPorts)\ntcsh 6.17.00 (Astron) 2009-07-10 (x86_64-apple-darwin) options wide,nls,dl,al,kan,sm,rh,color,filec\nGNU bash, version 4.3.33(1)-release (x86_64-apple-darwin14.0.0)\n\nThanks!\n\nPerry\n\n> On Apr 1, 2015, at 20:55, SZEDER Gábor <szeder@ira.uka.de> wrote:\n> \n> \n> Quoting Perry Rajnovic <perry.rajnovic@gmail.com>:\n> \n>> When using the auto-completion included with git for tcsh, several\n>> commands do directly completion with an additional space appended to\n>> the end, which defeats the ability to complete to a deeper\n>> sub-directory.\n>> \n>> For example, if I have a git repository including the following:\n>> basedir/foo/bar/somefile.c\n>> \n>> (works as expected, git add)\n>> $ cd basedir\n>> $ git add f<tab>\n>> $ git add foo/\n>> $ git add foo/b<tab>\n>> $ git add foo/bar/\n>> $ git add foo/bar/s<tab>\n>> $ git add foo/bar/somefile.c\n>> \n>> (works not as expected, git rm)\n>> $ cd basedir\n>> $ git rm f<tab>\n>> $ git rm foo\n>> $ git rm foo<backspace>/b<tab>\n>> $ git rm foo/bar\n>> there’s a trailing space after foo and bar in the above lines, which\n>> means it’s not possible to initiate completion or immediately start\n>> typing, i must back-space before continuing.\n>> \n>> I’m fairly certain i’ve seen this for other commands as  well, but\n>> i’m not sure to what extent this occurs throughout the commands.\n>> \n>> Environment info:\n>> OS: Darwin 14.1.0 Darwin Kernel Version 14.1.0: Thu Feb 26 19:26:47\n>> PST  2015; root:xnu-2782.10.73~1/RELEASE_X86_64 x86_64 (OSX 10.10.2)\n>> Apple Terminal Version 2.5.1 (343.6)\n>> git version 2.3.2 (via MacPorts)\n>> tcsh 6.17.00 (Astron) 2009-07-10 (x86_64-apple-darwin) options\n>> wide,nls,dl,al,kan,sm,rh,color,filec\n> \n> The tcsh completion script is just a wrapper, it relies on the bash\n> completion script to do the heavy lifting and tunnels its output int\n> tcsh's completion infrastructure.\n> Could you try bash completion in your environment first to see,\n> whether it's a bash completion issue that I can't reproduce or an\n> issue with the tcsh wrapper?\n> \n> Cc'ing Marc, author of the tcsh wrapper.\n> \n> \n> Gábor\n"},{"id":"259917","messageId":"CAFj1UpHBk1JFmSv4T=wQUNiade9ZW8yiaco9z2-wGJh7yXATuA@mail.gmail.com","threadId":"38970","inReplyTo":"481BCBD7-457B-4AFB-B878-1417C8C5940C@gmail.com","subject":"Re: git-completion.tcsh","fromName":"Marc Khouzam","fromEmail":"marc.khouzam@gmail.com","sentAt":"2015-04-23T21:08:53Z","receivedAt":"2015-04-23T21:08:53Z","isPatch":false,"sender":{"key":"marc.khouzam@ericsson.com","avatar":"https://gravatar.com/avatar/de564e23ad14e2945f9f1cdb4d0227c935b5b54c39576a304d47caa3e23dcd33?d=mp&s=160"},"body":"Hi,\n\nI did notice the problem a while ago and had traced it back to the\nfact that the bash completion scripts no longer adds the trailing '/'\nat the end of directories.\nTcsh needs that '/' to know not to add that annoying extra space.\n\nBash 3 needed to put it that trailing '/' but bash 4 did not.  Two\nyears ago (!) changes were made in commit\n3ffa4df4b2a26768938fc6bf1ed0640885b2bdf1 to allow bash 3 to work\nwithout the trailing '/'.  That caused\nthe problem in the tcsh script.\n\nThe thing is that with master of today, I don't see the problem any\nmore.  I can't tell you when it started working again.\nWhat is interesting is that the reason it now works is that the\ngit-completion.bash script no longer returns anything\nfor the case you mention:\n  git add f<tab>\nInstead, it seems to rely on file completion only.  File completion is\nsimulated by the tcsh script, so things work.\n\nI tried with both git add and git rm and didn't see the problem as you\ndescribed it.\n\nYou can troubleshoot the git-completion.tcsh script by running the\ngenerated final script directly.  For example, to see the completions\nfor a command line like:\n    git rm f<tab>\nyou can run:\n  bash ~/.git-completion.tcsh.bash git 'git rm f'\n\nI plan on posting a patch to add debug printouts to make this process simpler.\n\nMarc\n\nOn Thu, Apr 9, 2015 at 12:41 AM, Perry Rajnovic\n<perry.rajnovic@gmail.com> wrote:\n> Gábor,\n>\n> I updated git to include the macports install with bash completion.  under bash it does not exhibit the problem as I described it. To be sure that the completion scripts installed via macports weren’t newer/different (the .bash completion file had a few minor diffs from what I had been using), i reinstalled the tcsh completion using those files, but the same behavior happened.\n>\n> So i’m seeing what you’re seeing, bash completion works fine, it’s likely to be something in the wrapper handling.\n>\n> (updated) environment\n> Darwin 14.3.0 Darwin Kernel Version 14.3.0: Mon Mar 23 11:59:05 PDT 2015; root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64 (OS X 10.10.3)\n> Apple Terminal Version 2.5.3 (343.7)\n> git 2.3.4 (+bash_completion, via MacPorts)\n> tcsh 6.17.00 (Astron) 2009-07-10 (x86_64-apple-darwin) options wide,nls,dl,al,kan,sm,rh,color,filec\n> GNU bash, version 4.3.33(1)-release (x86_64-apple-darwin14.0.0)\n>\n> Thanks!\n>\n> Perry\n>\n>> On Apr 1, 2015, at 20:55, SZEDER Gábor <szeder@ira.uka.de> wrote:\n>>\n>>\n>> Quoting Perry Rajnovic <perry.rajnovic@gmail.com>:\n>>\n>>> When using the auto-completion included with git for tcsh, several\n>>> commands do directly completion with an additional space appended to\n>>> the end, which defeats the ability to complete to a deeper\n>>> sub-directory.\n>>>\n>>> For example, if I have a git repository including the following:\n>>> basedir/foo/bar/somefile.c\n>>>\n>>> (works as expected, git add)\n>>> $ cd basedir\n>>> $ git add f<tab>\n>>> $ git add foo/\n>>> $ git add foo/b<tab>\n>>> $ git add foo/bar/\n>>> $ git add foo/bar/s<tab>\n>>> $ git add foo/bar/somefile.c\n>>>\n>>> (works not as expected, git rm)\n>>> $ cd basedir\n>>> $ git rm f<tab>\n>>> $ git rm foo\n>>> $ git rm foo<backspace>/b<tab>\n>>> $ git rm foo/bar\n>>> there’s a trailing space after foo and bar in the above lines, which\n>>> means it’s not possible to initiate completion or immediately start\n>>> typing, i must back-space before continuing.\n>>>\n>>> I’m fairly certain i’ve seen this for other commands as  well, but\n>>> i’m not sure to what extent this occurs throughout the commands.\n>>>\n>>> Environment info:\n>>> OS: Darwin 14.1.0 Darwin Kernel Version 14.1.0: Thu Feb 26 19:26:47\n>>> PST  2015; root:xnu-2782.10.73~1/RELEASE_X86_64 x86_64 (OSX 10.10.2)\n>>> Apple Terminal Version 2.5.1 (343.6)\n>>> git version 2.3.2 (via MacPorts)\n>>> tcsh 6.17.00 (Astron) 2009-07-10 (x86_64-apple-darwin) options\n>>> wide,nls,dl,al,kan,sm,rh,color,filec\n>>\n>> The tcsh completion script is just a wrapper, it relies on the bash\n>> completion script to do the heavy lifting and tunnels its output int\n>> tcsh's completion infrastructure.\n>> Could you try bash completion in your environment first to see,\n>> whether it's a bash completion issue that I can't reproduce or an\n>> issue with the tcsh wrapper?\n>>\n>> Cc'ing Marc, author of the tcsh wrapper.\n>>\n>>\n>> Gábor\n>\n"},{"id":"259936","messageId":"20150424133028.Horde.fL7zuT7X5Dj99hzpmme9Hw1@webmail.informatik.kit.edu","threadId":"38970","inReplyTo":"CAFj1UpHBk1JFmSv4T=wQUNiade9ZW8yiaco9z2-wGJh7yXATuA@mail.gmail.com","subject":"Re: git-completion.tcsh","fromName":"SZEDER Gábor","fromEmail":"szeder@ira.uka.de","sentAt":"2015-04-24T11:30:28Z","receivedAt":"2015-04-24T11:30:28Z","isPatch":false,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"Hi,\n\nQuoting Marc Khouzam <marc.khouzam@gmail.com>:\n> Hi,\n>\n> I did notice the problem a while ago and had traced it back to the\n> fact that the bash completion scripts no longer adds the trailing '/'\n> at the end of directories.\n> Tcsh needs that '/' to know not to add that annoying extra space.\n>\n> Bash 3 needed to put it that trailing '/' but bash 4 did not.  Two\n> years ago (!) changes were made in commit\n> 3ffa4df4b2a26768938fc6bf1ed0640885b2bdf1 to allow bash 3 to work\n> without the trailing '/'.  That caused\n> the problem in the tcsh script.\n>\n> The thing is that with master of today, I don't see the problem any\n> more.  I can't tell you when it started working again.\n> What is interesting is that the reason it now works is that the\n> git-completion.bash script no longer returns anything\n> for the case you mention:\n>   git add f<tab>\n> Instead, it seems to rely on file completion only.\n\nI can't reproduce it with git-completion.bash from current master on  \nits own on with bash 3.1.20(4) from MSysGit, it seems to work as  \nintended here wrt tracked-file-aware file completion.\n\nSet up test repo with these commands:\n\n   git init\n   >tracked\n   git add tracked\n   >non-tracked\n   mkdir -p foo/bar\n   >foo/bar/somefile.c\n\nNow let's see what happens with 'git add':\n\n   $ git add <TAB>\n   foo/         non-tracked\n\nNote, that the file 'tracked' is not offered, so this is clearly not  \nstandard bash file completion, but our completion script.  Also note  \nthe trailing '/' in 'foo/'.\n\n   $ git add f<TAB>\n\nJust completes to 'git add foo/', no space after '/'.\nAdd the file:\n\n   $ git add foo/bar/somefile.c\n\nNow let's see 'git rm':\n\n   $ git rm <TAB>\n   foo/     tracked\n\nNote, that the file 'non-tracked' is not offered, so again this comes  \nfrom our bash completion script.\n\nDid you test the bash completion script on its own, or only through  \nthe tcsh wrapper?\nI'm on MSysGit now, so no tcsh or bash v4 at hand, and no time either,  \nso can't dig further at the moment.\n\n\nGábor\n"},{"id":"259948","messageId":"CAFj1UpHWhjx5O_ApO8+TRMj+t2tmn45-k1wemSc4um=k9oOyNg@mail.gmail.com","threadId":"38970","inReplyTo":"20150424133028.Horde.fL7zuT7X5Dj99hzpmme9Hw1@webmail.informatik.kit.edu","subject":"Re: git-completion.tcsh","fromName":"Marc Khouzam","fromEmail":"marc.khouzam@gmail.com","sentAt":"2015-04-24T14:37:21Z","receivedAt":"2015-04-24T14:37:21Z","isPatch":false,"sender":{"key":"marc.khouzam@ericsson.com","avatar":"https://gravatar.com/avatar/de564e23ad14e2945f9f1cdb4d0227c935b5b54c39576a304d47caa3e23dcd33?d=mp&s=160"},"body":"On Fri, Apr 24, 2015 at 7:30 AM, SZEDER Gábor <szeder@ira.uka.de> wrote:\n> Hi,\n>\n> Quoting Marc Khouzam <marc.khouzam@gmail.com>:\n>>\n>> Hi,\n>>\n>> I did notice the problem a while ago and had traced it back to the\n>> fact that the bash completion scripts no longer adds the trailing '/'\n>> at the end of directories.\n>> Tcsh needs that '/' to know not to add that annoying extra space.\n>>\n>> Bash 3 needed to put it that trailing '/' but bash 4 did not.  Two\n>> years ago (!) changes were made in commit\n>> 3ffa4df4b2a26768938fc6bf1ed0640885b2bdf1 to allow bash 3 to work\n>> without the trailing '/'.  That caused\n>> the problem in the tcsh script.\n>>\n>> The thing is that with master of today, I don't see the problem any\n>> more.  I can't tell you when it started working again.\n>> What is interesting is that the reason it now works is that the\n>> git-completion.bash script no longer returns anything\n>> for the case you mention:\n>>   git add f<tab>\n>> Instead, it seems to rely on file completion only.\n>\n>\n> I can't reproduce it with git-completion.bash from current master on its own\n> on with bash 3.1.20(4) from MSysGit, it seems to work as intended here wrt\n> tracked-file-aware file completion.\n>\n> Set up test repo with these commands:\n>\n>   git init\n>   >tracked\n>   git add tracked\n>   >non-tracked\n>   mkdir -p foo/bar\n>   >foo/bar/somefile.c\n>\n> Now let's see what happens with 'git add':\n>\n>   $ git add <TAB>\n>   foo/         non-tracked\n>\n> Note, that the file 'tracked' is not offered, so this is clearly not\n> standard bash file completion, but our completion script.  Also note the\n> trailing '/' in 'foo/'.\n>\n>   $ git add f<TAB>\n>\n> Just completes to 'git add foo/', no space after '/'.\n> Add the file:\n>\n>   $ git add foo/bar/somefile.c\n>\n> Now let's see 'git rm':\n>\n>   $ git rm <TAB>\n>   foo/     tracked\n>\n> Note, that the file 'non-tracked' is not offered, so again this comes from\n> our bash completion script.\n>\n> Did you test the bash completion script on its own, or only through the tcsh\n> wrapper?\n> I'm on MSysGit now, so no tcsh or bash v4 at hand, and no time either, so\n> can't dig further at the moment.\n>\n\nThanks Gábor, I can see the behaviour you describe now.  I was running\nthe new bash completion with an old git and that had an impact.\nWith a recent git installation I can see the problem, which includes\nthat with tcsh, the / at the end of foo is missing.\nI had a patch for that a while ago that I can revive and post soon.\n\nThanks again!\n\nMarc\n"}]}