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

Re: [PATCH] tcsh-completion re-using git-completion.bash

From
Marc Khouzam <marc.khouzam@gmail.com>
Date
Nov 16, 2012, 18:20 UTC
Message-ID
<CAFj1UpHMc-bHJgSZKY13YH_69TXkz-50g5xpLA6C+Eh0aqcN9A@mail.gmail.com>
In-Reply-To
<CAMP44s1RvMSBu2RJqKw9ne4cJyMO4dbFc-gW2HgsN2-uviv=fA@mail.gmail.com>

On Fri, Nov 16, 2012 at 12:18 PM, Felipe Contreras <felipe.contreras@gmail.com> wrote:

Show 16 quoted lines
> On Fri, Nov 16, 2012 at 4:48 PM, Marc Khouzam <marc.khouzam@gmail.com> wrote:
>> On Fri, Nov 16, 2012 at 10:33 AM, Felipe Contreras
>> <felipe.contreras@gmail.com> wrote:
>
>>> Is it possible to just check if this is a login shell?
>>
>> I think it would be nice to allow the user to manually
>> source git-completion.tcsh, in case they want to make
>> manual modifications to it.
>
> Yeah, they could still do that... because they would be running in a
> login shell.
>
> What I meant is that if the user does: tcsh
> my_script_that_has_nothing_to_do_with_completion.sh, they would not be
> executing this whole script.
Oh, I see now.

I can put a check in the script for the existence of the $prompt variable. This will indicate if it is a login shell or not. However, a good .cshrc file should already have such a check to avoid sourcing a bunch of useless things. So, I personally think that we should not add it to the git-completion.tcsh script but let the tcsh user decide to do it herself. But I don't mind being overruled :)

Show 6 quoted lines
>> I think the most user-friendly option is to actually re-generate the
>> script each time.  It feels wrong, but it works well :)
>
> I'm not too strongly opposed to add that function to the bash
> completion, but to do it only for tcsh doesn't sound right, specially
> when there are other alternatives.

I agree, and this is why I made the proposed __git_complete_with_output () generic. That way it could be used by other shells or programs. But at this time, only tcsh would make use of it.

If you think having __git_complete_with_output () could be useful for others, I think we should go with solution (A). If you don't think so, or if it is better to wait until a need arises first, then solution (C) will work fine.

> Correct me if I'm wrong, but very few people use tcsh.

Less than I originally thought, when I started working on this patch :-\ But I'm still hoping that the those people will be a little happier with their git completion.

Marc
>
> --
> Felipe Contreras
Previous: Felipe ContrerasNext: Felipe Contreras
Message 18 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.