emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master 2ae7d74 058/167: Fix the count in user-specified counsel-g


From: Oleh Krehel
Subject: [elpa] master 2ae7d74 058/167: Fix the count in user-specified counsel-git-grep
Date: Tue, 08 Dec 2015 10:49:53 +0000

branch: master
commit 2ae7d74916f93ae11c9dddd9df0c47e4d6b62e77
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>

    Fix the count in user-specified counsel-git-grep
    
    * counsel.el (counsel--gg-count): Generate the count command from
    `counsel-git-grep-cmd' by replacing "--full-name" with "-c".
    
    Re #244
---
 counsel.el |   15 +++++++++++----
 1 files changed, 11 insertions(+), 4 deletions(-)

diff --git a/counsel.el b/counsel.el
index 25f1f44..402f55c 100644
--- a/counsel.el
+++ b/counsel.el
@@ -742,10 +742,17 @@ The libraries are offered from `load-path'."
   "Quickly and asynchronously count the amount of git grep REGEX matches.
 When NO-ASYNC is non-nil, do it synchronously."
   (let ((default-directory counsel--git-grep-dir)
-        (cmd (format "git grep -i -c '%s' | sed 's/.*:\\(.*\\)/\\1/g' | awk 
'{s+=$1} END {print s}'"
-                     (replace-regexp-in-string
-                      "-" "\\\\-"
-                      (replace-regexp-in-string "'" "''" regex))))
+        (cmd
+         (concat
+          (format
+           (replace-regexp-in-string
+            "--full-name" "-c"
+            counsel-git-grep-cmd)
+           ;; "git grep -i -c '%s'"
+           (replace-regexp-in-string
+            "-" "\\\\-"
+            (replace-regexp-in-string "'" "''" regex)))
+          " | sed 's/.*:\\(.*\\)/\\1/g' | awk '{s+=$1} END {print s}'"))
         (counsel-ggc-process " *counsel-gg-count*"))
     (if no-async
         (string-to-number (shell-command-to-string cmd))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]