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

[PATCH] Fix bash completion when `egrep` is aliased to `egrep --color=always`

From
ATAdam Tkac <atkac@redhat.com>
Date
Nov 22, 2012, 15:41 UTC
Message-ID
<20121122154120.GA16835@redhat.com>
Hello all,
attached patch fixes bash completion when `egrep` is aliased to `egrep --color=always`.
Comments are welcomed.
Regards, Adam
-- 
Adam Tkac, Red Hat, Inc.


>From 2b62bd71af1158129492f74f0b77c9840a49507f Mon Sep 17 00:00:00 2001
From: Adam Tkac <atkac@redhat.com>
Date: Thu, 22 Nov 2012 16:34:58 +0100
Subject: [PATCH] Fix bash completion when `egrep` is aliased to `egrep
 --color=always`

Originally reported as https://bugzilla.redhat.com/show_bug.cgi?id=863780

Signed-off-by: Adam Tkac <atkac@redhat.com>
Signed-off-by: Holger Arnold <holgerar@gmail.com>
---
 contrib/completion/git-completion.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index bc0657a..47613f9 100644
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -565,7 +565,7 @@ __git_complete_strategy ()
 __git_list_all_commands ()
 {
 	local i IFS=" "$'\n'
-	for i in $(git help -a|egrep '^  [a-zA-Z0-9]')
+	for i in $(git help -a|egrep --color=never '^  [a-zA-Z0-9]')
 	do
 		case $i in
 		*--*)             : helper pattern;;
-- 
1.8.0
Next: Marc Khouzam
Message 1 of 4 in “Fix bash completion when `egrep` is aliased to `egrep --color=always`”
  1. Fix bash completion when `egrep` is aliased to `egrep --color=always`Adam Tkac, Nov 22, 2012
  2. Marc KhouzamNov 22, 2012
  3. Adam TkacNov 26, 2012
  4. Frans KlaverNov 26, 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.