Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug in passthru option #2438

Closed
elkarouh opened this issue Mar 1, 2023 · 4 comments
Closed

bug in passthru option #2438

elkarouh opened this issue Mar 1, 2023 · 4 comments
Labels
duplicate An issue that is duplicative of another.

Comments

@elkarouh
Copy link

elkarouh commented Mar 1, 2023

What version of ripgrep are you using?

ripgrep 13.0.0 (rev af6b6c5)
-SIMD -AVX (compiled)
+SIMD +AVX (runtime)

How did you install ripgrep?

manually

What operating system are you using ripgrep on?

3.10.0-1160.31.1.el7.x86_64 #1 SMP Wed May 26 20:18:08 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Describe your bug.

Non-matching lines duplicated in the output, when using multiline options

What are the steps to reproduce the behavior?

I am trying to solve the problem of moving a line as described in the following url
https://stackoverflow.com/questions/10499960/how-to-move-specified-line-in-file-to-other-place-with-regexp-match-bash-script
I then run the following command:
The EXAMPLE file contains :
asdasd0
asdasd1
asdasd2
asdasd3
asdasd4
asdasd5
asdasd6

rg --debug --multiline --multiline-dotall  '^(asdasd1.*)(asdasd5(?:\n|$))'  --passthru -r '$2$1'  EXAMPLE
Output is:
<multiline-dotall  '^(asdasd1.*)(asdasd5(?:\n|$))' inepassthru -r '$2$1'  EXAMPLE
DEBUG|rg::config|crates/core/config.rs:40: /auto/home/elkarouh/.config/ripgrep/rc: arguments loaded from config file: [ "--type-add", "templ:*.templ"]
DEBUG|rg::args|crates/core/args.rs:543: final argv: ["rg", "--type-add", "templ:*.templ", "--debug", "--multiline"
, "--multiline-dotall", "^(asdasd1.*)(asdasd5(?:\\n|$))", "--passthru", "-r", "$2$1", "EXAMPLE"]
DEBUG|globset|crates/globset/src/lib.rs:421: built glob set; 0 literals, 0 basenames, 12 extensions, 0 prefixes, 0 suffixes, 0 required extensions,
 0 regexes
asdasd0
asdasd5
asdasd1
asdasd2
asdasd3
asdasd4
asdasd6

asdasd6

What is the expected behavior?

Expected output is:
asdasd0
asdasd5
asdasd1
asdasd2
asdasd3
asdasd4
asdasd6
What do you think ripgrep should have done?
Not duplicate the non-matching lines

@BurntSushi BurntSushi added the duplicate An issue that is duplicative of another. label Mar 2, 2023
@BurntSushi
Copy link
Owner

Duplicate of #2095 and #2208. Was fixed in 91afd42, which is on current master but has not yet been released.

@elkarouh
Copy link
Author

elkarouh commented Mar 2, 2023

Hi BurntSushi,

When is a new release expected?

@BurntSushi
Copy link
Owner

I don't schedule my free time. See: https://github.com/BurntSushi/ripgrep/blob/master/FAQ.md#release

@elkarouh
Copy link
Author

elkarouh commented Mar 2, 2023

No problem.
Your software is having massive impact on my productivity and i am just pushing the limits.
Many thanks for this wonderful tool !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate An issue that is duplicative of another.
Projects
None yet
Development

No branches or pull requests

2 participants