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

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

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Apr 16, 2012, 20:59 UTC
Message-ID
<20120416205952.GJ12613@burratino>
In-Reply-To
<CAMP44s23_Qx3R9TX4frM-JYNv7XT3eVbcZ_D45nEdh0rq-O8kA@mail.gmail.com>

(cc-ing the bash-completion-devel list) Felipe Contreras wrote:

> On Mon, Apr 16, 2012 at 11:46 PM, Jonathan Nieder <jrnieder@gmail.com> wrote:
>> Felipe Contreras wrote:
Show 8 quoted lines
>>> Now, even if you use the bash completion library, it still does export
>>> functions without a prefix
>>
>> Are you sure?  "complete" is a bash builtin and has nothing to do with
>> the bash completion library except that the latter uses it.
>
> I already provided examples:
> have(), quote(), dequote(), quote_readline()

Ah, that's what you mean. Thanks for the pointers, and sorry to have misunderstood.

There's a little oddity here. "have" is clearly an unwanted backward compatibility feature:

	# @deprecated should no longer be used; generally not needed with dynamically
	#             loaded completions, and _have is suitable for runtime use.
	have()
	[...]
	unset -f have
	unset have

But "quote", "dequote", and "quote_readline" do not get the same treatment. Perhaps they are for backward compatibility, too, but are so widely used that there is no hope of ever getting rid of them.

Hopefully this information helps clarify to what extent the leading underscores in functions exposed by completion scripts are meant or are not meant as a convention.

Jonathan

_______________________________________________ Bash-completion-devel mailing list Bash-completion-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/bash-completion-devel

Previous: Felipe ContrerasNext: Ville Skyttä
Message 14 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.