Skip to content

pgrep: optimize length detection#636

Open
Franklin-Qi wants to merge 1 commit intouutils:mainfrom
Franklin-Qi:fix-bug#635-optimize-length-detection
Open

pgrep: optimize length detection#636
Franklin-Qi wants to merge 1 commit intouutils:mainfrom
Franklin-Qi:fix-bug#635-optimize-length-detection

Conversation

@Franklin-Qi
Copy link
Contributor

@Franklin-Qi Franklin-Qi commented Feb 16, 2026

When calculating the length, the ^$ character needs to be removed if the -x parameter is present.

Closes: #635

@codecov
Copy link

codecov bot commented Feb 16, 2026

Codecov Report

❌ Patch coverage is 66.66667% with 10 lines in your changes missing coverage. Please review.
✅ Project coverage is 18.93%. Comparing base (6ac0e01) to head (fb69db0).
⚠️ Report is 22 commits behind head on main.

Files with missing lines Patch % Lines
src/uu/pgrep/src/process_matcher.rs 0.00% 10 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #636      +/-   ##
==========================================
+ Coverage   18.77%   18.93%   +0.16%     
==========================================
  Files          66       66              
  Lines        9752     9773      +21     
  Branches      516      518       +2     
==========================================
+ Hits         1831     1851      +20     
- Misses       7921     7922       +1     
Flag Coverage Δ
macos_latest 7.00% <41.17%> (+0.08%) ⬆️
ubuntu_latest 19.30% <66.66%> (+0.16%) ⬆️
windows_latest 0.02% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Franklin-Qi Franklin-Qi force-pushed the fix-bug#635-optimize-length-detection branch 3 times, most recently from 2f41da0 to 961f167 Compare February 16, 2026 03:49
@Krysztal112233
Copy link
Collaborator

Krysztal112233 commented Feb 16, 2026

could you please add some unittest to test your modification and make sure no regression if possible?

@Franklin-Qi Franklin-Qi force-pushed the fix-bug#635-optimize-length-detection branch 2 times, most recently from 0d7b008 to f0c7301 Compare March 14, 2026 12:42
When calculating the length, the ^$ character needs to be removed if the -x parameter is present.

Closes: uutils#635
@Franklin-Qi Franklin-Qi force-pushed the fix-bug#635-optimize-length-detection branch from f0c7301 to fb69db0 Compare March 14, 2026 13:52
@Franklin-Qi
Copy link
Contributor Author

could you please add some unittest to test your modification and make sure no regression if possible?

@Krysztal112233 Thank you for your review; I have added test cases in this area.


// spawn a flock process that locks the file
let mut flock_process = Command::new("flock")
.arg("--fcntl")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this change ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The pgrep -x command will report an error message when performing a length check.

3 participants