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

Re: [PATCH] Add tcsh-completion support to contrib by using git-completion.bash

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Nov 15, 2012, 02:40 UTC
Message-ID
<CAMP44s2Nsxu9CsTxAXiSamjA5SqxwB2qWx72vu8Mit1ruLMWJg@mail.gmail.com>
In-Reply-To
<20121114001159.GA14631@goldbirke>
On Wed, Nov 14, 2012 at 1:11 AM, SZEDER Gábor <szeder@ira.uka.de> wrote:
Show 10 quoted lines
> On Tue, Nov 13, 2012 at 07:31:45PM +0100, Felipe Contreras wrote:
>> On Mon, Nov 12, 2012 at 9:07 PM, Marc Khouzam <marc.khouzam@gmail.com> wrote:
>> > +       # Call _git() or _gitk() of the bash script, based on the first
>> > +       # element of the command-line
>> > +       _${COMP_WORDS[0]}
>>
>> You might want to use __${COMP_WORDS[0]}_main instead.
>
> That wouldn't work.  __git_main() doesn't set up the
> command-line-specific variables, but the wrapper around it does.

Yeah, but you can set those command-line-specific variables manually, like the zsh completion wrapper does.

The problem with the _git wrapper is that it will call the bash-specific complete command.

Show 11 quoted lines
>> > +# Make the script executable if it is not
>> > +if ( ! -x ${__git_tcsh_completion_script} ) then
>> > +       chmod u+x ${__git_tcsh_completion_script}
>> > +endif
>>
>> Why not just source it?
>
> The goal is to re-use a Bash script to do completion in tcsh.  They
> are two different breeds, tcsh doesn't grok bash.  So sourcing the
> completion script is not an option, but we can still run it via Bash
> and use it's results.
I see, but the tcsh script can do something like this:

bash <<\EOF echo $BASH \EOF

Cheers.
-- 
Felipe Contreras
Previous: SZEDER GáborNext: Marc Khouzam
Message 37 of 39 in “Fwd: [PATCH] Add tcsh-completion support to contrib by using git-completion.bash”
  1. Marc KhouzamNov 12, 2012
  2. SZEDER GáborNov 13, 2012
  3. Marc KhouzamNov 13, 2012
  4. SZEDER GáborNov 13, 2012
  5. completion: remove 'help' duplicate from porcelain commandsSZEDER Gábor, Nov 14, 2012
  6. Marc KhouzamNov 14, 2012
  7. tcsh-completion re-using git-completion.bashMarc Khouzam, Nov 15, 2012
  8. Felipe ContrerasNov 16, 2012
  9. Marc KhouzamNov 16, 2012
  10. Felipe ContrerasNov 16, 2012
  11. Marc KhouzamNov 16, 2012
  12. tcsh-completion re-using git-completion.bashMarc Khouzam, Nov 16, 2012
  13. Felipe ContrerasNov 16, 2012
  14. tcsh-completion re-using git-completion.bashMarc Khouzam, Nov 16, 2012
  15. Junio C HamanoNov 16, 2012
  16. Felipe ContrerasNov 16, 2012
  17. Felipe ContrerasNov 16, 2012
  18. Marc KhouzamNov 16, 2012
  19. Felipe ContrerasNov 16, 2012
  20. SZEDER GáborNov 16, 2012
  21. Felipe ContrerasNov 16, 2012
  22. SZEDER GáborNov 16, 2012
  23. Felipe ContrerasNov 16, 2012
  24. SZEDER GáborNov 17, 2012
  25. Felipe ContrerasNov 17, 2012
  26. SZEDER GáborNov 17, 2012
  27. Junio C HamanoNov 16, 2012
  28. Felipe ContrerasNov 16, 2012
  29. Marc KhouzamNov 17, 2012
  30. Felipe ContrerasNov 17, 2012
  31. Marc KhouzamNov 20, 2012
  32. Felipe ContrerasNov 20, 2012
  33. Marc KhouzamNov 20, 2012
  34. Junio C HamanoNov 20, 2012
  35. Felipe ContrerasNov 13, 2012
  36. SZEDER GáborNov 14, 2012
  37. Felipe ContrerasNov 15, 2012
  38. Marc KhouzamNov 14, 2012
  39. SZEDER GáborNov 14, 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.