Back to News
Advertisement
ffunador about 4 hours ago 7 commentsRead Article on github.com

DE version is available. Content is displayed in original English for accuracy.

I have been pushing up to 90 commits a day on a MacBook Air via 4-5 parallel agents. As you can imagine when all the agents try to build, test and run dev servers on an 8GB machine it is the fast lane to a force quit and restart. I also did not want to pay the CI minutes on 90 pushes a day.

So I designed a local merge queue to have all commits land one at a time and fully tested. Hopefully this helps other folks with more modest machines. Appreciate any feedback.

Advertisement

⚡ Community Insights

Discussion Sentiment

67% Positive

Analyzed from 425 words in the discussion.

Trending Topics

#worktrees#tests#git#something#same#trees#tree#clone#path#definitely

Discussion (7 Comments)Read Original on HackerNews

ElijahLynn•6 minutes ago
Definitely going to look into this!

I just built something pretty much in the same vein of this with Claude over the past 2 months. It's a custom deployment system that uses work trees and each work tree has to to run end-to-end tests (Playright, Supabase, Astro) and other tests and create a stamp based on the contents of the entire tree. And then if another work tree has the same digest that matches the stamp then it can bypass the tests. So nothing can land on main without tests passing. Which is all in in enforced with a pre-push hook that checks the digest.

Then once it's on main it is deployed to Dev and then from there it can be promoted to prod.

I like the idea of just having one branch and the work trees funnel into it.

But definitely going to have my setup analyze this and see what can be improved with it or if I should just throw out mine and use that one.

barrkel•about 3 hours ago
A decent idea, however it seems to me a good chunk of it is because of git limitations. Have you looked jj?

I'm having a much better time with jj and a workspace per subagent than I was with git and worktrees.

It's still useful to have the CI gating on updating the master branch pointer, but you largely stop working with branches once you switch to jj.

kazinator•about 2 hours ago
git worktrees are a horrible misfeature; it's better to just clone multiple times (which you can do locally---space is saved by use of hard links!)

So that is to say, we clone some remote upstream down to /path/A. Then we can clone file:///path/A to /path/B locally. Both A and B are fully fleded git repos; no monkeying around with worktrees. The objects are shared between them with hard links. You can edit B/.gitconfig to point it to have the same upstream as A for pushing.

Unlike worktrees, you can blow away a repo with "rm -rf", and not worry that you are pulling the rug from under something which depends on it. If I have several trees, A, B, C, one of which is the parent, while the other are worktrees, removing any one of them randomly is Russian roulette: if we do "rm -rf B" and that happens to be the parent repo, worktrees A and C are no longer functional and need to be recovered. If A, B, and C are independent clones (even with objects hardlinked among themselves), this isn't a problem.

yiyingzhang•about 2 hours ago
What you described sounds like this: https://github.com/GenseeAI/gensee-crate. It offers whole workspace fork and merge. But the merge is still somewhat cumbersome and require manual overseeing.
funador•about 2 hours ago
Giving up branches is the dream. This feels like the nudge I needed to give jj a proper go. Thank you.
orsorna•about 4 hours ago
I have CI set up so that I can just let that handle builds and exclusive locks for me, but there are particular limitations (network connectivity is mandatory). I did this because I wanted to avoid something like you built, which theoretically can't scale as well as a dev box (much easier to extend deploy environments versus my local machine). I can see that you are working within resource constraints though which is admirable :)
funador•about 3 hours ago
Exactly, have to shave a few corners when your laptop doesn't even have a fan :)