Repository navigation
tar: show link targets and local times in -tv listings - #409
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #409 +/- ##
==========================================
+ Coverage 96.84% 98.09% +1.24%
==========================================
Files 11 15 +4
Lines 1492 1891 +399
Branches 29 38 +9
==========================================
+ Hits 1445 1855 +410
+ Misses 46 35 -11
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merging this PR will not alter performance
|
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
| .unwrap_or_else(Local::now); | ||
| let date_str = dt.format("%Y-%m-%d %H:%M"); | ||
|
|
||
| let link = match entry_type { |
There was a problem hiding this comment.
two matches on entry_type in a row, could be a single one, no?
There was a problem hiding this comment.
Done in c886ba4, one match on the type and the link name.
| at.write_bytes("epoch.tar", &tar_bytes); | ||
|
|
||
| new_ucmd!() | ||
| .env("TZ", "Asia/Kolkata") |
There was a problem hiding this comment.
Asia/Kolkata needs tzdata on the runner, could you please use a POSIX string like IST-5:30 instead?
There was a problem hiding this comment.
Done in c30dd70, the test uses IST-5:30 now.
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
|
Thanks for your PR |
tar -tvfprints times in UTC, lists a hard link as a regular file of size 0, and leaves out the target of symlinks and hard links. GNU tar 1.35 on the same archive (TZ=Asia/Kolkata):The time is now formatted with
chrono::Local(theclockfeature is already on), hard links geth, and symlinks get-> targetand hard linkslink to target, like GNU. Column widths are unchanged.Two new tests in
tests/by-util/test_tar.rsfail without the change: the links listing, andTZ=Asia/Kolkatawith mtime 0 giving1970-01-01 05:30.cargo test --workspacepasses,cargo fmt --checkandcargo clippy --all-targetsare clean. On a GNU-made archive with a symlink, a hard link, a long name and a non-ASCII name, the output matches GNU tar apart from column padding, in Asia/Kolkata and America/New_York.Not handled:
TZ(TZ=Foo/Bar) chrono falls back to the system's local time, GNU uses UTC#277 and #384 change the same function; I'll rebase on whichever lands first.