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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 54177 in the body.
You can then email your comments to 54177 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#54177; Package emacs. (Sun, 27 Feb 2022 02:46:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Dmitry Gutov <dgutov <at> yandex.ru>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sun, 27 Feb 2022 02:46:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: bug-gnu-emacs <at> gnu.org
Subject: 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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54177; Package emacs. (Sun, 27 Feb 2022 07:33:01 GMT) Full text and rfc822 format available.

Message #8 received at 54177 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 54177 <at> debbugs.gnu.org
Subject: Re: bug#54177: 28.0.91;
 project-find-regexp misbehaves with ripgrep over tramp/sudo
Date: Sun, 27 Feb 2022 09:31:44 +0200
> Date: Sun, 27 Feb 2022 04:45:14 +0200
> From: Dmitry Gutov <dgutov <at> yandex.ru>
> 
> --- 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?

Is this additional switch supported by all versions of 'rg'?




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54177; Package emacs. (Sun, 27 Feb 2022 13:08:01 GMT) Full text and rfc822 format available.

Message #11 received at 54177 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 54177 <at> debbugs.gnu.org
Subject: Re: bug#54177: 28.0.91; project-find-regexp misbehaves with ripgrep
 over tramp/sudo
Date: Sun, 27 Feb 2022 15:07:46 +0200
On 27.02.2022 09:31, Eli Zaretskii wrote:
> Is this additional switch supported by all versions of 'rg'?

Yes, of course. It's been there from the beginning.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54177; Package emacs. (Sun, 27 Feb 2022 13:17:01 GMT) Full text and rfc822 format available.

Message #14 received at 54177 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Dmitry Gutov <dgutov <at> yandex.ru>
Cc: 54177 <at> debbugs.gnu.org
Subject: Re: bug#54177: 28.0.91; project-find-regexp misbehaves with ripgrep
 over tramp/sudo
Date: Sun, 27 Feb 2022 15:16:31 +0200
> Date: Sun, 27 Feb 2022 15:07:46 +0200
> Cc: 54177 <at> debbugs.gnu.org
> From: Dmitry Gutov <dgutov <at> yandex.ru>
> 
> On 27.02.2022 09:31, Eli Zaretskii wrote:
> > Is this additional switch supported by all versions of 'rg'?
> 
> Yes, of course. It's been there from the beginning.

Then I'm okay with installing this on the release branch.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#54177; Package emacs. (Sun, 27 Feb 2022 13:29:02 GMT) Full text and rfc822 format available.

Message #17 received at 54177 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 54177 <at> debbugs.gnu.org
Subject: Re: bug#54177: 28.0.91; project-find-regexp misbehaves with ripgrep
 over tramp/sudo
Date: Sun, 27 Feb 2022 15:28:46 +0200
On 27.02.2022 15:16, Eli Zaretskii wrote:
> Then I'm okay with installing this on the release branch.

Thanks, done.




Reply sent to Dmitry Gutov <dgutov <at> yandex.ru>:
You have taken responsibility. (Sun, 27 Feb 2022 13:42:02 GMT) Full text and rfc822 format available.

Notification sent to Dmitry Gutov <dgutov <at> yandex.ru>:
bug acknowledged by developer. (Sun, 27 Feb 2022 13:42:02 GMT) Full text and rfc822 format available.

Message #22 received at 54177-done <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 54177-done <at> debbugs.gnu.org
Subject: Re: bug#54177: 28.0.91; project-find-regexp misbehaves with ripgrep
 over tramp/sudo
Date: Sun, 27 Feb 2022 15:41:21 +0200
On 27.02.2022 15:28, Dmitry Gutov wrote:
> On 27.02.2022 15:16, Eli Zaretskii wrote:
>> Then I'm okay with installing this on the release branch.
> 
> Thanks, done.
> 
> 
> 

And closing.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Mon, 28 Mar 2022 11:24:10 GMT) Full text and rfc822 format available.

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

Previous Next


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