git/list[1] front-page[2] threads[3] people[4] search[5] about
 

RE: [feature request] git add completion should exclude staged content

From
Marc Khouzam <marc.khouzam@ericsson.com>
Date
Jan 30, 2013, 14:06 UTC
Message-ID
<E59706EF8DB1D147B15BECA3322E4BDC097A7E@eusaamb103.ericsson.se>
In-Reply-To
<5106DC87.7090607@gmail.com>
Show 28 quoted lines
> -----Original Message-----
> From: git-owner@vger.kernel.org 
> [mailto:git-owner@vger.kernel.org] On Behalf Of Manlio Perillo
> Sent: Monday, January 28, 2013 3:16 PM
> To: Junio C Hamano
> Cc: Michael J Gruber; wookietreiber; git@vger.kernel.org
> Subject: Re: [feature request] git add completion should 
> exclude staged content
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Il 28/01/2013 18:52, Junio C Hamano ha scritto:
> > [...]
> > 
> > Thanks both for commenting.  I'll find time to read it over again
> > and perhaps we can merge it to 'next' and advertise it in the next
> > issue of "What's cooking" report to ask for wider testing to move it
> > forward.
> 
> Thanks.
> 
> 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,

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. 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 hoping we can straighten this out and have git-completion.bash add the '/' all the time.

Could you explain when the problem happens?
Thanks
Marc
Previous: Manlio PerilloNext: Manlio Perillo
Message 9 of 13 in “[feature request] git add completion should exclude staged content”
  1. wookietreiberJan 26, 2013
  2. Junio C HamanoJan 27, 2013
  3. Manlio PerilloJan 28, 2013
  4. Michael J GruberJan 28, 2013
  5. Manlio PerilloJan 28, 2013
  6. Michael J GruberJan 28, 2013
  7. Junio C HamanoJan 28, 2013
  8. Manlio PerilloJan 28, 2013
  9. Marc KhouzamJan 30, 2013
  10. Manlio PerilloJan 30, 2013
  11. Marc KhouzamJan 30, 2013
  12. Manlio PerilloJan 30, 2013
  13. Manlio PerilloJan 28, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.