From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#27840: 26.0.50; vc-git-grep stopped working on git master Date: Wed, 26 Jul 2017 19:32:18 -0400 Message-ID: <87inie93lp.fsf@users.sourceforge.net> References: <87shhj3wtc.fsf@pokyo> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1501111874 29135 195.159.176.226 (26 Jul 2017 23:31:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 26 Jul 2017 23:31:14 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2.50 (gnu/linux) Cc: 27840@debbugs.gnu.org To: Tom Tromey , Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 27 01:31:08 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1daVlj-0007BH-61 for geb-bug-gnu-emacs@m.gmane.org; Thu, 27 Jul 2017 01:31:07 +0200 Original-Received: from localhost ([::1]:40355 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1daVlp-00007Y-1H for geb-bug-gnu-emacs@m.gmane.org; Wed, 26 Jul 2017 19:31:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33703) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1daVlh-000068-Ly for bug-gnu-emacs@gnu.org; Wed, 26 Jul 2017 19:31:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1daVle-0004oW-FG for bug-gnu-emacs@gnu.org; Wed, 26 Jul 2017 19:31:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55095) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1daVle-0004oO-8m for bug-gnu-emacs@gnu.org; Wed, 26 Jul 2017 19:31:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1daVld-0004Cr-S3 for bug-gnu-emacs@gnu.org; Wed, 26 Jul 2017 19:31:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Jul 2017 23:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 27840 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 27840-submit@debbugs.gnu.org id=B27840.150111184916138 (code B ref 27840); Wed, 26 Jul 2017 23:31:01 +0000 Original-Received: (at 27840) by debbugs.gnu.org; 26 Jul 2017 23:30:49 +0000 Original-Received: from localhost ([127.0.0.1]:57769 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1daVlR-0004CE-G1 for submit@debbugs.gnu.org; Wed, 26 Jul 2017 19:30:49 -0400 Original-Received: from mail-io0-f196.google.com ([209.85.223.196]:38073) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1daVlP-0004C1-U9 for 27840@debbugs.gnu.org; Wed, 26 Jul 2017 19:30:48 -0400 Original-Received: by mail-io0-f196.google.com with SMTP id l7so12144325iof.5 for <27840@debbugs.gnu.org>; Wed, 26 Jul 2017 16:30:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=0vkrXAQLBJD4hrH+tG8oElCMKdsz10isMDJ7A/zU6Ik=; b=UNxxy5fx1DLbKrVufC+dr1lhPUucJ3wDYTDgXroP501fC1jspHkOgCO6opEPCV05R7 Rs/QRarZ6IUIddsz9AQbRkfusWUUt95IgNGe9GSWfd0lwtsxboBkHgdatMcr8eiLKX08 mbW88y1Z5gyRBVLs6yjbXbDly9vO+sKYEfkdWHrjKgC6cxi4JB7ZM9EpnGK8eAuWGGer YyGqfxO9YImfZJxIY+qcJttsxUsYAKF31uaDFnodBpbf1Hp/i0JZL2bvjPplMw9Wrlc4 sFlFCccRH5mLJqX3xKKbXec5Us7fg52XJINX4PaNQXvjKJIDERG+o5E0cw/gVUJUUSI4 0OVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=0vkrXAQLBJD4hrH+tG8oElCMKdsz10isMDJ7A/zU6Ik=; b=FCtUolcOMglwV0gqMTLlPNzUXm8l5P8vb8X7+gxPNVRNvwQxiiadBsTu9qBqEQy7sQ w7Dbfl/gykaYNVB53oNwgzKtwtF+G9Gs4k5iuifTc0RkGrxuTwLcZLDf/XgtvUhIvjQm Ak2fISw9SoKlBnnFlVj1Yvmwle9r5B2M69WrVvPC4XmakxQ7IJAcZugrYesBXoLC2TiF uEz2K4+hRdK4C7DZsko5larWKHS4TfnpaHAwW6UhNsGMqbsM7q/JvJ/UwvOEPgJddtsd Y6lpiufhmeJCOebzy6SJAAvgyR/cuZVSLSpuNmtR83r/q+dfHSQrGb94Ez3b1zlGe58Q ko1A== X-Gm-Message-State: AIVw113JvfbrJ/+TMPUtGU8ide6HWqRf42CgZt6yXxVksuPYUTjmM+Tm 3UHwdozOvG8zjy/R X-Received: by 10.107.134.87 with SMTP id i84mr2966404iod.255.1501111841950; Wed, 26 Jul 2017 16:30:41 -0700 (PDT) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id g5sm7336406ioj.30.2017.07.26.16.30.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 26 Jul 2017 16:30:41 -0700 (PDT) In-Reply-To: <87shhj3wtc.fsf@pokyo> (Tom Tromey's message of "Wed, 26 Jul 2017 11:57:51 -0600") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:135034 Archived-At: --=-=-= Content-Type: text/plain Tom Tromey 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. --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=v1-0001-Use-null-for-git-grep-too-Bug-27840.patch Content-Description: patch >From 60acf5de6dacb5ea3430a1115ba8c1151a07d526 Mon Sep 17 00:00:00 2001 From: Noam Postavsky 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 -- " - regexp files)) + (grep-expand-template + "git --no-pager grep -n --null -e -- " regexp files)) (when command (if (equal current-prefix-arg '(4)) (setq command -- 2.11.1 --=-=-= Content-Type: text/plain [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 --=-=-=--