Fossil User Forum

Adding softlinks to repo
Login

Adding softlinks to repo

Adding softlinks to repo

(1) By Dave Polaschek (davepolaschek) on 2025-05-19 16:07:56 [link] [source]

I suppose I should just try this, but I'm being nervous this morning.

I've got a project in which I need to tweak some global configuration files. In the project working directory, I've got soft-links pointing to them, since my brain won't retain the full paths to the various files that need changing.

If I simply add the soft-links to the fossil repo, ideally I would have some indication that they are soft-links along with a way to see what those soft-links point to. That is, my project needs to modify /etc/triggerhappy/triggers.d/test.conf and I'd like to have a test.conf link in my project directory which points to that file, but have the fossil repo contain BOTH some way of describing that link, as well as keeping track of the file contents over time.

Is that possible? I feel like I'm missing some important piece of the puzzle, but that's probably mostly due to spending the past decade working on Macs and having their aliases which don't quite behave as unix soft-links do.

Thanks!

(2) By Warren Young (wyoung) on 2025-05-19 17:47:58 in reply to 1 [link] [source]

The primary problem with your plan is that Fossil defaults to “flattening” stored symlinks on checkout. While it is possible to override that behavior, it’s enough of a hassle that I’ve stopped trying; instead, I script a similar effect.

In a case like this one, I would store a copy of the configuration file in the repository, plus an installer script of some kind. My preference would be a Makefile with an install target, but that’s a reflection on my history in computing, not an objective ideal.

(3) By Dave Polaschek (davepolaschek) on 2025-05-19 18:13:57 in reply to 2 [source]

Ahh, yeah. Had I fully caffeinated myself before typing, I probably would’ve figured that out. Thanks!

I’ll just put most of the logic in the Makefile, though that will be a bit tricky, as two of the three files I’ve identified so far exist already on a default system, and I just need to make sure my changes have been made to them without clobbering important things. Nothing I can’t handle in awk, I expect. At least the one file I have to create from scratch is easy to handle!