Skip to contentSkip to conversation

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

PATCH In review Adam Tkac 3 participants 4 messages Jun 15, 2016

lore
Share & tools
lore

Adam Tkac

author
#0 lore raw

PATCH 1/1 Fix bash completion when `egrep` is aliased to `egrep --color=always`

Hello all,

attached patch fixes bash completion when egrep is aliased to egrep --color=always.

Comments are welcomed.

Regards, Adam

Signature · 1 line
Adam Tkac, Red Hat, Inc.
Quoted 1 line

From 2b62bd71af1158129492f74f0b77c9840a49507f Mon Sep 17 00:00:00 2001

From: Adam Tkac <[email protected]>
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

---
 contrib/completion/git-completion.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
contrib/completion/git-completion.bash +1 -1
index bc0657a..47613f9 100644
@@ -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;;
Signature · 1 line
1.8.0
#1 lore raw
Quoted 3 lines · Adam Tkac

Hello all,

attached patch fixes bash completion when egrep is aliased to egrep --color=always.

To avoid any aliases, it may be better to use
\egrep

This could be worthwhile for all utilities used by the script.

Just a thought.

Marc

Quoted 7 lines

Comments are welcomed.

Regards, Adam

--
Adam Tkac, Red Hat, Inc.

author
#2 lore raw
Quoted 7 lines · Marc Khouzam
Quoted 3 lines · Adam Tkac

Hello all,

attached patch fixes bash completion when egrep is aliased to egrep --color=always.

To avoid any aliases, it may be better to use
\egrep

Good idea, thanks. Improved patch is attached.

Regards, Adam

Quoted 15 lines

This could be worthwhile for all utilities used by the script.

Just a thought.

Marc

Quoted 7 lines

Comments are welcomed.

Regards, Adam

--
Adam Tkac, Red Hat, Inc.

Signature · 1 line
Adam Tkac, Red Hat, Inc.
Quoted 1 line

From 255192296cd175fddcac2647447a66a0ca55b855 Mon Sep 17 00:00:00 2001

From: Adam Tkac <[email protected]>
Date: Thu, 22 Nov 2012 16:34:58 +0100
Subject: [PATCH] If egrep is aliased, temporary disable it in
bash.completion

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

---
 contrib/completion/git-completion.bash | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
contrib/completion/git-completion.bash +1 -1
index 0960acc..79073c2 100644
@@ -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 '^  [a-zA-Z0-9]')
 	do
 		case $i in
 		*--*)             : helper pattern;;
Signature · 1 line
1.8.0
#3 lore raw
Quoted 1 line · Adam Tkac

Good idea, thanks. Improved patch is attached.

It is custom on this list to mail the patches, rather than attaching them, so people can review your changes in-line. You can read more about it in in git/Documentation/SubmittingPatches.

Cheers,
Frans