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

From: Adam Tkac <[email-masked]>
Date: Thu, 22 Nov 2012 16:41:21 +0100

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 <[email-masked]>
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 <[email-masked]>
Signed-off-by: Holger Arnold <[email-masked]>
---
 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