unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#56624: 28.1.50; dired-do-find-regexp fails when using ripgrep
@ 2022-07-17 19:05 Michael Arndt
  2022-07-23  8:24 ` Lars Ingebrigtsen
  2022-07-23 13:14 ` Dmitry Gutov
  0 siblings, 2 replies; 5+ messages in thread
From: Michael Arndt @ 2022-07-17 19:05 UTC (permalink / raw)
  To: 56624

Hi,

I have the following problem when using dired-do-find-regexp. When I use 
it in a
directory that contains a binary file the search will fail with the 
following message:

xref-matches-in-files: Search failed with status 0: /tmp/test/hello_bin: 
binary file matches (found "\0" byte around offset 5)

If there are matches in non binary files they won't be shown. This only 
happens
when xref-search-program is set to 'ripgrep.

Steps the reproduce the issue with emacs -Q:

1. (customize-set-variable 'xref-search-program 'ripgrep)
2. Create the following files in a new directory (^@ is a null byte):

hello_bin:
hello^@world

hello.txt:
hello world

3. Open the directory in dired
4. Use dired-do-find-regexp on the current directory and search for "hello"

A bit of testing revealed that the issue seems to be related to the 
ordering of
the files. Renaming hello_bin to ahello_bin makes the problem go away.

Regards,
Michael


In GNU Emacs 28.1.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 
2.24.33, cairo version 1.16.0)
of 2022-04-28 built on titan
Repository revision: 3b6338c8c351cce721f2f1aa115cadc401179d5c
Repository branch: emacs-28
Windowing system distributor 'The X.Org Foundation', version 11.0.12101003
System Description: Debian GNU/Linux bookworm/sid

Configured using:
'configure CFLAGS=-O3 --with-json --with-native-compilation
--with-modules --prefix=/usr/local'

Configured features:
CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LIBSELINUX LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG
SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11 XDBE XIM XPM GTK2
ZLIB

Important settings:
value of $LC_TIME: de_DE.UTF-8
value of $LANG: en_US.UTF-8
locale-coding-system: utf-8-unix

Major mode: Dired by name

Minor modes in effect:
shell-dirtrack-mode: t
tooltip-mode: t
global-eldoc-mode: t
show-paren-mode: t
electric-indent-mode: t
mouse-wheel-mode: t
tool-bar-mode: t
menu-bar-mode: t
file-name-shadow-mode: t
global-font-lock-mode: t
font-lock-mode: t
blink-cursor-mode: t
auto-composition-mode: t
auto-encryption-mode: t
auto-compression-mode: t
buffer-read-only: t
line-number-mode: t
indent-tabs-mode: t
transient-mark-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message rmc puny rfc822 mml mml-sec epa
derived epg rfc6068 epg-config gnus-util rmail rmail-loaddefs
auth-source eieio eieio-core cl-macs eieio-loaddefs password-cache json
map mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev
gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mail-utils pcmpl-unix cl-seq em-unix em-term term disp-table
shell ehelp em-script em-prompt em-ls em-hist em-pred em-glob em-cmpl
em-dirs esh-var pcomplete em-basic em-banner em-alias esh-mode eshell
esh-cmd esh-ext esh-opt esh-proc esh-io esh-arg esh-module esh-groups
esh-util jka-compr find-func time-date subr-x novice misearch
multi-isearch cus-edit pp cus-start cus-load wid-edit cl-extra cl-print
thingatpt help-fns radix-tree help-mode vc-mtn vc-hg vc-git diff-mode
easy-mmode vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs vc vc-dispatcher
find-dired xref project seq byte-opt gv bytecomp byte-compile cconv grep
compile text-property-search comint ansi-color ring dired-aux
cl-loaddefs cl-lib dired dired-loaddefs iso-transl tooltip eldoc paren
electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image
regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode
prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu
timer select scroll-bar mouse jit-lock font-lock syntax font-core
term/tty-colors frame minibuffer cl-generic cham georgian utf-8-lang
misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms
cp51932 hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese composite emoji-zwj charscript charprop case-table
epa-hook jka-cmpr-hook help simple abbrev obarray cl-preloaded nadvice
button loaddefs faces cus-face macroexp files window text-properties
overlay sha1 md5 base64 format env code-pages mule custom widget
hashtable-print-readable backquote threads dbusbind inotify
dynamic-setting system-font-setting font-render-setting cairo
move-toolbar gtk x-toolkit x multi-tty make-network-process
native-compile emacs)

Memory information:
((conses 16 161223 7726)
(symbols 48 12285 0)
(strings 32 40956 1824)
(string-bytes 1 1319551)
(vectors 16 24441)
(vector-slots 8 470893 11729)
(floats 8 44 310)
(intervals 56 2469 97)
(buffers 992 26))





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#56624: 28.1.50; dired-do-find-regexp fails when using ripgrep
  2022-07-17 19:05 bug#56624: 28.1.50; dired-do-find-regexp fails when using ripgrep Michael Arndt
