X-Git-Url: https://code.delx.au/gnu-emacs-elpa/blobdiff_plain/2f4c2c1b7de390b2135bbc2b2795014f3e73e771..ad1c0ab291d7bd2a2a39a54a897b91dcf1e065ad:/packages/swiper/counsel.el diff --git a/packages/swiper/counsel.el b/packages/swiper/counsel.el index 4a97913df..1b5e26070 100644 --- a/packages/swiper/counsel.el +++ b/packages/swiper/counsel.el @@ -175,6 +175,11 @@ (when file (find-file file)))) +(defun counsel-git-grep-count (str) + "Quickly count the amount of git grep STR matches." + (shell-command-to-string + (format "git grep -c '%s' | sed 's/.*:\\(.*\\)/\\1/g' | awk '{s+=$1} END {print s}'" str))) + (defun counsel-git-grep-function (string &optional _pred &rest _unused) "Grep in the current git repository for STRING." (split-string