I am a contributor to some open source projects that take a while to merge PRs. At any given time, I might have 2-10 outstanding PRs. Some bug fixes, some enhancements, etc. While those PRs are in flight, I want to run a local copy of the software that includes all of those branches (call it "my fork"). Sometimes, this means that I'm creating files/databases/etc that are not compatible with the main branch.
Now, when I want to create a new branch I have a problem. If I base it on main then it's ready to PR, but compiling it will take longer (since my existing object files are from the most recent compile of my fork, and my ccache cache is full of variations on those), and the binary produced won't be able to read the files I've been creating with my fork. If I base it on my fork then I have to rebase it on main before I can PR it.
I find myself doing a dance where I'm rebasing back and forth somewhere between once per commit and once per push. This gets tedious, and is somewhat error prone. It's even more complex if some of my branches are based on each other, or if I'm doing any cherry picking between branches.
Are there tools to manage this situation? What I'd like to be able to do is make a code change, commit that change in the new branch, then compile that change as part of my fork, repeat a few times, then push the new branch to create or update a PR, all with as few detours into git branch management as possible.
Simply having two working directories (whether two separate local repos that I push/pull between or one local repo with two working directories) does not solve this problem. I am still left managing rebases and merges manually, which is an error-prone process when done at the frequency necessary for this situation.