Skip to content

Make Unicode listing GNU-sed compatible - #537

Open
dspinellis wants to merge 1 commit into
uutils:mainfrom
dspinellis:octal-list
Open

Make Unicode listing GNU-sed compatible#537
dspinellis wants to merge 1 commit into
uutils:mainfrom
dspinellis:octal-list

Conversation

@dspinellis

Copy link
Copy Markdown
Collaborator

Adjust l command to list Unicode characters by default as octal byte sequences of the corresponding UTF-8 bytes. A new -U --uutil-extensions option allows listing them with the common Unicode \u and \U hex escapes.

This implementation is compatible with the byte-handling changes and also retains the useful \u behavior, which #436 would loose.

Copilot AI lite review requested due to automatic review settings August 22, 2026 10:15
@codecov

codecov Bot commented Aug 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 83.20%. Comparing base (79e5df0) to head (1688d27).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
src/sed/processor.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #537      +/-   ##
==========================================
+ Coverage   83.18%   83.20%   +0.02%     
==========================================
  Files          13       13              
  Lines        7001     7010       +9     
  Branches      398      398              
==========================================
+ Hits         5824     5833       +9     
  Misses       1174     1174              
  Partials        3        3              
Flag Coverage Δ
macos_latest 83.85% <90.00%> (+0.02%) ⬆️
ubuntu_latest 84.05% <90.00%> (+0.02%) ⬆️
windows_latest 0.00% <0.00%> (ø)

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

☔ View full report in Codecov by Harness.
📢 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.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates the l (list) command output to be GNU-sed compatible by defaulting to octal-escaped UTF-8 bytes for non-ASCII, while introducing a -U/--uutil-extensions flag to preserve uutils-specific \uXXXX / \UXXXXXXXX Unicode escape listing.

Changes:

  • Change l command listing behavior to emit octal byte escapes by default (even under UTF-8 locales), reserving \u/\U Unicode escapes for --uutil-extensions.
  • Add -U/--uutil-extensions CLI flag and plumb it through ProcessingContext.
  • Add/adjust fixtures and tests to cover both default octal behavior and extension-enabled Unicode-escape behavior.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/fixtures/sed/output/list_unicode_octal Adds expected output fixture for default octal UTF-8 byte escaping in l output.
tests/by-util/test_sed.rs Updates Unicode listing tests to cover both extension-enabled and default behaviors.
src/sed/processor.rs Switches l behavior based on uutil_extensions and character mode.
src/sed/mod.rs Adds -U/--uutil-extensions flag and wires it into context construction and tests.
src/sed/command.rs Extends ProcessingContext with uutil_extensions.
README.md Documents the new incompatible-extensions toggle and its effect on l output.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread README.md Outdated
Comment thread tests/by-util/test_sed.rs Outdated
@codspeed-hq

codspeed-hq Bot commented Aug 22, 2026

Copy link
Copy Markdown

Merging this PR will regress 1 benchmark

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
❌ 1 regressed benchmark
✅ 9 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Benchmark BASE HEAD Efficiency
access_log_subst 2.4 s 2.5 s -6.33%
number_fix 1.4 s 1.3 s +9.78%

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing dspinellis:octal-list (1688d27) with main (7be1f77)

Open in CodSpeed

Adjust `l` command to list Unicode characters by default as
octal byte sequences of the corresponding UTF-8 bytes.
A new -U --uutil-extensions option allows listing them
with the common Unicode \u and \U hex escapes.
Copilot AI review requested due to automatic review settings August 22, 2026 10:35

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Comment thread src/sed/processor.rs
Comment thread src/sed/mod.rs
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.

2 participants