@ 2022-07-23  8:24 ` Lars Ingebrigtsen
  2022-07-23 13:14 ` Dmitry Gutov
  1 sibling, 0 replies; 5+ messages in thread
From: Lars Ingebrigtsen @ 2022-07-23  8:24 UTC (permalink / raw)
  To: Michael Arndt; +Cc: 56624, Dmitry Gutov

Michael Arndt <michael@rndt.dev> writes:

> I have the following problem when using dired-do-find-regexp. When I
> use it in a
> directory that contains a binary file the search will fail with the
> following message:
>
> xref-matches-in-files: Search failed with status 0:
> /tmp/test/hello_bin: binary file matches (found "\0" byte around
> offset 5)
>
> If there are matches in non binary files they won't be shown. This
> only happens
> when xref-search-program is set to 'ripgrep.

The support for ripgrep was added here:

commit f2a3d6e28d81dc2890e99afd550b59ff01fac5d9
Author:     Dmitry Gutov <dgutov@yandex.ru>
AuthorDate: Fri Dec 4 03:37:10 2020 +0200

    Support using ripgrep in project-find-regexp and friends

Adding Dmitry to the CCs; perhaps he has some comments.






^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#56624: 28.1.50; dired-do-find-regexp fails when using ripgrep
  2022-07-17 19:05 bug#56624: 28.1.50; dired-do-find-regexp fails when using ripgrep Michael Arndt
  2022-07-23  8:24 ` Lars Ingebrigtsen
@ 2022-07-23 13:14 ` Dmitry Gutov
  2022-07-23 17:40   ` Michael Arndt
  1 sibling, 1 reply; 5+ messages in thread
From: Dmitry Gutov @ 2022-07-23 13:14 UTC (permalink / raw)
  To: Michael Arndt, 56624

Hi!

Thanks for the report.

On 17.07.2022 22:05, Michael Arndt wrote:
> Hi,
> 
> I have the following problem when using dired-do-find-regexp. When I use 
> it in a
> directory that contains a binary file the search will fail with the 
> following message:
> 
> xref-matches-in-files: Search failed with status 0: /tmp/test/hello_bin: 
> binary file matches (found "\0" byte around offset 5)
> 
> If there are matches in non binary files they won't be shown. This only 
> happens
> when xref-search-program is set to 'ripgrep.
> 
> Steps the reproduce the issue with emacs -Q:
> 
> 1. (customize-set-variable 'xref-search-program 'ripgrep)
> 2. Create the following files in a new directory (^@ is a null byte):
> 
> hello_bin:
> hello^@world
> 
> hello.txt:
> hello world
> 
> 3. Open the directory in dired
> 4. Use dired-do-find-regexp on the current directory and search for "hello"
> 
> A bit of testing revealed that the issue seems to be related to the 
> ordering of
> the files. Renaming hello_bin to ahello_bin makes the problem go away.

This is due to a change in Ripgrep 13, which made it incompatible with 
GNU Grep in that respect: 
https://github.com/BurntSushi/ripgrep/releases/tag/13.0.0

I've pushed as fix to master in commit 38d5e346df. Please test it out.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#56624: 28.1.50; dired-do-find-regexp fails when using ripgrep
  2022-07-23 13:14 ` Dmitry Gutov
@ 2022-07-23 17:40   ` Michael Arndt
  2022-07-23 18:12     ` Dmitry Gutov
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Arndt @ 2022-07-23 17:40 UTC (permalink / raw)
  To: Dmitry Gutov, 56624

Thank you very much for the quick fix, it's working now.





^ permalink raw reply	[flat|nested] 5+ messages in thread

* bug#56624: 28.1.50; dired-do-find-regexp fails when using ripgrep
  2022-07-23 17:40   ` Michael Arndt
@ 2022-07-23 18:12     ` Dmitry Gutov
  0 siblings, 0 replies; 5+ messages in thread
From: Dmitry Gutov @ 2022-07-23 18:12 UTC (permalink / raw)
  To: Michael Arndt, 56624-done

On 23.07.2022 20:40, Michael Arndt wrote:
> Thank you very much for the quick fix, it's working now.

Thanks, closing.





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-07-23 18:12 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-17 19:05 bug#56624: 28.1.50; dired-do-find-regexp fails when using ripgrep Michael Arndt
2022-07-23  8:24 ` Lars Ingebrigtsen
2022-07-23 13:14 ` Dmitry Gutov
2022-07-23 17:40   ` Michael Arndt
2022-07-23 18:12     ` Dmitry Gutov

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).