Skip to content

Conversation

@Charlie-Zheng
Copy link
Contributor

@Charlie-Zheng Charlie-Zheng commented May 27, 2025

  • f-extra-arg
  • missing
  • minus-in-stdin
  • empty
  • empty-nonreg
  • nul-1
  • nul-2
  • zero-len

I noticed some discrepancy in how files with ' or " are displayed. Is there a function that will automatically adjust the display of file names?

This is the output from GNU sort

$ sort --files0-from=- "ab"
sort: extra operand 'ab'
file operands cannot be combined with --files0-from
Try 'sort --help' for more information.
$ sort --files0-from=- "a'b"
sort: extra operand "a'b"
file operands cannot be combined with --files0-from
Try 'sort --help' for more information.
$ sort --files0-from=- "a'\"b"
sort: extra operand 'a'\''"b'
file operands cannot be combined with --files0-from
Try 'sort --help' for more information.

@github-actions
Copy link

GNU testsuite comparison:

GNU test failed: tests/sort/sort-exit-early. tests/sort/sort-exit-early is passing on 'main'. Maybe you have to rebase?
GNU test failed: tests/sort/sort-version. tests/sort/sort-version is passing on 'main'. Maybe you have to rebase?
Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/timeout/timeout (fails in this run but passes in the 'main' branch)
Congrats! The gnu test tests/sort/sort-files0-from is no longer failing!

@sylvestre
Copy link
Contributor

when opening a new PR, please do it with a clean list of commits "fix nul" or "fix empty" aren't great commit messages ;)

i guess you saw that some jobs failed

@Charlie-Zheng Charlie-Zheng force-pushed the sort_fix_files0-from branch 2 times, most recently from e064e87 to 8b58e1e Compare May 27, 2025 15:33
@Charlie-Zheng Charlie-Zheng marked this pull request as ready for review May 27, 2025 15:35
@Charlie-Zheng
Copy link
Contributor Author

Charlie-Zheng commented May 27, 2025

OsString.display() is too new (Rust 1.87), should I use OsString.debug() instead?
I ended up using PathBuf instead. As OsString.debug() adds extra "" around the string

@Charlie-Zheng Charlie-Zheng force-pushed the sort_fix_files0-from branch from 8b58e1e to 0afe737 Compare May 27, 2025 15:47
@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/inotify-dir-recreate (fails in this run but passes in the 'main' branch)
Congrats! The gnu test tests/sort/sort-files0-from is no longer failing!

@Charlie-Zheng Charlie-Zheng force-pushed the sort_fix_files0-from branch from 0afe737 to 6124816 Compare May 27, 2025 17:35
@Charlie-Zheng Charlie-Zheng force-pushed the sort_fix_files0-from branch 2 times, most recently from 956878b to 6104cbc Compare May 27, 2025 20:25
@github-actions
Copy link

GNU testsuite comparison:

Skipping an intermittent issue tests/timeout/timeout (passes in this run but fails in the 'main' branch)
Congrats! The gnu test tests/sort/sort-files0-from is no longer failing!

@Charlie-Zheng Charlie-Zheng force-pushed the sort_fix_files0-from branch from 6104cbc to 932b6b0 Compare May 27, 2025 21:57
@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/misc/tee (fails in this run but passes in the 'main' branch)
Congrats! The gnu test tests/sort/sort-files0-from is no longer failing!

@jtracey
Copy link
Contributor

jtracey commented May 27, 2025

OsString.display() is too new (Rust 1.87), should I use OsString.debug() instead?

Since the difference between an OsString and a regular String is only relevant with unprintable characters, we've just used to_string_lossy() for error cases (as well as non-error cases as a workaround hack when needed, but that's almost always a bug that will need to be fixed at some point). Might be a good idea to rely on display once MSRV is at least 1.87.

@sylvestre sylvestre merged commit b2893db into uutils:main Jun 2, 2025
74 checks passed
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.

3 participants