date: fix interaction of flags, fix issues around --set#6142
date: fix interaction of flags, fix issues around --set#6142BenWiederhake wants to merge 10 commits intouutils:mainfrom
Conversation
|
GNU testsuite comparison: |
|
"CICD / Build (macos-latest, x86_64-apple-darwin, feat_os_macos)" flaked: All other failures appear to be known issues, too. |
8ee3b47 to
8439990
Compare
|
Changes since last push:
|
8439990 to
f71592a
Compare
|
Changes since last push:
|
f71592a to
7a60db5
Compare
7a60db5 to
88c69a3
Compare
|
Changes since last push:
|
|
GNU testsuite comparison: |
88c69a3 to
a3c918a
Compare
|
Changes since last push: Nothing, just a rebase to show that it's still a good idea to do this. |
|
GNU testsuite comparison: |
a3c918a to
0d0847a
Compare
|
CI failures seem to be only flakes:
Example: |
0d0847a to
48ddf40
Compare
|
Changes since last push:
|
aa5120d to
5264cb8
Compare
|
|
||
| if let Some(date) = settings.set_to { | ||
| // Iterate over all dates - whether it's a single date or a file. | ||
| let dates: Box<dyn Iterator<Item = _>> = if let Some(date_string) = &settings.set_to { |
There was a problem hiding this comment.
it is starting to be a long function.
maybe split it ?
| .replace("%f", "%N"); | ||
| println!("{formatted}"); | ||
| // Format all the dates | ||
| for date in dates { |
There was a problem hiding this comment.
like can the content of this loop be in a function ?
| vec!["-f", "foo", "-r", "foo"], | ||
| // Format with other format | ||
| vec!["-I", "-R"], | ||
| vec!["-I", "--rfc-3339=date"], |
5264cb8 to
d3be43e
Compare
|
Changes since last push:
The only CI failure is #6534, as usual. |
|
GNU testsuite comparison: |
|
@BenWiederhake sorry for the latency, it needs a small rebase |
|
@BenWiederhake ping ? :) |
53a4dcd to
2378146
Compare
|
Changes since last summary:
|
|
GNU testsuite comparison: |
tests/by-util/test_date.rs
Outdated
There was a problem hiding this comment.
Here it might make sense to test that stdout is not empty because currently there is a bug in our implementation: we don't output anything to stdout whereas GNU date outputs the specified date.
$ cargo run -q date --set "yesterday"
date: cannot set date: Permission denied
$ date --set "yesterday"
date: cannot set date: Operation not permitted
Tue Feb 18 05:06:33 PM CET 2025
| // stdout depends on the specific date; don't check it. | |
| // stdout depends on the specific date; don't check it. | |
| assert!(!result.stdout_str().is_empty()); |
2378146 to
220bb1a
Compare
|
Changes since last summary:
This reveals two bugs in the PR:
EDIT, found a third headache: There are multiple places that call |
|
GNU testsuite comparison: |
|
jobs are failing (and needs some small rebases) |
|
please reopen when ready |
This PR fixes multiple issues around multi-flags:
--referenceargument, but completely ignored it. Yikes!--setwas completely broken. This fixes it largely.-d,-f,-r), formatting options (-I,-R,--rfc-3339), and--setare often mutually-exclusive, with the exception that input options override themselves (but not each other), and also--setcan be combined with formatting options.Some things are unfixable, in particular the order-sensitive behavior; see #4254#issuecomment-2026446634 and uutils/uutils-args#113