Fossil Forum

droleary 2 weeks, 1 day ago

Post: Fossil vs. Git? What about Fossil *and* Git?

Personally, I don't like any VCS I've ever used, because none of them really support my mental model of development. For me, coding something often starts as a one-liner that turns into a cheat sheet that turns into some kind of script(s), maybe then growing and refactoring into a well-structured app, and even later on segmented into libraries, etc. That usually means things initially go into my Monorepo, but then it becomes a mess to disentangle the code if/when a project grows enough to earn a dedicated repo. I'm apparently a uniquely bad developer in the eyes of every VCS since all my projects are not birthed in their final form!

The related problem that this post is mainly about is that I don't consider projects/repos as having a universal, absolute structure. Many developers, for instance, have been bitten over the years by committing things like API keys and other "private" info that still needs to exist alongside the code they're writing; sometimes different aspects of a code base need to be exposed to different people. The related use case that has me writing today is, for a long time, I've had firewall management tools and info in a repo that I've been wanting to make public in some form, but not all of it (e.g., I want to be able to publish who has been blacklisted, but not who get's internally whitelisted). Git (which this repo remains because all my tooling supports it) doesn't like that idea at all; I think the best you can do is a submodule, which only allows you to map another project to a project sub-directory in the filesystem, and not everything I want to share is organized like that. Fossil is quite a bit better in its support for nested repos, which seems to allow you to mix and match the same file(s) between multiple repos, so long as you can put each under their own root subdirectory.

The "Eureka!" moment I had recently was that I could actually overlay Fossil repos on the directories of my Git repo. This allows me to keep using Git-aware tools, but to also pick and choose whatever files in whatever subdirectories I want to go into the public Fossil repo. I then mirror it to any Git users who would like to access it (because, you know, the firewall might now let them get it from me :-). I could also more directly put it up at Chisel, of course.

Hopefully a use case like this is non-obvious and worth the read! I certainly didn't see anything in the various who-is-better-than-who pages that pointed out that regular Git users would also benefit by having Fossil as a tool in their toolbox. Any similar techniques out there that Fossil can be used to flex with?

droleary 2 weeks, 1 day ago

Edit: Fossil vs. Git? What about Fossil *and* Git?

chungy 2 weeks, 1 day ago

For me, coding something often starts as a one-liner that turns into a cheat sheet that turns into some kind of script(s), maybe then growing […] I'm apparently a uniquely bad developer in the eyes of every VCS since all my projects are not birthed in their final form!

This is a fairly common and natural way for projects to evolve in their VCSes. Simply start them with your "one-liners" and let it grow from there, use the VCS the entire way.

The related problem that this post is mainly about is that I don't consider projects/repos as having a universal, absolute structure.

That's fine, pick the structure appropriate for each project. Fossil even gives you the freedom to change your mind about it, see especially the fossil mv for renaming files.

Many developers, for instance, have been bitten over the years by committing things like API keys and other "private" info that still needs to exist alongside the code they're writing

They have, and there's two features that are intended to mitigate this. ignore-glob for specifying files that should not be part of check-ins, and shunning if you really must rescind content already checked into a repository. Try to exercise best practice to avoid the latter from being necessary, but remember Fossil still has a tool even if you slip up. It happens to the best of us.

Git doesn't like that idea at all; I think the best you can do is a submodule[…]. Fossil is quite a bit better in its support for nested repos, which seems to allow you to mix and match the same file(s) between multiple repos, so long as you can put each under their own root subdirectory.

In truth, until now I didn't even realize fossil open has a --nested option, but they certainly don't act like submodules. Fossil has no equivalent feature. I'm not sure why the nested option exists except for overriding a safety check. My gut is to say to avoid depending on it entirely and keep your checkouts separated as they're meant to be.

The "Eureka!" moment I had recently was that I could actually overlay Fossil repos on the directories of my Git repo.

Are you talking about storing Fossil repositories in Git? Certainly the software would allow you to do that, but that sounds incredibly bizarre and inconvenient(^ Git (and Fossil) is really designed around doing diffs around textual data and operate badly on binary data, which a Fossil repository itself would be.), and if you're not careful about scrubbing you might inadvertently be sharing secrets that you didn't want to share.

I think it will benefit you greatly to read How to Configure a Fossil Server and have some real access control for your repositories, as well as significantly reducing friction for interacting and syncing with your canonical versions of the repositories. The bare minimum only really requires exposing HTTP (port 80) from your network, and it's not terribly difficult to manage HTTPS or reverse proxies if required. Z e

wyoung 2 weeks, 1 day ago

Mike addressed the main points, so I will merely add…

I want to be able to publish who has been blacklisted, but not who get's internally whitelisted)

My biggest problem with the term DevOps is that it mashes the two jobs together as if they're a single thing. I like to spell it Dev/Ops to signal the split: development is development, operations is operations.

This is a fine case in point: the software that manages the firewall is done with your development hat on, and deploying it to a specific environment with a given configuration is operations. The only configuration data that should be in the dev repo are harmless tests, canned configurations, etc. Nothing "real".

With that in mind, DevOps then becomes a useful guiding philosophy. It recognizes that there's an interplay between the jobs, and that ops often needs to do their own dev, and dev needs to do their own ops. When you're a one-man band, you have no choice.

The trick is to switch hats facilely. Always keep in mind which side of the line you're on, and keep separate repos.

This then brings us to containerization and IaC. A common pattern is that the code lives in the repo, then is built into a container, deployed to prod with a specific configuration external to the container proper. Then we start talking about bind mounts, environment files, etc. to communicate that external configuration to the inner parts, safely.

Git-aware tools

All decent coding LLMs are Fossil-aware now, even if they haven't been specifically trained on it. The only arm-twisting I've needed to do in the last year or so is add a directive to AGENTS.md or whatever:

This is a [repository](/wiki/standalone Fossil)(https://example.com/repo). Use `fossil` for status, diffs, tags, and commits — not `git`.

That's enough to clue the clanker into doing the right thing from go, rather than bang around futilely with Git until it starts making guesses and lands on the truth, having spent too much dev time and tokens to get there.

Z 1

wyoung 2 weeks, 1 day ago

I didn't even realize fossil open has a --nested option…

I have exactly one use case for it, and it does play into the OP's topic. I have a software system that's node-locked to a MAC address with an encrypted key. This key includes per-site configuration information based on how each license was negotiated. We don't want sites re-minting their key to turn on features they didn't pay for.

These keys are kept in a Fossil repo since they're durable assets, and we need to keep things like serial numbers consistent among all sites.

The source must live in another repo, but since this is also where the key-minting tools live, it is convenient to check the keys repo out underneath the source repo.

Each repo is separate not only for security reasons but because they have independent lifetimes. They only rarely sync up, as when a new major software version invalidates the key scheme used in the prior one. Keeping them in the same repo would simply be wrong on this basis. The right path is to bake a version number into each key, to indicate which software versions can read each one. Z

wyoung 2 weeks, 1 day ago

Mike addressed the main points, so I will merely add…

I want to be able to publish who has been blacklisted, but not who get's internally whitelisted)

My biggest problem with the term DevOps is that it mashes the two jobs together as if they're a single thing. I like to spell it Dev/Ops to signal the split: development is development, operations is operations.

This is a fine case in point: the software that manages the firewall is done with your development hat on, and deploying it to a specific environment with a given configuration is operations. The only configuration data that should be in the dev repo are harmless tests, canned configurations, etc. Nothing "real".

With that in mind, DevOps then becomes a useful guiding philosophy. It recognizes that there's an interplay between the jobs, and that ops often needs to do their own dev, and dev needs to do their own ops. When you're a one-man band, you have no choice.

The trick is to switch hats facilely. Always keep in mind which side of the line you're on, and keep separate repos.

This then brings us to containerization and IaC. A common pattern is that the code lives in the repo, then is built into a container, deployed to prod with a specific configuration external to the container proper. Then we start talking about bind mounts, environment files, etc. to communicate that external configuration to the inner parts, safely.

Git-aware tools

All decent coding LLMs are Fossil-aware now, even if they haven't been specifically trained on it. The only arm-twisting I've needed to do in the last year or so is add a directive to AGENTS.md or whatever:

This is a [repository](/wiki/standalone Fossil)(https://example.com/repo). Use `fossil` for status, diffs, tags, and commits — not `git`.

That's enough to clue the clanker into doing the right thing from go, rather than bang around futilely with Git until it starts making guesses and lands on the truth, having spent too much dev time and tokens to get there.

Z 0

droleary 2 weeks ago

Simply start them with your "one-liners" and let it grow from there, use the VCS the entire way.

I'm not sure how that solves anything. A ton of repos for single lines of code sounds like a nightmare to deal with. You'd then have to manage merging them if you build a process cheat sheet (or script) from a bunch of them. To say nothing of the cases where you end up wanting to split an app repo into some reusable libs. Monorepos, for better or worse, exist because VCS don't allow projects to easily grow in those ways.

That's fine, pick the structure appropriate for each project.

Again, I have no way to know how a project will best be structured at the start (or even if it will ever become something large enough to be considered a standalone project). Similarly, different people may benefit from seeing different, limited aspects of the larger project. As a developer, I really don't need the clutter of every version of every localized asset that an app ever supported!

Fossil even gives you the freedom to change your mind about it, see especially the fossil mv for renaming files.

This is why I don't like any VCS I use; you can only mv within a single repo. My projects are not the filesystem! And there are severe limitations, even for Fossil, when a repo is forced to have a root directory.

They have, and there's two features that are intended to mitigate this.

My point is that, to keep it out of one repo doesn't necessarily mean it shouldn't be in any repo. If you have a project where the versioned secrets can all live in one subdirectory, both Fossil or Git give you fair ways to manage that. What I tried to highlight was when files like that are mixed in with everything else. In that case, layering two (or more!) VCS's that operated differently turned out to be really handy. Facing those kinds of issues can turn "Git-only" users into Fossil users.

My gut is to say to avoid depending on it entirely and keep your checkouts separated as they're meant to be.

Well, if it doesn't work out in the long run, I'll just stop using Fossil that way. My gut still says it's all the VCS's that are doing things wrong. A repo may represent some filesystem objects, but my projects are more than that. I find refactoring code is particularly poorly handled when dealt with as just some file diffs.

Are you talking about storing Fossil repositories in Git?

No, no; I mean having the a subset files in both repos. I essentially have this:

monorepo/project
monorepo/project/various.sh
monorepo/project/code.c
monorepo/project/and.json
monorepo/project/data.db
monorepo/project/ipset
monorepo/project/ipset/orgs.md
monorepo/project/ipset/geofeeds
monorepo/project/ipset/geofeeds/many_files
monorepo/project/ipset/firewall6
monorepo/project/ipset/firewall6/persistent_threats.txt
monorepo/project/ipset/firewall6/CIDR_whitelist.tsv
monorepo/project/ipset/firewall6/CIDR_blacklist.txt
monorepo/project/ipset/.fslckout
monorepo/project/ipset/firewall
monorepo/project/ipset/firewall/persistent_threats.txt
monorepo/project/ipset/firewall/CIDR_whitelist.tsv
monorepo/project/ipset/firewall/CIDR_blacklist.txt
monorepo/project/ipset/countries.md

As the .fslckout indicates, what I am sharing via the Fossil repo is only under the ipset directory, and even then only a subset of those files. The Git repo is the whole project (and much more), and thus has many "secret" files that are kept out of the Fossil repo.

droleary 2 weeks ago

My biggest problem with the term DevOps is that it mashes the two jobs together as if they're a single thing.

To the extent they overlap, I would've actually went with OpsDev, but clearly nobody listens to me. ;-)

This is a fine case in point: the software that manages the firewall is done with your development hat on, and deploying it to a specific environment with a given configuration is operations. The only configuration data that should be in the dev repo are harmless tests, canned configurations, etc. Nothing "real".

That's an idealized scenario that I seldom see match the real world. The reality often seem to be that when things needs to be distributed and versioned in any way, a DVCS gets involved. I would absolutely agree when that work is operations-driven (which is why I'd have gone with OpsDev), how it differs from aspects of the project that are driven by other factors is important. For example, I've worked in Git-only places where the configurations of dev/test/prod environments come from Ops, but it still falls on the Dev side to not make any mistakes when trying to shift credential from config repos to where a code repo can use it. Maybe it'd make more sense if Ops used Fossil instead of Git or, barring that, if I as a developer might not alter my process to import their config repo into a Fossil repo that had been layered on top of my own Git repo.

All decent coding LLMs are Fossil-aware now, even if they haven't been specifically trained on it.

They'd have to be magic to be aware of things they hadn't been trained on. No, I'm talking about human tools for human developers doing new things, not just dumb-mapping s/git/fossil. No cognitive surrender from me just yet.

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button