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 17, 2012, 20:53 UTC
Message-ID
<CAMP44s0w40ViecQsF8AeQLLxAEShC54TTyvcPVMabpOZ+DYDqQ@mail.gmail.com>
In-Reply-To
<7v4nsins1j.fsf@alter.siamese.dyndns.org>
On Tue, Apr 17, 2012 at 9:15 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 23 quoted lines
> Felipe Contreras <felipe.contreras@gmail.com> writes:
>
>> On Tue, Apr 17, 2012 at 6:50 PM, Junio C Hamano <gitster@pobox.com> wrote:
>>> Felipe Contreras <felipe.contreras@gmail.com> writes:
>> ...
>>>>> And foo_wrap() should also fit into those namespaces.
>>>>
>>>> Yeah, I don't have a problem with that, just forgot about it.
>>>>
>>>> But git_complete I think is different.
>>>
>>> Is git_complete something the user types interactively, or is it meant to
>>> be used in their .bashrc to help them complete arguments to their custom
>>> scripts that take arguments similar to Git Porcelains?
>>
>> It's meant for their .bashrc, but can be used interactively, exactly
>> like 'complete'. You can type 'complete -o bashdefault -o default -o
>> nospace -F _git git' in the command like, but that would rarely
>> happen.
>
> OK, then I do not think "as a public interface it looks somewhat ugly"
> (which I happen to think, and I am guessing that you agree with) matters.
> It looks to me that it would be sane to follow the convention
But that convention is for *private* functions.
> to avoid
> accidental name clashes with userspace names by naming it "__git_complete"
> in that case.
What if there are no clashes?

Are you saying that even if there are no real clashes, only hypothetical ones, you would still prefer __git_complete?

How are people going to distinguish between public and private functions?
-- 
Felipe Contreras
Previous: Junio C HamanoNext: Jonathan Nieder
Message 36 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.