97 points · by susam · 3y ago · 187 comments
Other than that my bigger gripe is when I read something like this:
> Git strives to record what the development of a project should have looked like had there been no mistakes
Git does not strive to do this. It allows it, to some degree. This is not the same thing at all and is basically FUD. I would say the debate is ongoing as to the value of history rewriting. It's probably a tradeoff that some orgs are willing to leverage and Fossil is masking that they allow less flexibility in workflows as an obvious advantage, feels slimy.
When you're sharing your source changes with external people, who need to review your code, it just makes sense to present it in a clean, logical progression of changes. To wit, remove unnecessary noise like your development missteps.
And it's only in that context that the emphatic call for history rewriting is born. Meaning, you can use all the power of Git to record all your changes as you proceed through development, and then rebase them into something presentable for the greater world.
When you're purely local, sure - do whatever the heck you want. Nobody cares. But messy merges are rough for collaboration, both present and future.
(rough, not fundamentally wrong, to be clear. It's just a friction tradeoff, dealing with human behavior has next to no absolutes)
When the tip of my branch gets built (1) and the merge target is not ahead (2) I can actually retag the output of the build of the branch as what is now on master.
When you do a squash, while the default commit message contains the SHA, it no longer carries a semantical meaning. It's just a string of text.
Perhaps a more contentious take: rebasing doesn’t bring any real value. To the original comment above, I would say a significant percentage of teams never use rebase and drive business value just fine. I do not think there exists and evidence to suggest teams that use rebase over squash merging are in some way higher performing. Rebase is something that some people’s obsessiveness compels them to care abut because they can, and then retroactively justify their decisions by suggesting value that isn’t there.
Again, Git gets its bias from Linux kernel development. You can not present your entire work as a single unit change to sub-system maintainers for inclusion in the mainline. You can use the power of Git to present it in a digestible way that aids understanding, and allows piecemeal selection of acceptable bits, and rejection of others.
This is clearly not relevant to everyone, but to suggest there is no value at all, is laughable.
I strongly disagree. I rebase feature branches on a daily basis and it's a must-have feature for anyone who works on feature branches that you want to keep updated and mergeable as fast-forward merges and ideally peel off small commits in separate pull requests.
Here's a small example of a very mundane workflow. I was assigned an issue where I needed to enable a component in a legacy project. I cut the feature branch and started going the "lean on the compiler" approach to fix blockers. Each individual blocker I addressed I saved as a local commit. Throughout the process I spotted a couple of bugs in mainline, which I also saved as local commits. Finally I got a working local build, but team members already merged a few updates onto mainline that created conflicts. I rebased my feature branch onto mainline's HEAD and fixed the conflicts in each local commit. Time to post pull requests for the fixes. I noticed a few of them were related so it would be preferable they went in before everything else. I did an interactive rebase to reorder local commits to move these bugfix commits to the start of the local branch. I squashed them, cleaned them up, and posted a pull request. The pull request was merged into mainline and in the meantime other PRs went in as well. I rebase the remaining commits in the local branch. Followed the same process for another bug. Rinse and repeat. Finally all I had left was the fix for the original issue. I rebased the remaining commits onto mainline, cleaned them up, and posted a PR. Done.
One ticket, around 3 PRs, and almost a 1:1 ratio of rebase-to-PR.
And here you are, saying rebasing doesn't bring any real value.
I think those who complain about rebase are overrepresented by the subset of Git users who barely go beyond the very basic features of checking out branches, pulling changes, and committing stuff. They have no idea how and why other features work, so they complain about things they know nothing about. When pressed about basic usecases, they fall back to trying to fill in the holes in their reasoning by arguing that workflows should be different or that other features are similar, while completely ignoring that features like rebase do the job and do the job very well and very easily.
It's a big downside of git being treated like some magical difficult spell. Same with exiting Vim, people treat it as way harder than it really is.
There’s plenty of reason to use rebase, but if you’re fine letting the occasional mess slip into the history then it’s fine to NOT use it as well.
The one universal case though. Rebase before you submit a patchset for review. I don’t want to fight through merge conflicts to review a change, make sure it’s applied to the current HEAD before you send it.
You still have to change api keys if you ever pushed, because things like github store orphan commits, but if you have something you can't change in there or you catch it before you push, it will at least go away eventually.
1. Assume you are a user who is cloning the master/main branch and building it. If that branch contains your development missteps, then you are in for a world of pain. We as users always assume that the master/main Head is always buildable (excluding inadvertent mistakes).
2. If you are sending the commits as patches, then it makes sense to include a complete feature in a single patch. It will otherwise be very hard for the reviewer to make sense of any patch.
There are plenty of reasons if you're doing non-trivial tasks on local branches within a team. I've mentioned a common usecases I have, which is to reorder commits I make in local branches to afterwards peel them off as stand-alone pull requests.
> The golden rule of git rebase is to never use it on public branches.
https://www.atlassian.com/git/tutorials/merging-vs-rebasing#...
If you're doing trunk based development, with continuous integration, then you're approximately always on a public branch, and rebasing is not very useful.
Just the other day I was starting an exploratory project, and thought: I'll just use git so I can throw this on github later. Well, silly me, it happened to contain some large binary files, and github rejected it, wanting me to use git-lfs for the big files. After half an hour of not getting it to work, I just thought screw it, I'll drop everything into fossil, and that was it. I have my issue tracker and wiki and everything, though admittedly I'll have some friction later on if I want to share this project. Not having to deal with random git-lfs errors later on when trying to merge commits with these large files is a plus, and if I ever want to, I can fast-export the repo and ingest it into git.
I also think it’s one of those situations where if I have a giant binary file in source control “I’m doing it wrong” so git helps me design better.
It’s like in the olden days when you couldn’t put blobs directly in a row so databases made you do your file management yourself instead of just plopping in files.
I like git. I don’t like giant binary files in my commit history. It’s cool that you like fossil, but I don’t see this as a reason for me to use it.
It's the same with Git. Don't put large files directly in Git because Git doesn't support that very well, not because it's fundamentally the wrong thing to do.
There should be a name for this common type of confusion: Don't mistake universal workarounds for desirable behaviour.
It was a design constraint back in the day.
I haven’t looked at this in decades, but I think now it’s all just pointers to the file system and not actually bytes in the record.
So it was fundamentally the wrong thing to do based on how databases stored data for performant recall.
But that’s back when disks were expensive and distributed nodes were kind of hard.
So you’re right, I’m not going to retrain models costing $100M because of SCM limitations. That’s because I don’t have any SCM limitations.
Your VCS should not be opinionated, that is not its job
I store binary files outside of git but keep build logs containing binary file CRCs on git
In git, diffs are literally just a UI thing.
I’ve migrated a lot of projects from fossil to git eventually, but I dare say they never would have made it that far, had I started out with more friction, including fighting vcs tools.
In your scenario, you just want to track different versions of a file.
It doesn't even matter if they can think of one; assuming your own use cases for software are everyone's is proceeding from false premises and is the sort of thing that leads to (and necessitates) "hacky workarounds" and eventually the adoption of better software we should've had in the first place.
Assume nothing about user's use cases. A VCS should not be imposing arbitrary limitations on the files it's indexing. It's like the old-school filesystems we (surprise, surprise) deprecated.
Your workflow and use cases aren't everyone's.
When you want to do things that Fossil is not meant to do, then you're in trouble. I have no idea on how to do CI/CD and DevOps with Fossil and how to integrate it with AWS/Azure/GCP.
I find the whole ecosystem of Gitlab/Github, Notion, Jira and stand-alone alternatives like Gitea [1], Gogs [2], Gitprep[3] and others to be more flexible and versatile.
[2] https://gogs.io/
Previous discussions:
https://news.ycombinator.com/item?id=2524422 (86 comments)
https://news.ycombinator.com/item?id=19006036 (247 comments)
https://news.ycombinator.com/item?id=27736980 (127 comments)
https://news.ycombinator.com/item?id=31696940 (73 comments)
In the past I used Mercurial, among other things, for my open source work. And various issue trackers of my own choosing. I am not particularly wedded to Git. But I keep getting sucked into GitHub these days.
To get publicity or outside contributions it's hard to avoid the GitHub trap. It's become a discovery service for open source (like Freshmeat.net back in the day), a common reference point for how to do code reviews ("merge requests") and issue tracking (even though it doesn't really do either all that awesomely), but most importantly it's become a place where people network generally.
I don't love that this is the case but it's hard to avoid.
And there was a time everyone thought facebook wouldn't dethrone myspace, [something.js] wouldn't replace [somethingelse.js], and so on.
First mover doesn't mean a lot in software. The network effect you brought up does, but there'll be plenty of people who don't want to get caught up in that "trap" and git/MS-land to seed a decent alternative. (Why should your code discovery networking site be prescribing your choice in VCS, anyway?)
I had hopes for bitbucket for a while, but it stagnated, and then Atlassian got their mitts on it.
With them having more representation we would have replaced it years ago.
Every Fossil repository maintains a list of the hash names of "shunned" artifacts. Fossil will refuse to push or pull any shunned artifact. Furthermore, all shunned artifacts (but not the shunning list itself) are removed from the repository whenever the repository is reconstructed using the "rebuild" command.
Now if you know everyone who has a copy of your repository, you can have them run a bunch of sqlite commands / low level git commands to make sure that the commit is gone.
If you didn't publish anything, as someone else said, your best bet is to make an entirely new clone, transfer the work you did on the original, omitting the sensitive data, then nuke the original.
The difference seems to be that commits are serious business on fossil, and they encourage you to test before you commit. While on git, commits are more trivial, pushing is where things become serious.
Or you can just rebase to edit the commits and remove the secret file. If you're really paranoid you can run `git gc` vto ensure the object file is cleaned up also. If you're super paranoid, then you can do:
git hash-object secretpassword.txt
And check that hash isn't an object in the `.git/objects` directory.
> FURTHER WARNING: This command is a work-in-progress and may yet contain bugs.
Purging and shunning are two entirely different things in fossil. Shunning is for removing "bad" content and purging is very specifically for use with the "bundle" command (a rarely-used option for submitting "drive-by patches" initially conceived as fossil's counterpart to pull-requests).
I have not yet forgiven git for that, but I'll reluctantly accept that me not knowing how to use the tool is not entirely the tool's fault.
Also: I stand 100% by your alternative solution because Mercurial rocks.
I don't buy this. A good tool should do its job and stay out of your way. The amount of pointless knowledge I now have just to be able to use a version control system for my job still to this day annoys me.
Linus Torvalds isn't some infallible god, and it may be useful for linux kernel development, but we're not all linux kernel developers; and tools like VCSes, when designed well, should be unnoticed until the exact moment you need them, convenient and simple to use, and not get in your way or create problems for you where there weren't any to begin with. (Holy run-on sentences, Batman!)
In contrast, git goes out of its way to throw itself in your face at every opportunity, exacerbate your problems, and create a maze you either have to navigate precisely or just decide "fuck it" and do a copy/replace file trick just to get back on track with what you were actually doing.
The fact that people keep prescribing "just learn all its intricacies" or other band-aids (like the other "use with" software suggestions here) rather than even acknowledging it as a problem, to me, points to the lack of UX expertise in the field, and to stockholm syndrome.
(Which, funnily enough, is a problem things like git contributes to. It being one of the first things required to learn in CS, I constantly wonder how many of my peers might've switched out of the field given the mess it is, assuming CS wasn't for them. And, in turn, the breakthroughs we might've missed out on having earlier.)
Tools should be simple and usable, not throw up arbitrary barriers to entry.
oh boy
Aside: How would you get this information (the complete change history in a single file of a larger project) if the repository was on GitHub?
Helpful hint: Click two nodes on the graph to see a diff between the two selected versions.
Forget that you know git, github, git-lfs, even software engineering for a moment. All you know is that you're developing a general project on a computer, you are using files, and you want version history on everything. What's wrong with that?
The major issue with big files is resources: storage, and network bandwidth. But for both of these it is the sum of all object sizes in a repo that matters, not any particular file, so it's weird to be harking on big files being bad design or evil.
Perforce handled it all like a champ.
People who think large files don't belong in SCC are...wrong.
I don't know if they still do it, but Unreal used to ship a Perforce license with their SDK.
I don't think that is true. You do see people warn that having large files in Git repositories, or any repository that wasn't designed with support for large files in mind, is "wrong", in the sense that there are drawbacks for using a system that was not designed to handle them.
Here's a historical doc of Linus Torvalds commenting Git's support for large files (or lack thereof)
THANK YOU. Fucking prescriptivists ruin everything.
I've tried many different SCM over the years and I was happy when git took root, but its poor handling of large files was problematic from the beginning. Git being bad at large files turned into this best practice of not storing large files in git, which was shortened to "don't store large files in SCM." I think that's a huge source of our availability and/or supply chain headache.
I have projects from 20 years ago that I can build because all of the dependencies (minus the compiler -- I'm counting on it being backwards compatible) are stored right in the source code. Meanwhile, I can't do that with Ruby projects from several years ago because gems have been removed. I've seen deployments come to a halt because no startup runs its own package server mirror and those servers go offline or a package may get deleted mid-deploy. The infamous leftpad incident broke a good chunk of the web and that wouldn't have happened if that package was fetched once and then added to an appropriate SCM. Every time we fetch the same package repeatedly from a package server we're counting on it having not changed because no one does any sort of verification any longer.
git has its place but it's really broken the world for how to think about SCC. There are other ways to approach it that aren't the ways git approaches it.
If the files are particularly large, they can be excluded from the clone, depending on discipline and/or department. There are various options here. Most projects I've worked on recently have per-discipline streams, but in the past a custom workspace mapping was common.
Not just the artifacts, but their entire history. That is a problem that Git has out of the box, but there is no reason it needs to work that way by default. LFS should be a first class citizen of a VCS, not an afterthought.
Some projects need the ability to version big files, there is a good reason why perforce exists and is widely used in the gaming industry.
"VCS, tickets, wiki, docs, notes, forum, chat, UI, RBAC"
I don't want my version control system to be a wiki. Or a chat app, or any of that.
The point of this, as the article states:
> These additional capabilities are available for Git as 3rd-party add-ons, but with Fossil they are integrated into the design, to the point that it approximates "GitHub-in-a-box.
I’ve not used fossil, but I appreciate this idea.
Sure, it’s not unixy, but maybe a VCS reasonably demands such features, and today, it’s not as though these are crazy advanced or complex features.
Edit: and yes, of course there are downsides as well. It's up to you to weigh them against each other.
A first drawback I can think of is that this would probably require an additional layer for non-tech people. I haven't had the opportunity to use Fossil, so I am clueless regarding the kind of UI they propose, but I wouldn't be surprised that they actually solve this, considering the extensive list of features.
Not sure how that's relevant, but I have ~150 repos locally and less than 10 on github. I also like the unix philosophy of having tools that do one thing and do it well.
It’s nice to be able to start git repos locally and only push to GitHub when I need to.
I also use gitlab quite a bit and it’s so clean to be able to pull from gitlab and push to GitHub, or vice versa. I don’t need any utilities, I don’t need any special workflows.
Git is sort of like a protocol with gitlab, GitHub, and others built on top.
If GitHub owned git then it would be so tightly coupled and suck.
I don’t think a VCS demands features of chat and the others. And the evidence provided by the millions of users seems to support that.
It’s not that chat and wiki are super complicated, it’s just more stuff. Implementing an alarm clock isn’t complicated either, should VCMs have alarm clocks as well?
Also, GitHub is not something to emulate, it is the lowest common denominator of repo hosting.
What do you mean by this? Having mostly used git and github, I don't really know what I'm missing.
This whole article is pretty much why fossil was made.
Then just don't use those features. There is no performance price for it.
One of the nice things about Fossil having a ticket database is that you can use it as a distributed, version-controlled SQLite database to store anything. You can even use it as a JSON database if you want. And the forum, well, it's lovely to have it there even if you rarely use it. Because sometimes if you're working with someone else it comes in handy - some conversations really should be kept with the code.
https://docs.github.com/en/communities/documenting-your-proj...
> 95% of the code in SQLite comes from just four programmers, and 64% of it is from the lead developer alone. The SQLite developers know each other well and interact daily. Fossil was designed for this development model.
They propose it as a way to do development with few members who all know each other, rather than making an open repository for anyone on the Internet to contribute.
I want to try it now and see what does it bring on the table and whether it's a viable alternative to git in this regard.
Doing one thing and one thing only is a feature, not a bug.
I drink coffee every day on the way to work.
I’m always in a hurry. It would be convenient to just build that in.
I always drink coffee while driving, I may as well just build it in.
Cut to a month later because my car won’t start because I’m out of coffee grounds.
This is how fossil seems to me.
I probably have hundreds of repos with just versioned files. That’s it. I don’t want an issue tracker and chat and everything else in my git.
And when I do, I can trivially push my repo to GitHub or gitlab or sr.ht or whatever.
Comically, I’d probably use the fossil service if it supported git.
Anyone else remember when Google Code only supported mercurial? And they talked about how much better mercurial was than git. And they were right. And no one cared.
I hope fossil sticks around because I like more services.
But if I was interviewing for a company and they said that I must use fossil, I probably wouldn’t work there. (This is similar to if they said you must use TFS or something else weird)
I’ve used so many version controls over the years (vss, cvs, subversion, clearcase, perforce, bitkeeper, tfs, mercurial, manual file system hacks) and I need a really good reason to use something other than git. Making it more complex is not a reason I accept.
I'd call this a straw man but it's way past that...
And not the wiki, the issues, the releases, the forums, the website, and all that stuff that is probably needed once your project starts to involve a few people.
Second, for my repos, I use markdown directly in the repo instead of a wiki. This works better for me because the version history is in the repo and for wikis the author is important context for the value of the information.
Third, I build my website using an ssg that builds off my repo. Typically this is Jekyll scripts that build out fine on GitHub pages or gitlab pages or whatever. And I can move to any host I want. I don’t want to couple my project’s web site to my source code host.
These are “solved” features as far as I’m concerned and these actually bring negative value for me. I don’t want to worry about what kind of forum functionality my scm provides. And I certainly don’t care about pushing my forum from one server to another.
I don’t know the exact dividing line for “do one thing” but I think that modularity and composability is important.
I like having an AC in my car. But I don’t want AC to be a dependency for my car.
I like chaining tools together, but work to minimize the required dependency among tools.
I think in principle, it’s good if you can install components separately. So for me git only doing version control is good. If they added a chat feature, I would not want that. If they had a chat module that I could optionally install, maybe.
I've seen plenty of cars in which you have to bring your own radio. AFAIK, there's even a standard connector in the back of the hole where the radio fits (and the size and shape of the hole seems to always be the same, so it's probably standardized too). I've even seen things like DVD players which fit into that same hole (using an articulated screen which retracts into the device's body).
plan $CURLOC "alice's restaurant" \
| dress-with pit-stops -every $(( RANGE - 100 )) \
| drive
and then crank up the death polka.Reading it and then concluding what it is or who it’s meant for is worth it. I read it long ago and found it interesting.
I think a lot of things could be built on top of git.
See most of the points labelled with links to 2.5 plus the comment about showing what you actually did I no rewriting and lying about history, tyhe errors you made are often just as important as the correct way of doing things.
I can't think of any other tool that hasn't given me headaches at least once a day.
Git is actually remarkable tech and its unfortunate that the prevailing hivemind opinion is that its bad.
I don’t think that’s true. I think the hive mind is that it’s good, or many “haha sucks but I use it all the time.”
I work sort of near “data science” and there’s lots of no code/low code people wanting to do data science (or at least bill for it). And I’d say the hive mind in non-coders is that fit is bad. But I think that’s more related to all coding is bad and git is like step 1 to coding so it’s the first hard step they hit.
Who are you to say that my blobs don't belong in version control? Where does a versioned asset file for a website or a game go, if not in version control? If the answer is "somewhere else referneced by the git commit", then you're accepting that the data belongs in version control but that git can't handle it.
> But for those who need large blobs there is git-lfs as the author mentioned.
git-lfs isn't git, though. It's a bodge on top of git that breaks many of the assumptions about git, requires special handling and setup. If it _were_ a core part of git I would agree, but it's not.
> So I prefer gits Unix philosophy of doing one thing but doing it really well
Git is tightly coupled to a _bunch_ of unix tools, and doesn't work without them. Try running git on windows and see that installs an entire suite of posix tools (msys) just to let you run `git clone`.
As soon as a VCS comes along that actually handles that properly people will say "of course, it was obvious that it should have been like this all along!".
Git LFS is a proof of concept, not a real solution.
Unfortunately none of the new Git alternatives I've seen (Jujitsu, Pijul etc) are tackling the real pain points of Git:
* Submodule support is incomplete, buggy and unintuitive
* No way to store large files that actually integrates properly with Git.
* Poor support for very large monorepos where you only want to clone part of it.
In a way, Git is bad at everything that centralised VCS systems are good at, which isn't surprising given that it's decentralised. The problem is that most people actually use it as a centralised VCS and want those features.