git branch transport
How to export / import the branch
bad-tree% git format-patch --stdout main..foo | \ssh remote "(cd some/path && git checkout main && \git checkout -b foo && git am)"
so that's it. We format the patches for everything from the mainline through the end of foo. It doesn't matter where 'foo' is off main. The main.. notation is such that it does the right thing (see gitrevisions(7) for all you could do here).
On the receiving side, we cd to git svn repo (or really any repo, this technique generalizes if you're moving patches between projects, though you may need to apply odd pipeline filters to change paths), make sure we have a clean tree with 'git checkout main' (though I suppose I could make that more robust). We create a new branch foo and then we apply the patch. Easy, simple, no muss, no fuss.
BTW I use '&&' above in case I've fat fingered anything, or there's already a foo branch, etc, it will fail as early as possible.
But what about when things go wrong...
One Last Hack
cd freebsdgit format-patch --stdout main..zstd sys/contrib/openzfs | \sed -e 's=/sys/contrib/openzfs/=/=g' | \(cd ../zfs ; git checkout master && git branch -b zstd && \git am)
This nicely moved the patches from one tree to the other to make it easier for me to create my pull request. Your milage may vary, and I've had to play around with the filter to make sure I didn't catch unwanted things in it... I've not taken the time to create a regexp for the lines that I need to apply the sed to for maximum safety, but so far I've gotten lucky that the above path isn't an any of the files I want to transport this way...