Repository navigation
mv: preserve hard links when renaming a directory across filesystems - #16125
gonzalemario wants to merge 2 commits into
Conversation
Merging this PR will not alter performance1 warning
Comparing Footnotes
|
|
thanks for the PR! |
05a723b to
2810f81
Compare
I'm comparing locally with |
|
rustfmt is sad :) |
|
Sure mate. I didn't want to run it because I saw that there were other
changes that are not related to mine, so I thought maybe I should raise a
new pr afterwards?
I'll push a new commit soon but in the meantime, did you see anything else
I should change?
Thanks!
Mario Gonzalez
…On Sat, 7 Nov 2026, 11:31 Sylvestre Ledru, ***@***.***> wrote:
*sylvestre* left a comment (uutils/coreutils#16125)
<#16125 (comment)>
rustfmt is sad :)
could you please run cargo fmt?
Diff in /home/runner/work/coreutils/coreutils/src/uu/mv/src/mv.rs:376:
}
|
2810f81 to
25a962f
Compare
Done it in 84d35e5 I pushed it as a WIP commit, we should squash before merging. I'll do it and rebase from main once you give me the ok. |
| // Use hardlink options | ||
| let hardlink_options = HardlinkOptions { | ||
| verbose: options.verbose || options.debug, | ||
| }; |
There was a problem hiding this comment.
it's only used once now, do we still need this function?
if we keep it, these two comments don't add much
There was a problem hiding this comment.
In my mind, the fn looks good. It does little but specifics and it helps to "document" the code without writing extra document IMO. I'll remove the comments though
84d35e5 to
1d20e0d
Compare
1d20e0d to
5c57e94
Compare
5c57e94 to
b5b4bea
Compare
|
GNU testsuite comparison: |
|
/rerun |
ce15bf0 to
cfc1553
Compare
|
Binary size comparison: |
cfc1553 to
d805dd6
Compare
5d78092 to
c773308
Compare
Hard-linked files inside a directory were copied as separate files when the directory was moved to another filesystem under a new name, or with -T onto an existing empty directory, because no hard-link scan was done on that path. When the copy fallback gets no pre-scanned context, scan the source there, so the scan only runs once a cross-filesystem copy is needed. Closes uutils#4833
There is no need to use `pub(crate)` in this module, also, this follows convention found in other sources like test_cp.rs or test_ls.rs. The change about removing `cfg(unix)`, it's redundant because the parent inter_partition_copying already defines its targes as "linux", and we need to run those test_* functions when /dev/shm is available only.
c773308 to
bc5d994
Compare
Hard-linked files inside a directory were copied as separate files when the directory was moved to another filesystem under a new name (or with -T). Scan the source for hard links in these cases too, as is already done when moving into an existing directory.
Closes #4833