Beautiful, I've been looking for something like this for a while. My only issue is getting a strange
fatal: remote part of refspec is not a valid name in :MARKET-446
error which seems resistant to the usual sort of tweaks.