GNU bug report logs - #54177
28.0.91; project-find-regexp misbehaves with ripgrep over tramp/sudo

Previous Next

Package: emacs;

Reported by: Dmitry Gutov <dgutov <at> yandex.ru>

Date: Sun, 27 Feb 2022 02:46:01 UTC

Severity: normal

Found in version 28.0.91

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: 54177 <at> debbugs.gnu.org
Subject: bug#54177: 28.0.91; project-find-regexp misbehaves with ripgrep over tramp/sudo
Date: Sun, 27 Feb 2022 04:45:14 +0200
It shows only one match per file, apparently because the process
invocations over the 'sudo' transport are recognized as working in a
terminal. At least by ripgrep.

To repro:

1. (setq xref-search-program 'ripgrep)
2. C-x C-f /sudo:dgutov <at> localhost:vc/emacs/ RET
3. M-x project-find-regexp RET associative RET
4. Note seeing only one match per file.

FWIW, the fix is really simple:

diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el
index 0ee7dd5cad..2fd5e19237 100644
--- a/lisp/progmodes/xref.el
+++ b/lisp/progmodes/xref.el
@@ -1626,7 +1626,7 @@ xref-search-program-alist
     (ripgrep
      .
      ;; '!*/' is there to filter out dirs (e.g. submodules).
-     "xargs -0 rg <C> --null -nH --no-messages -g '!*/' -e <R>"
+     "xargs -0 rg <C> --null -nH --no-heading --no-messages -g '!*/' -e 
<R>"
      ))
   "Associative list mapping program identifiers to command templates.

Is this okay for Emacs 28?

The problem might affect other Tramp transports as well (for all I
know), or maybe even other platforms. The risk for the fix seems minimal.




This bug report was last modified 3 years and 145 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.