cp: when copying hardlink over itself, the backup should also be a hardlink
Open
Nobody has claimed this yet.
U - cp
- Dominant language
- Rust
- Stars
- 24.1k
- Forks
- 2k
- Avg merge
- 1d 5h
- Merged PRs (30d)
- 365
Description
When copying hardlink over itself, the backup should also be a hardlink, and its creation announced if -v was given.
$ rm -f README.md~ && cp -vlbf README.md README.md && ls -1i README.md*
'README.md' -> 'README.md~'
20092600 README.md
20092600 README.md~
$ rm -f README.md~ && cargo run -q cp -vlbf README.md README.md && ls -1i README.md*
20092600 README.md
20074037 README.md~
Found while reading https://github.com/uutils/coreutils/pull/6496, but only remotely related.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the two cp -vlbf README.md README.md commands and compare the inode numbers and verbose output. Start at the cp command entry point, then trace self-copy backup handling; done means the backup shares the source inode and its creation is announced with -v.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100