181 points · by bkq · 4y ago · 171 comments
Keep in mind that Fossil was written specifically to support the SQLite team's workflow. It was never designed for _anyone_ else's needs. They don't care if it doesn't work for other people's work styles because they didn't write it for other people.
Yep. One thing I like to ask is, does your project have millions of lines of code, being worked on by thousands of developers scattered around the globe? If not, you might want to think about whether Git is really the best fit for your needs.
IMHO, this solves all issues in a very elegant way - my local repository shows all the commits (both private and public) but everyone else's shows all the commits as intended by the developers. Additionally, the public history is maintained consistently without wondering if someone messed it up.
https://www.fossil-scm.org/home/doc/4d8aecdf/www/private.wik...
Also, do I understand it correctly that it's a single branch named "private" per repo?
Git style mailing of patches?
"Who decides where one level of granularity stops and the next begins? I think it’s the author of the commits. My workflow over the last ten years is based heavily on being able to massage commits so that I can prepare what I share to the server repository, where it can no longer be changed. I agree that there should be an unalterable history, but disagree with the author on where that history begins."
"My workflow is considerably different than it was before I used Git or had access to rebase. I would now be much less efficient if I didn’t have rebase. It would make me constantly focus on cleaning up commits before I really care to. You could make the argument that cleaning up afterward takes more time, but I haven’t experienced that to be the case. Instead, I want to be able to set the priorities rather than worry about committing something that I cannot undo."
You don't need complicated branch refactoring tools when you're only sharing with a handful of people. It's like working with RCS back in the day: history is still linear and no one needs to worry about cross-ports between feature branches.
[1] Ironically done using a github mirror, because those are the tools I know and they're fast.
5 contributors, with over 70% from a single person is indeed small.
It so happen that I usually do commit squashed changes to many files over code base with long and heavy legacy. I am afraid that squashed changes lose their utility for bisection search for a bug.
Yet, I required to do so. Mainly, because I can.
I don't have a problem with squashing per se, especially when it's a private branch for a single developer. The problem is when you have multiple developers working on a feature branch together, or when you have to merge in a branch with a fix or feature that has not yet been merged up higher.
My bottom line is I want as few merge conflicts as possible, and I want to see the real author and a relevant commit message if I'm digging into changes to figure out what went wrong with something.
Usually, private branches are get deleted after merge happen.
In the end, I will have a situation where there is a defect in the main branch and there is no way to bisect it narrower than to squashed commit.
What should I do with 3200 changed lines in 320 files when there is a defect?
[1] https://stackoverflow.com/questions/4049958/embedded-softwar...
The page above hints that pre-review defect density for C/C++ code is 4.5 defects per 100 lines of code. After review it is 0.82 defects per 100 LOC, or 8.2 defects per 1000 lines of code. My big patch will introduce 25 defects that'll pass review. Even 10 fold decrease in defect density after testing (haha) will not significantly reduce probability of the introduction of a single defect.
Fossil DOES allow you to modify history, by adding new artifacts which retroactively change how previous artifacts are interpreted. They are called Control Artifacts and the set of things they can change are limited, but there's no reason additional ones cannot be added.
> Fossil does not support rebase. Here's an article from the author titled, Rebase Considered Harmful. While Fossil has the ability to squash merges, the primary workflow supported is merging.
In particular, they show the following comparison:
Merge:
-> C3 -> C5 -> C7
/ /
C1 -> C2 -> C4 -> C6
Rebase: -> C3 -> C5] -> C3' -> C5'
/ /
C1 -> C2 -> C4 -> C6
However, a more realistic example of a feature branch that lives for even a few days looks like this:Merge:
-> C3 -> C5 -> C7 -> C9 -> C11 -> C13 --------> C15
/ / / / \
C1 -> C2 -> C4 -> C6 -> C8 -> C10 -> C12 -> C14 -> C16 -> C17 -> C18
The final history after rebase being: -> C3' -> C5' -> C9' -> C13'
/ \
C1 -> C2 -> C4 -> C6 -> C8 -> C10 -> C12 -> C14 -> C16 -> C17 --------------------------> C18
A much much simpler history to follow, and obviously shorter.And the complexity without rebase grows even more if more people are doing local merges and pushing to the same remote branch.
Fossil requires users to either commit stuff they don't want to see later, or hack away until finished, cherry-picking changes as necessary. This isn't a good workflow for everybody.
Git allows users to do anything they want, but your Linux master branch may not be the same as Linux Torvalds' master branch, and history can be changed at anytime, while merge commits can be completely rewritten, losing the actual merge information.
Both of these are wrong.
There should be a way to make WIP changes without committing it nor committing to it. (Yes, those are different things.) But there comes a point at which a change should be committed and committed to, to never change again. (With the exception of the nuclear option of erasing accidentally committed secrets and the like.)
Fossil is too rigid. Git is too flexible.
There is a middle ground. My design for such a VCS would have two kinds of commits: saves and full commits. Saves would be WIP stuff; anything goes. They would also be on auto-generated branches. Once WIP stuff is done, it should be to be rebased, squashed, merged, and/or cherry-picked into actual full commits on the branch that the saves created a branch off of.
But once those commits have been created, they are there forever. They should be a commitment. (I love the double meaning of the word "commit" here.)
With this design, people could have their cake and eat it too: they could have WIP stuff that they can still massage into a history they like, but then they would also have solid, reliable history with proper merge commits.
If that's how a team develops PRs, then the commits are structurally suboptimal, and the problem is in the development practices.
Such team won't be able to efficiently bisect, independently of the repository structure.
I personally work with granular, self-standing commits, and with this workflow, non-squashed commits makes sense.
Obviously it's not possible to always have self-standing commits, but it is possible the vast majority of the times.
It takes a lot of practice and discipline, though, and if a team is not willing to put them, then of course, squashing in the only way that makes sense.
If this title were "SQLite uses Fossil", it'd be more apparently just another ad for Fossil.
He likes to "engage" his audience in a way.
From my observations, some people think that they can extract more arguments or have a more fruitful discussion by being slightly spiky like that. I do not share this view.
If i remember correctly, it wasn't that they had any real problem with git, but that git didn't really fit with how they wanted to work, so they created their own thing.
SQLite is what I consider a well-engineered product.
And Richard Hipp is an excellent engineer. Listen to his podcast episodes on the changelog. It's fun. His mentality is interesting.
Fossil has the ability to push to git, which I do periodically just for curiosity.
An example would be the excellent diffing tools accessible through localhost, as well as things like issue tracking, which git doesn't understand as a concept.
There were some deal-breakers for me (kind of esoteric) and I switched back to git, but not without some annoyance.
I run an OrangePi Zero with 512MB of RAM as a home server since it both works and is a fun experience.
I use Windows + Linux machines + Pi and share between them so don't use the Pi4 exclusively but have noticed a difference in its ability to handle and open the repo.
Ever try and copy the .git part of a git repo? When it gets big, the copy gets bogged down by the sheer number of files.
All of this is also possible to do on a repository locally, without cloning.
This comes about from their development styles (see: http://www.catb.org/~esr/writings/cathedral-bazaar/).
- Use fossil if you prefer the cathedral style of development SQLite is open source but does not accept contributions.
- Use Git if you prefer the bazaar style of development. You want to accept hit-and-run style contributions from anyone.
If there’s commits like “fixed off by one issue in refactor” then it should be a comment in the code so that future will explorers won’t make the same mistake.
Rebase by itself isn’t bad, it just has to contain a good description of what was done and why.
Edit: after posting I realize that I confounded rebase and squash — which is kind of ingrained in my head as that’s how I use GitHub to merge PRs.
It's like a kind of blame + log in a single UI, in Git terms, and is just wonderful for quickly moving through the entire history of a file.
There is no consistency in the language or syntax of the commands when taken as a whole. Even individually some of the commands don't really make any sense and harken back to seemingly random unix CLI flags. "I wasted enough time to memorize them" doesn't mean they couldn't be cleaned up and made a little better.
If you're a single developer git is indeed overkill (not that there's a much better alternative).
If nothing else, network effects. Linux uses git, github is popular.
Unpopular opinion, but I find the value of having the actual surrounding context in which the code was developed more valuable than having a flat history.
A non-linear commit history is much more difficult to run a bisect on which was enough to sell linear for me.
That's not to say each PR is one commit, if there are multiple distinct parts of a PR that could be cherry picked in a way that they make sense on their own they'd still be separate commits.
But only if those commits are real atomic changes of code which compiles and not a series of 'oops', 'tests pass once again!' , 'forgot to commit this file' type inner-monologue type history.
And then there are shops where less technical authors are contributing solely via the GitHub WebUI. So you get a commits of the ilk 'Updated <Filename>' or ''Files added via upload'.
there are lots of people who use emacs for those two things and other editors/ides for other things.
i use emacs for more than the two, but certainly not for everything.
I'd love to hear some real-world experiences.
Like SQLite, Fossil is very nice software.
In what possible world is telling the most successful set of design decisions about document management in the history of documents or management to get fucked not just “I’ve got goodwill to burn, let’s ride.”? SQLite is indeed badass, but cool it djb, I’m already stressing about the zero bugs ever thing.
To squash or not to squash is a never ending debate precisely because of that. There isn't a right way to do it, each approach has a set of tradeoffs.
Maybe they are reinventing the wheel, but at their scale it's a tiny decision that doesn't mean that much. If they find out they are wrong, they can choose to migrate to Git instantly.
SQLite doesn't solicit contributions from programmers outside their organization, so it's really no skin off your back.
Edit: I’d like to apologize for mouthing off like that. I’ve earned some amount of cranky old-timer cred, but not enough to just be a dick, which that was.
Acme is great. I haven't been able to find another editor that integrates as tightly with the operating system. The closest I've gotten is Kakoune. And I wish mouse chording were a thing more generally. If we're going to use mice, we should optimize their utility.
I easily hit 4hz at the end of a 20 hour coding bender, and I’m old: the hot shit kids on modafinil must be doing 1.5x my decrepit ass.
If you can really move on the keyboard? Touch the mouse? I’ll grab a coffee while I’m at it.
Edit: It turns out that “fast emacs” doesn’t turn up a video of a real pro easily on Google. You can see a code God like Russ Cox being slow and clumsy as fuck if you want: https://youtu.be/dP1xVpMPn8M.
It’s a good thing thing he gets everything right on the first try (not sarcasm, Cox is an alien life form optimized for doing the impossible) because if he didn’t he’d finish pound-defining everything by about next March.
Great read :D