Skip to content

Conversation

@alch-emi
Copy link
Contributor

@alch-emi alch-emi commented Mar 23, 2025

When creating a hardlink, either during import or beet convert, if the origin of the hardlink was a symlink, that symlink used to be directly copied. This could create broken symlinks if the origin symlink was relative, and in either case, probably wasn't the user's desired behavior.

This change de-references all symlinks before creating a hardlink, such that the end result is a normal file with the same inode as the original file. See #5676 for more discussion about the original issue.

Fixes #5676

  • Documentation (N/A)
  • Changelog
  • Tests

@semohr semohr requested a review from a team May 22, 2025 10:14
@snejus
Copy link
Member

snejus commented Jul 12, 2025

@alch-emi conflicts need to be resolved here, I think

@alch-emi
Copy link
Contributor Author

Done!

@alch-emi
Copy link
Contributor Author

alch-emi commented Nov 7, 2025

Merge conflicts re-resolved! Please let me know if there are other changes or considerations that you believe should be addressed before this can be merged.

@codecov
Copy link

codecov bot commented Nov 7, 2025

Codecov Report

❌ Patch coverage is 75.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 67.34%. Comparing base (61a4c73) to head (b71e718).
⚠️ Report is 12 commits behind head on master.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
beets/util/__init__.py 75.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##           master    #5684   +/-   ##
=======================================
  Coverage   67.34%   67.34%           
=======================================
  Files         136      136           
  Lines       18492    18494    +2     
  Branches     3134     3134           
=======================================
+ Hits        12453    12455    +2     
  Misses       5370     5370           
  Partials      669      669           
Files with missing lines Coverage Δ
beets/util/__init__.py 79.02% <75.00%> (+0.08%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Contributor

@semohr semohr left a comment

Choose a reason for hiding this comment

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

Thanks for resolving the conflict and leaving a comment! If a PR ever sits for too long, please don’t hesitate to ping us, sometimes things slip through or no one feels directly responsible.


The fix looks good to me. That said, we’re trying to move everything over to Pathlib and phase out syspath in the long run. Would you be up for a quick refactor in that direction?

@semohr semohr self-assigned this Nov 7, 2025
alch-emi added a commit to alch-emi/beets that referenced this pull request Nov 7, 2025
@alch-emi alch-emi force-pushed the dereference-symlinks-while-hardlinking branch 2 times, most recently from b71e718 to b405d2f Compare November 7, 2025 20:31
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.

convert: Relative symlinks broken upon convert with -H

3 participants