Skip to content

date: handle parentheses as comments like GNU date#10133

Merged
cakebaker merged 2 commits intouutils:mainfrom
sylvestre:date-paren
Jan 22, 2026
Merged

date: handle parentheses as comments like GNU date#10133
cakebaker merged 2 commits intouutils:mainfrom
sylvestre:date-paren

Conversation

@sylvestre
Copy link
Contributor

No description provided.

@sylvestre
Copy link
Contributor Author

similar tests landed in GNU:
coreutils/coreutils@b7613ac

@github-actions
Copy link

github-actions bot commented Jan 8, 2026

GNU testsuite comparison:

Skipping an intermittent issue tests/tty/tty-eof (passes in this run but fails in the 'main' branch)

@github-actions
Copy link

github-actions bot commented Jan 9, 2026

GNU testsuite comparison:

Skip an intermittent issue tests/shuf/shuf-reservoir (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/sort/sort-stale-thread-mem (fails in this run but passes in the 'main' branch)

@github-actions
Copy link

github-actions bot commented Jan 9, 2026

GNU testsuite comparison:

Skipping an intermittent issue tests/tty/tty-eof (passes in this run but fails in the 'main' branch)

Copy link
Contributor

Choose a reason for hiding this comment

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

There is a minor difference in the error message if an invalid date contains a comment: GNU date shows the comment whereas we don't:

$ date -d "(foo)2026-01-05)"
date: invalid date ‘(foo)2026-01-05)’
$ cargo run -q date -d "(foo)2026-01-05)"
date: invalid date '2026-01-05)'

I'm not sure whether we want to address this issue.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, I just noticed a bug ;-)

$ cargo run -q date -d "((foo)2026-01-05)"
date: invalid date '2026-01-05)'
$ date -d "((foo)2026-01-05)"
Fri Jan  9 12:00:00 AM CET 2026

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added upstream:
coreutils/coreutils@210c000

@sylvestre sylvestre force-pushed the date-paren branch 3 times, most recently from fc2268c to 92ba14f Compare January 14, 2026 08:53
@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/tty/tty-eof (fails in this run but passes in the 'main' branch)

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/shuf/shuf-reservoir (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/sort/sort-stale-thread-mem (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/tail/follow-name (fails in this run but passes in the 'main' branch)

@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/tail/follow-name (fails in this run but passes in the 'main' branch)

@codspeed-hq
Copy link

codspeed-hq bot commented Jan 18, 2026

Merging this PR will not alter performance

✅ 142 untouched benchmarks
⏩ 180 skipped benchmarks1


Comparing sylvestre:date-paren (234e31f) with main (aa218a3)

Open in CodSpeed

Footnotes

  1. 180 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
@github-actions
Copy link

GNU testsuite comparison:

Skip an intermittent issue tests/shuf/shuf-reservoir (fails in this run but passes in the 'main' branch)
Skip an intermittent issue tests/sort/sort-stale-thread-mem (fails in this run but passes in the 'main' branch)

@cakebaker cakebaker merged commit 75b9ad4 into uutils:main Jan 22, 2026
131 checks passed
@sylvestre sylvestre deleted the date-paren branch January 22, 2026 14:36
mattsu2020 pushed a commit to mattsu2020/coreutils that referenced this pull request Jan 23, 2026
* date: handle parentheses as comments like GNU date

* simplify the code

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>

---------

Co-authored-by: Daniel Hofstetter <daniel.hofstetter@42dh.com>
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