Does anyone here use stacked pull requests? What’s...
# random
u
Does anyone here use stacked pull requests? What’s been your experience? Worth the hassle?
t
not extensibly, tried a couple of times when mid PR I had a couple of different ideas and was not sure which was the “best”. I like discussing on something more concrete, so I thought some code was better that abstract ideas. however, don’t take my opinion too seriously, I also don’t like “big stories split into many PR” (or the many more small step, I think it is called now) as there is little indication of what design you are trying to get, so it is hard for me to review. I’d rather have a big PR where I can see all your idea at once, or none at all (trunk-based dev, then we just refactor when we see fit)
c
I think pull requests should be as small as possible, but not stacked. if when working on something i find that i can make a fix thats independent of my bigger pull request i make it in a fresh pr that branches off from main. but imo branching off from other pull requests is always a bad idea.
also i before making a change i try to make that change easy (do a refactoring that makes the change simpler)
then in my feature pr i see ah this is not yet easy enough, and do a fresh pr from main that makes it easier.
this only works well if you have a culture where prs are quickly reviewed
t
can you define fast? I am seriously curious, because I like the idea of small PR, but in practice for as fast as they get, between review and CI, it is as least always 30 minutes. and the sole scope of a PR is to simplify a change for a feature, what do I do for this 30 minutes? (I try to work on one thing at a time to maximize focus and limit context switching - said before getting distracted answering on slack 😛) and then there is the other “problem” you mention, the oh moment when you realize your refactor is not helping, so then you open another PR and all of those “commodity” changes just end up making the default branch dirty, with lots of commits bring not much (and actually, though arguably not too much of a deal, making
bisect
harder)
granted, my definition of big PR is probably max 2k lines, and usually not more than a couple of days
c
if i really need the change now i just cherry pick it, I guess that makes the prs somehow stacked. I just try to separate feature development from fixes and refactorings. to make it sure that fixes and refactorings land in main faster.