-
Notifications
You must be signed in to change notification settings - Fork 112
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
ugrep format option %p stopped working for some archives at version 3.11.2+ (commit f6311d2) #299
Comments
Of course, some of the paths that I work with are much longer than this, and so this becomes a problem when I can't tell which directory/path a search hit was found in. |
Thank you for your feedback. The change was related to another series of changes that made The change made in the past attempts to replicate |
I've updated src/output.cpp in this repo with a revision to revert part of the changes so that the old behavior is restored. The I'm working on an update of ugrep for the next release with new features. This may take a couple of days. |
Thank you very much for quick response and updates !! Fix works for me. Appreciate it. |
# By Robert van Engelen (38) and Ashish SHUKLA (1) # Via GitHub (1) and Robert van Engelen (1) * tag 'v4.3.0': released 4.3.0 release 4.3.0 released 4.3.0 released 4.3.0 revert part of output.cpp to fix Genivia#299 updated README with MacPorts installation instructions updated README updated README released 4.2 updated README updated README update README and man page update README updated README released 4.1.0 updated README updated README updated README update README Update README.md updated README released 4.0.5 released 4.0.5 updated README released 4.0.4 released 4.0.4 released 4.0.4 released 4.0.3 Delete .travis.yml updated README updated README released 4.0.2 update makemake update docs update updated README updated README updated README Fix --enable-hidden option Signed-off-by: Stavros Ntentos <3527706-stdedos@users.noreply.gitlab.com> # Conflicts: # src/ugrep.cpp
These are the options I'm using to search .tgz files with gzipped files in them.
ugrep -sIza --zmax=2 --format-open='%u%p/%a:%z%~' --format='%u%O%~'
When run like this, the header line in the output that is printed for the file path is missing the path to the archive of the '%p' option.
For that changeset, there were a small number of changes introduced for hyperlink improvements. But, the changes broke the %p --format option for me in the way used above.
To demonstrate the problem, follow these steps:
Then grep for a string in the file using the following command:
ugrep -sIza --zmax=2 --format-open='%u%p/%a:%z%~' --format='%u%O%~' 'search_string' /tmp/abc.tgz
It will find the string, but the first line, the header line, will be missing the path to the archive.
Failing example
As an example, use this /etc/hosts file with this contents.
/etc/hosts:
Then run these commands:
Working example using old release of ugrep 3.8.3
Change isolation
I ran 'git bisect' to find when the breaking change occurred working back from current release. It is the commit mentioned in the subject: f6311d2, which occurred just after 3.11.2 was released.
These are the specific changes that were made in that commit from the previous.
git diff --compact-summary 4211c2a f6311d2
I think the change that caused the issue is in output.cpp in the Output::format function, although it might be the Output::header function too.
For Output::format, we see this change:
I think heading might be false here causing it to skip the code for the option, although I'm not entirely sure. Hopefully this is clear. Let me know if you have questions.
The text was updated successfully, but these errors were encountered: