Moved the code from git-p4 submit to figure out the upstream branch point
treec8779d2dbd0536ce2c1ec57e48d5c02e80c63810
drwxr-xr-x - contrib