Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

grep is failing #47

Closed
jthalliley opened this issue Nov 29, 2019 · 14 comments
Closed

grep is failing #47

jthalliley opened this issue Nov 29, 2019 · 14 comments

Comments

@jthalliley
Copy link

As you can see below, I just re-installed fancy-git, and there's an issue with a grep command in the fancy-git. It seems that "-P" is the issue ... Perl style regex's are experimental and apparently not available on MacOS.

image

@jthalliley
Copy link
Author

jthalliley commented Nov 29, 2019

Here's a better screenshot, after I changed fonts to SourceCodePro+Powerline.

image

@jthalliley
Copy link
Author

Closed by mistake.

@jthalliley
Copy link
Author

I was able to resolve this by doing:

brew install grep
and adding/usr/local/opt/grep/libexec/gnubinto my PATH ahead of /usr/bin.

@diogocavilha
Copy link
Owner

I wonder if the grep command would work properly even without the -P parameter. This way you should not worry

@diogocavilha
Copy link
Owner

diogocavilha commented Nov 29, 2019

Hi @jthalliley

I've just reopened this issue because I know how to solve that.

I'll change the way some RegExp are formed here, so I won't need the -P anymore.

Even though your workaround will solve some problems with a few aliases as well.

I'll add that one to the docs, on the troubleshooting session.

Thank you.

@jthalliley
Copy link
Author

Cool thx.

@jespermbyskov
Copy link

jespermbyskov commented Aug 26, 2021

This issue has resurfaced, I guess due to line 27 in a84ff9e#diff-bb471c844bf5fa8652c53f77d6598f589dcf28613d067be0b4808f7c771aa161.

Update: I tried removing the -P option, leaving only -o and I am not seeing any problems. But I did not look into what that line do, so I do not know if it changes any behaviour.

@diogocavilha
Copy link
Owner

Hi, @jespermbyskov

Thank you for your report.

If you do brew install grep and adding /usr/local/opt/grep/libexec/gnubin to the PATH ahead of /usr/bin that problem might vanish.

Please, let me know if it works for you.

@jespermbyskov
Copy link

jespermbyskov commented Aug 27, 2021

Thanks, but for now, removing the -P option works for me, so I will just leave it with that.

@diogocavilha
Copy link
Owner

Hum, I see, just be aware that there are other commands that use this parameter on grep too.

They are: gpsob, guser, guser, grba, gg and gplob

Maybe running brew install grep would solve that problem.

@imtiendat0311
Copy link

i already install grep and also insert before and it's not solve probem
my PATH :
/usr/local/opt/grep/libexec/gnubin
:/usr/local/bin
:/usr/bin
:/bin
:/usr/sbin
:/sbin
:/Library/TeX/texbin
:/Library/Apple/usr/bin
Screen Shot 2022-02-12 at 12 56 23 PM

@diogocavilha
Copy link
Owner

@superboo0311

I'm so sorry for that.

I've been thinking about using grep without that option. It seems to have lots of issues when using Mac OS.

I'll try to solve that on next version.

@monicaluodialpad
Copy link

Having issue like @imtiendat0311 mentioned here

@henhal
Copy link

henhal commented Jul 1, 2024

brew install grep followed by export PATH="/opt/homebrew/opt/grep/libexec/gnubin:$PATH" first in my ~/.bash_profile did the thing for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants