Problem: Sometimes I make unrelated changes when working on a feature
Problem: Sometimes I make unrelated changes when working on a feature. (I notice nearby, related code that needs work, so I fix it). This can lead to a big, unfocused branch. 👎
Solution: I don't open a big PR. Instead, I split the branch into separate, focused PRs.
You might ask, "Why not just do the changes in a separate branch in the first place?"
Often I do.
But I favor improving nearby code the moment I see an opportunity. Doing so often improves my new feature too.
I split the changes into separate, focused PRs if needed.