Git Is Not Fine

billjings.com

55 points by steveklabnik a day ago


demorro - a day ago

I continue not to understand much of the point of this. I don't recognize the git workflow the author is talking about, and neither do I see the point of stacked PRs. Commits are fine as a unit of isolating work, and rebasing to keep that neat is not difficult.

How many PR's do y'all tend to have in flight at once? I sometimes think being a native (C++) developer makes me have a different take on some of this. Maybe if I was a JS dev making quick changes with 5 PR's a day I'd care more about this.

rurban - 3 hours ago

Git is fine, just automate your workflow. I usually have 5-50 parallel branches which need to be rebased on every master/main update, and several branches are nested.

So I have a rb.sh script for every major project which does the (partially stacked) rebases. When my magit fixups didn't catch it. And of course a lb.sh script (alias for pull --rebase) for the other machines to import the updated branches

vintagedave - a day ago

I admit the diagrams and struggles the author describes are far past my own usage of git. And like they identify at the end of the article, for truly complex git operations today I use AI. I haven’t rebased manually for a while. Forget rewriting commit messages!

> Companies like Meta have enjoyed in-house systems that run circles around it for almost a decade.

Based on Mercurial… the VCS I enjoyed using.

alphabeta3r56 - a day ago

> There is No C

Well yes because git was supposed to be completely distributed. You can design a system which has this feature but then it wouldn't be as distributed as git, making unrelated forks second class citizens. It might still be a good idea for tool to have it but it is not strictly a better/worse scenario.

> Mutability

I think i can mostly agree to this. I do wonder if people never work in a scenario where they are only committing partial state and not complete state. Nevertheless being able to track and not losing uncommitted state is a strict improvement.

> workflows

Aren't worktrees enough here?

luckymate - 15 hours ago

Working in growing monorepo I find git tragically annoying and lacking. On regular basis I stumble upon situations where I work on one thing, but it causes changes in other package and I have no clear no way to say: this changes go to branch #1, this other set of changes to branch #2, and another small fix to branch #3. Branch #1 depends on the others and once #2 and #3 get merged it should merge to master cleanly with no ceremony.

Switching branches is not a solution, cause all of this changes develop at the same time.

Neither worktrees nor stashes are even nearby being a viable solution. Unless someone enlightens me and explains how to achieve this flow easily in git I’ll be looking for better solutions. I just installed jj and I do hope it will bring some relief.

To be fair, before working in monorepo I did not have this kind of issues, or at least not that annoying. And yes, LLMs made the issue even bigger, cause it happens more often that while I’m coding on main feature I’ll write to Codex: „btw, fix this one thing while I’m busy with main tasks”, so my workstream is actually more tree-shaped than stream shaped.

Traubenfuchs - 5 hours ago

Gradle (instead of maven) or jj (instead of git) considered harmful. Fix your overengineering and stick with the basics. If you end up at a point where you are fighting with maven and git and need to reach for more tools, you already failed and should turn around.

Bret_McKinney - a day ago

[dead]

karmakaze - a day ago

This has pretty pictures but its verbosity and frankly made-up complexity is making me not take it as seriously as I perhaps should.

The way I'd handle rebasing stacked PRs/branches is to rebase the very last one. Then simply `git branch -f a-branch <logical same point on rebased>` for each of the others, done.

I worked on a project that had weekly releases. We had git submodules, and submodules of that, and on rare occasions a 4th repo. I would manually keep those all up to date with rebases pinning each submodule to the logical new points. It all became muscle memory. The lesson I learned is don't use submodules unless you really need to. (All the repos were our own.)

JJ may be great but a stawman isn't going to sell it to me.

Now I can tell an AI to rebase a stack and as long as there weren't any conflicts easily check the results.

Everyone has things that bug them, git isn't one of mine (today :-). Instead I have a custom keyboard layout that no one else uses that makes me feel better, but I don't go around telling everyone they should switch--unless you're curious[0].

[0] https://github.com/qwickly-org/Qwickly

applfanboysbgon - 10 hours ago

If it takes 20 diagrams (I counted!) to make your case for why jj is better... Git is fine. I don't need software that takes 20 diagrams to convey why I should consider it. (That includes a lot of the black magic Git wizardry too, of course. The extent of my Git usage does not require anywhere near 20 diagrams to explain either.)