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

Re: [PATCH v2] completion: add new git_complete helper

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Apr 16, 2012, 23:04 UTC
Message-ID
<CAMP44s0cdSaiCoMLk7oTHE4dies5-G0C7-RczK5OFEK=pYUW_A@mail.gmail.com>
In-Reply-To
<20120416224411.GU12613@burratino>
On Tue, Apr 17, 2012 at 1:44 AM, Jonathan Nieder <jrnieder@gmail.com> wrote:
Show 10 quoted lines
> Felipe Contreras wrote:
>
>> Even more, I just added a foobar() function in my profile, and I also
>> added a foobar() function in /etc/bash_completion.d/git. I don't see
>> my function replaced in any way, even after typing and completing
>> 'git' commands. I don't know how that's possible, but that's why I
>> don't like to take these types of claims as face value.
>
> What version of the bash_completion library do you use?  Lazy-loading
> was introduced in version 1.90.
1.99
Show 8 quoted lines
> If you put
>
>        foobar() {
>                echo hi
>        }
>        . /etc/bash_completion
>
> then is your private foobar unclobbered?

Yes, in that case it does, but that's not the default behavior, at least not in my system, and I doubt anybody would define their functions before loading library scripts.

> To answer your demand before for a function in the public interface of
> a completion script, not library, which respects or does not respect
> the bash-completion convention: see the public _rpm_installed_packages
> helper from the rpm completion script[1].

What makes you think this is public? It's under the section '# helper functions', which doesn't seem to be public. Plus, it's repeated in rpm, rpmbuild, and rpmbuild-md5.

The fact that somebody uses it doesn't mean it's public.
Cheers.
-- 
Felipe Contreras
Previous: Jonathan NiederNext: Jonathan Nieder
Message 22 of 40 in “completion: add new git_complete helper”
  1. completion: add new git_complete helperFelipe Contreras, Apr 15, 2012
  2. Jonathan NiederApr 15, 2012
  3. Felipe ContrerasApr 16, 2012
  4. Junio C HamanoApr 16, 2012
  5. Jonathan NiederApr 16, 2012
  6. Junio C HamanoApr 16, 2012
  7. Felipe ContrerasApr 16, 2012
  8. Jonathan NiederApr 16, 2012
  9. Felipe ContrerasApr 16, 2012
  10. Jonathan NiederApr 16, 2012
  11. Felipe ContrerasApr 16, 2012
  12. Jonathan NiederApr 16, 2012
  13. Felipe ContrerasApr 16, 2012
  14. Jonathan NiederApr 16, 2012
  15. Ville SkyttäApr 21, 2012
  16. Felipe ContrerasApr 21, 2012
  17. Ville SkyttäApr 21, 2012
  18. Felipe ContrerasApr 22, 2012
  19. Junio C HamanoApr 16, 2012
  20. Felipe ContrerasApr 16, 2012
  21. Jonathan NiederApr 16, 2012
  22. Felipe ContrerasApr 16, 2012
  23. Jonathan NiederApr 16, 2012
  24. Jonathan NiederApr 16, 2012
  25. Felipe ContrerasApr 17, 2012
  26. Jonathan NiederApr 17, 2012
  27. Felipe ContrerasApr 17, 2012
  28. Jonathan NiederApr 17, 2012
  29. Jonathan NiederApr 17, 2012
  30. Jonathan NiederApr 16, 2012
  31. SZEDER GáborApr 16, 2012
  32. Felipe ContrerasApr 16, 2012
  33. Junio C HamanoApr 17, 2012
  34. Felipe ContrerasApr 17, 2012
  35. Junio C HamanoApr 17, 2012
  36. Felipe ContrerasApr 17, 2012
  37. Jonathan NiederApr 17, 2012
  38. SZEDER GáborApr 17, 2012
  39. Felipe ContrerasApr 17, 2012
  40. SZEDER GáborApr 17, 2012

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.