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: Later pattern matches filename #2170

Open
xuchunyang opened this issue Jul 6, 2019 · 6 comments
Open

Grep: Later pattern matches filename #2170

xuchunyang opened this issue Jul 6, 2019 · 6 comments
Labels

Comments

@xuchunyang
Copy link
Member

In Grep action, the pattern package use matches ;;; Package Manager, even there is no use in it. It is because the second pattern use is matching the filename /Users/xcy/foo.txt:

~ $ grep -niH -e package /Users/xcy/foo.txt  | grep --color=always -i  use
/Users/xcy/foo.txt:1:;;; Package Manager
~ $
@thierryvolpiatto
Copy link
Member

Please be more explicit (recipe ?), I don't understand what you mean, I tried with ack-grep and rg as backend on the /lisp directory of Emacs and had no problems with "package use" as pattern.

@xuchunyang
Copy link
Member Author

When I search with the pattern package use, the results contains ;;; Package Manager.

@xuchunyang
Copy link
Member Author

If you're on Linux, you should be able to reproduce:

  1. echo hello > ~/test.txt
  2. use helm grep to search with the pattern hello home

The result shouldn't empty, which is unexpected/unwanted to me.

@thierryvolpiatto
Copy link
Member

When using same command line as Helm in a shell, I have one result (same as Helm) with ack and indeed no result with grep whereas with Helm I have ine result as well.
Here the command lines used by Helm:
Ack:

** 15:08:06.683898 (helm-grep-init)
 Command line used was:

>>> ack-grep -Hn --color --smart-case --no-group  hello /home/thierry/tmp/test.txt  | ack-grep --smart-case --color  home

Grep:

** 15:11:17.459792 (helm-grep-init)
 Command line used was:

>>> grep --color=always -d skip --exclude=.\#\* --exclude=\*.o --exclude=\*\~ --exclude=\*.bin --exclude=\*.lbin --exclude=\*.so --exclude=\*.a --exclude=\*.ln --exclude=\*.blg --exclude=\*.bbl --exclude=\*.elc --exclude=\*.lof --exclude=\*.glo --exclude=\*.idx --exclude=\*.lot --exclude=\*.fmt --exclude=\*.tfm --exclude=\*.class --exclude=\*.fas --exclude=\*.lib --exclude=\*.mem --exclude=\*.x86f --exclude=\*.sparcf --exclude=\*.dfsl --exclude=\*.pfsl --exclude=\*.d64fsl --exclude=\*.p64fsl --exclude=\*.lx64fsl --exclude=\*.lx32fsl --exclude=\*.dx64fsl --exclude=\*.dx32fsl --exclude=\*.fx64fsl --exclude=\*.fx32fsl --exclude=\*.sx64fsl --exclude=\*.sx32fsl --exclude=\*.wx64fsl --exclude=\*.wx32fsl --exclude=\*.fasl --exclude=\*.ufsl --exclude=\*.fsl --exclude=\*.dxl --exclude=\*.lo --exclude=\*.la --exclude=\*.gmo --exclude=\*.mo --exclude=\*.toc --exclude=\*.aux --exclude=\*.cp --exclude=\*.fn --exclude=\*.ky --exclude=\*.pg --exclude=\*.tp --exclude=\*.vr --exclude=\*.cps --exclude=\*.fns --exclude=\*.kys --exclude=\*.pgs --exclude=\*.tps --exclude=\*.vrs --exclude=\*.pyc --exclude=\*.pyo -niH -e hello /home/thierry/tmp/test.txt  | grep --color=always -i  home

@thierryvolpiatto
Copy link
Member

So I don't know yet why Helm display one result with Grep backend, will look into this if I find some time.
Thanks.

@thierryvolpiatto
Copy link
Member

This is hard to fix since the subsequent grep calls use the output of the first grep which must use filename and linum.
So for now I have no idea how to fix this.

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

No branches or pull requests

2 participants