all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: npostavs@users.sourceforge.net
To: Tom Tromey <tom@tromey.com>, Dmitry Gutov <dgutov@yandex.ru>
Cc: 27840@debbugs.gnu.org
Subject: bug#27840: 26.0.50; vc-git-grep stopped working on git master
Date: Wed, 26 Jul 2017 19:32:18 -0400	[thread overview]
Message-ID: <87inie93lp.fsf@users.sourceforge.net> (raw)
In-Reply-To: <87shhj3wtc.fsf@pokyo> (Tom Tromey's message of "Wed, 26 Jul 2017 11:57:51 -0600")

[-- Attachment #1: Type: text/plain, Size: 756 bytes --]

Tom Tromey <tom@tromey.com> writes:

> I am running a build of git master from yesterday.
> I tried M-x vc-git-grep.
>
> This successfully runs the grep and puts the output into *grep*.
> However, the highlighting is incorrect and M-x next-error claims there
> are no grep hits.  Using C-c (compile-goto-error) in *grep* also does
> not work.

This is due to [1: 644cdd1aa0].  'git grep' also has a '--null' option,
but the output is a bit different.  Here is a patch to handle it,
although it's not complete: it doesn't take the value of
grep-use-null-filename-separator into account.  Perhaps we should
instead disable this option by default; when I introduced it, I didn't
think about the fact that grep.el is used for not-quite-grep programs as
well.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: patch --]
[-- Type: text/x-diff, Size: 1907 bytes --]

From 60acf5de6dacb5ea3430a1115ba8c1151a07d526 Mon Sep 17 00:00:00 2001
From: Noam Postavsky <npostavs@gmail.com>
Date: Wed, 26 Jul 2017 19:21:55 -0400
Subject: [PATCH v1] Use '--null' for 'git grep' too (Bug#27840)

* lisp/vc/vc-git.el (vc-git-grep): Pass '--null'.
* lisp/progmodes/grep.el (grep--regexp-alist-bin-matcher): Handle the
slightly different output from 'git grep's --null option.
---
 lisp/progmodes/grep.el | 5 +++--
 lisp/vc/vc-git.el      | 4 ++--
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index 2ddaf884bc..4723290fbe 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -387,8 +387,9 @@ (defconst grep--regexp-alist-column
 (defconst grep--regexp-alist-bin-matcher
   '("^Binary file \\(.+\\) matches$" 1 nil nil 0 1))
 (defconst grep-with-null-regexp-alist
-  `(("^\\([^\0]+\\)\\(\0\\)\\([0-9]+\\):" 1 3 ,grep--regexp-alist-column nil nil
-     (2 '(face unspecified display ":")))
+  `(("^\\([^\0]+\\)\\(\0\\)\\([0-9]+\\)\\([\0:]\\)" 1 3 ,grep--regexp-alist-column nil nil
+     (2 '(face unspecified display ":"))
+     (4 '(face unspecified display ":")))
     ,grep--regexp-alist-bin-matcher)
   "Regexp used to match grep hits.
 See `compilation-error-regexp-alist'.")
diff --git a/lisp/vc/vc-git.el b/lisp/vc/vc-git.el
index cc3e295641..1cdcfb3a5c 100644
--- a/lisp/vc/vc-git.el
+++ b/lisp/vc/vc-git.el
@@ -1433,8 +1433,8 @@ (defun vc-git-grep (regexp &optional files dir)
 	      (setq command nil))
 	(setq dir (file-name-as-directory (expand-file-name dir)))
 	(setq command
-	      (grep-expand-template "git --no-pager grep -n -e <R> -- <F>"
-                                    regexp files))
+	      (grep-expand-template
+               "git --no-pager grep -n --null -e <R> -- <F>" regexp files))
 	(when command
 	  (if (equal current-prefix-arg '(4))
 	      (setq command
-- 
2.11.1


[-- Attachment #3: Type: text/plain, Size: 180 bytes --]



[1: 644cdd1aa0]: 2017-07-19 20:03:00 -0400
  Use grep's --null option (Bug#6843)
  http://git.savannah.gnu.org/cgit/emacs.git/commit/?id=644cdd1aa0a10dbfffa3b9b4c7a97f8cddded0b8

  reply	other threads:[~2017-07-26 23:32 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-26 17:57 bug#27840: 26.0.50; vc-git-grep stopped working on git master Tom Tromey
2017-07-26 23:32 ` npostavs [this message]
2017-07-27 13:23   ` Dmitry Gutov
2017-07-30 18:08     ` npostavs
2017-08-01 13:36       ` Dmitry Gutov
2017-08-03  3:09         ` npostavs
2017-08-04  0:59           ` Dmitry Gutov
2017-08-04 22:31             ` npostavs
2017-08-07  0:39               ` npostavs
2017-07-27 13:26 ` vc-git-grep vs project-find-regexp: Was: " Dmitry Gutov
2017-07-27 22:05   ` Tom Tromey
2017-07-29 22:58   ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87inie93lp.fsf@users.sourceforge.net \
    --to=npostavs@users.sourceforge.net \
    --cc=27840@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.