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

Re: [PATCH v4] git-completion.bash: add support for path completion

From
Manlio Perillo <manlio.perillo@gmail.com>
Date
Jan 6, 2013, 18:00 UTC
Message-ID
<50E9BBB5.3000707@gmail.com>
In-Reply-To
<7vehi0qh4x.fsf@alter.siamese.dyndns.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Il 05/01/2013 07:27, Junio C Hamano ha scritto:
Show 11 quoted lines
> Junio C Hamano <gitster@pobox.com> writes:
> 
>> Marc Khouzam <marc.khouzam@ericsson.com> writes:
>>
>>> I've been playing with it but I'm not getting the expected 
>>> behavior when I cd to a sub-directory.
>>
>> Thanks for testing.  Manlio?
> 
> Can you try the attached patch?
> 
Thanks, it seems to fix the problem.
Show 10 quoted lines
> As I am not familiar with the completion machinery, take this with a
> large grain of salt.  Here is my explanation of what is going on in
> this "how about this" fixup:
> 
>  * Giving --git-dir from the command line (or GIT_DIR environment)
>    without specifying GIT_WORK_TREE is to signal Git that you are at
>    the top of the working tree.  "git ls-files" will then show the
>    full tree even outside the real $cwd because you are lying to
>    Git.
> 

I was not aware of this, and blindly copied the code from the other existing functions. However the other completion functions never have to deal with paths in the working directory.

I have applied the patch to my local branch.
> [...]
Regards   Manlio
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlDpu7UACgkQscQJ24LbaUSmUACgl+OKUyvpp183kFZGmBpOfqm1 yqEAnjxcqmZYvWSeIpOo6cNFl/dnMH76 =oE/+ -----END PGP SIGNATURE-----

Previous: Manlio Perillo
Message 15 of 15 in “git-completion.bash: add support for path completion”
  1. git-completion.bash: add support for path completionManlio Perillo, Dec 21, 2012
  2. Junio C HamanoDec 21, 2012
  3. Manlio PerilloDec 21, 2012
  4. Marc KhouzamJan 4, 2013
  5. Junio C HamanoJan 4, 2013
  6. Junio C HamanoJan 5, 2013
  7. Marc KhouzamJan 5, 2013
  8. Manlio PerilloJan 5, 2013
  9. Manlio PerilloJan 6, 2013
  10. Manlio PerilloJan 7, 2013
  11. Marc KhouzamJan 7, 2013
  12. Manlio PerilloJan 8, 2013
  13. John KeepingJan 8, 2013
  14. Manlio PerilloJan 8, 2013
  15. Manlio PerilloJan 6, 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.