helm-projectile icon indicating copy to clipboard operation
helm-projectile copied to clipboard

helm-projectile-grep not finding project root

Open eamonnsullivan opened this issue 4 years ago • 3 comments

Expected behavior

When inside a git repo, running helm-projectile-grep shouldn't ask me for a starting directory.

projectile-grep (the non-helm flavor) works as expected.

Possibly an unintended side effect of this commit?

Actual behavior

The command asks me for a starting directory and then only finds results under that directory.

Steps to reproduce the problem

  1. open a file deep in a git repo
  2. run M-x helm-projectile-grep (Previously, this would start a project-wide search based on the word my cursor is on.)
  3. it asks for a starting directory.

Backtraces if necessary (M-x toggle-debug-on-error)

There's no error. This is how projectile and helm-projectile are configured for me:

(use-package projectile
  :demand
  :diminish projectile-mode
  :init
  (use-package helm-projectile
    :config
    (helm-projectile-on)
    :bind (("C-c p p" . helm-projectile-switch-project)))
  (setq projectile-use-git-grep t)
  :config
  (projectile-mode t)
  (setq projectile-completion-system 'helm)
  (setq projectile-switch-project-action 'projectile-find-file)
  (add-to-list 'projectile-globally-ignored-directories "node-modules")
  (add-to-list 'projectile-globally-ignored-files "node-modules")
  :bind   (("s-f" . projectile-find-file)
           ("s-F" . projectile-grep)))

Environment & version information

  • helm-projectile version: master (I'm using straight.el)
  • helm version (in helm-pkg.el): 3.6.2
  • projectile version (M-x projectile-version): 2.2.0snapshot
  • Emacs version (M-x emacs-version): GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.18, cairo version 1.16.0) of 2020-05-18
  • OS: Ubuntu 20.04 LTS

eamonnsullivan avatar May 19 '20 13:05 eamonnsullivan

I found it. It's the addition of "D" in interactive in helm-projectile-grep and helm-projectile-ack. I'll submit a patch?

eamonnsullivan avatar May 19 '20 14:05 eamonnsullivan

https://github.com/bbatsov/helm-projectile/pull/140

eamonnsullivan avatar May 19 '20 14:05 eamonnsullivan

The problematic commit was reverted. I didn't pay much attention to it. Sorry about that!

bbatsov avatar May 20 '20 18:05 bbatsov