3 ms·
Let’s say you’ve checked out a new branch and done a bunch of work over the course of the last two hours. You’ve added a new feature. In doing that, you’ve als
by stouset 1y ago
Let’s say you’ve checked out a new branch and done a bunch of work over the course of the last two hours.
You’ve added a new feature. In doing that, you’ve also fixed four unrelated bugs, clarified the documentation for a method you needed to use, and rewritten another function to be more performant.
You could push this all as six commits on one branch. PR reviewers will now have to figure out what parts are related to what, or read each commit one-by-one. If someone wants changes to one of these commits, your entire branch is held up.
Or you could split these six different commits out to each be directly on `main` and make a PR for each of them. They can be tested in CI, reviewed, and merged in isolation.
The latter is far better. You can do it in git, but it’s not exactly fun. It is trivial in jj.
- palata 1y agoThis is the kind of example that I find insightful. I know I can do it with git and it's not hard. It's not fun, but it's not hard. So I will disagree with anyone who says that it's impossible with git. But it is great to know that it is trivial in jj. That's a reason to try :-).
- stouset 1y agoIt’s definitely not impossible! It might not even be hard these days (git has accrued a million flags and features), but it is definitely friction. And it might not seem like much, but it adds up. And all of that friction stops you from even considering things that might genuinely be hard. Everything feeling like it’s a slightly uphill battle isn’t something you always notice until it’s suddenly gone.
- mpyne 1y ago> You could push this all as six commits on one branch. No, I'd probably put them all as individual branches to be reviewed, assuming they're truly independent changes. As long as they don't actually conflict it's not very hard to do this in git. But this is kind of what I mean when I say that git fits my needs, because I wouldn't come across 4 unrelated tasks like this in the course of implementing a single commit's worth of features, unless I was having the world's biggest attack of ADD. And if these things did need to get done to properly implement the feature to our team's quality standards, it would be appropriate to be included in that feature's PR as well. I'm sure it's a nice tool, especially for those who work in domains where it takes a long time to land your commits into the main branch of development, but a lot of this sounds like solutions to problems that we don't all have.