I would like to give some options for magit-grep
running with the foo parameter results in
git --no-pager grep -n foo
I would give him options
git --no-pager grep -n foo (options to include *.html and exclude *.py, etc)
It should not be magit-grep, what is the best git grep solution in emacs?
Magit-grep
(magit-define-command grep (&optional pattern) (interactive) (let ((pattern (or pattern (read-string "git grep: " (shell-quote-argument (grep-tag-default)))))) (with-current-buffer (generate-new-buffer "*Magit Grep*") (let ((default-directory (magit-get-top-dir))) (insert magit-git-executable " " (mapconcat 'identity magit-git-standard-options " ") " grep -n " (shell-quote-argument pattern) "\n\n") (magit-git-insert (list "grep" "--line-number" pattern)) (grep-mode) (pop-to-buffer (current-buffer))))))
source share