dotbot icon indicating copy to clipboard operation
dotbot copied to clipboard

Hardlink support

Open musjj opened this issue 2 years ago • 4 comments

There are some oddballs out there like Windows Terminal, which refuses to detect changes in the config file if it's a symlink (https://github.com/microsoft/terminal/issues/1812#issuecomment-508280785).

Recreating the symlink doesn't seem to do it either. The only currently viable solution is to use hardlinks, so it would be nice if dotbot can support it.

musjj avatar Mar 04 '23 14:03 musjj

To confirm, you're specifically asking for Windows NTFS hardlink support?

kurtmckee avatar Jul 14 '23 04:07 kurtmckee

Yes, I wanted an NTFS hardlink (the one created with mklink /H). I no longer use Windows so I don't need this anymore, but I'll keep this issue open since there are other people who still need it judging from the thumbs ups.

musjj avatar Jul 16 '23 08:07 musjj

@anishathalye I'm assuming that this can be accomplished in the preferences, like

- link:
    ~/.config/terminator:
      path: config/terminator
      type: hardlink  # default is "symlink"

I considered but rejected designing this as a hardlink: true flag, because NTFS also supports directory junctions and it may be desirable to expand this in the future. Therefore a flag option would be less extensible.

If this looks acceptable, I'll cook up a patch to add this support and document it.

kurtmckee avatar Jul 16 '23 15:07 kurtmckee

This would be interesting when using together with Apparmor, because Apparmor checks authorizations only against the original file, skipping the soft link. So when it needs to check authorization for fstab, for example, it denies the access because the fstab file is on my dotfiles folder, and not on etc folder, where it is expected. I'm really interested in this feature!

jaysonwcs avatar Jul 29 '24 14:07 jaysonwcs