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

Re: [PATCH v2] If `egrep` is aliased, temporary disable it in bash.completion

From
Felipe Contreras <felipe.contreras@gmail.com>
Date
Dec 12, 2012, 22:34 UTC
Message-ID
<CAMP44s2QHrwv0wZ=r+_E2i19Y-zJChPHaX=UeHXaGAppNzqm6A@mail.gmail.com>
In-Reply-To
<7v4njzjbzo.fsf@alter.siamese.dyndns.org>
On Thu, Dec 6, 2012 at 12:01 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 24 quoted lines
> Adam Tkac <atkac@redhat.com> writes:
>
>> On Thu, Nov 29, 2012 at 09:33:53AM -0800, Junio C Hamano wrote:
>> ...
>>> IOW, something along this line?
>>
>> This won't work, unfortunately, because shopt settings aren't inherited by
>> subshell (and for example egrep is called in subshell).
>>
>> I discussed this issue with colleagues and we found basically two "fixes":
>>
>> 1. Tell people "do not use aliases which breaks completion script"
>> 2. Prefix all commands with "command", i.e. `command egrep` etc.
>>
>> In my opinion "2." is better long time solution, what do you think?
>
> Judging from what is in /etc/bash_completion.d/ (I am on Debian), I
> think that others are divided.  Many but not all prefix "command" in
> front of "grep", but nobody does the same for "egrep", "cut", "tr",
> "sed", etc.
>
> If it were up to me, I would say we pick #1, but I cc'ed the people
> who have been more involved in our bash-completion code because they
> are in a better position to argue between the two than I am.

Why not both? I do prefer #1, but I don't see why we wouldn't prefix some commonly problematic ones (\egrep), prefixing all of them seems overkill for me.

-- 
Felipe Contreras
Previous: Junio C Hamano
Message 6 of 6 in “If `egrep` is aliased, temporary disable it in bash.completion”
  1. If `egrep` is aliased, temporary disable it in bash.completionAdam Tkac, Nov 29, 2012
  2. Junio C HamanoNov 29, 2012
  3. Junio C HamanoNov 29, 2012
  4. Adam TkacDec 6, 2012
  5. Junio C HamanoDec 6, 2012
  6. Felipe ContrerasDec 12, 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.