I have a live web site where a bug is manifesting only in PROD. I was thinking that rather than implement some logging on my prod branch I’d make a special short-lived logging branch and check that out into PROD having first tested it in my staging server. Then, I can switch back to the main trunk branch once I troubleshooted the issue.
I realize that testing in PROD is wrong but we cannot reproduce this bug in the staging server. Am I missing an approach or, can you comment on the danger of pulling a branch (which is not very divergent from trunk) into production?
The easiest approach would be to branch out of PROD into a short-lived testing branch. You should be branching out at the commit/tag where you see the issue.
Use this branch to make any changes and fix the issue. After verifying your FIX on the Staging Server, merge the changes back into PROD branch.