Skip to content

sort: fix GNU compatibility key handling - #745

Merged
ewhauser merged 3 commits into
mainfrom
ewhauser/sort-gnu-compat
Mar 27, 2026
Merged

ewhauser merged 3 commits into
mainfrom
ewhauser/sort-gnu-compat

Conversation

@ewhauser

Copy link
Copy Markdown
Owner

Summary

  • rework GNU sort key parsing, inheritance, and key extraction to match GNU field behavior more closely
  • preserve raw key bytes for locale-sensitive data and handle French/Japanese month abbreviations and human-number blanks correctly
  • fix targeted GNU sort compat regressions including sort.pl, sort-h-thousands-sep.sh, and sort-month.sh

Testing

  • go test ./internal/builtins -run 'TestSort|TestUniqWorksWithSort'
  • make gnu-test GNU_TESTS='tests/sort/sort.pl,tests/sort/sort-h-thousands-sep.sh,tests/sort/sort-month.sh' GNU_KEEP_WORKDIR=1
  • make lint

Follow-ups

  • Full GNU_UTILS=sort still has known failures in sort-compress.sh, sort-debug-keys.sh, sort-debug-warn.sh, and sort-merge-fdlimit.sh.

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 403c708795

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/builtins/sort.go Resolved
Comment thread internal/builtins/sort.go Resolved

@chatgpt-codex-connector chatgpt-codex-connector Bot 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 082cbed285

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/builtins/sort.go Resolved
Comment thread internal/builtins/sort.go Resolved
@ewhauser
ewhauser merged commit d602c81 into main Mar 27, 2026
15 checks passed
@ewhauser
ewhauser deleted the ewhauser/sort-gnu-compat branch March 27, 2026 02:12
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.

1 participant