When you're getting roasted and given tasks of fixing and changing some code you didn't write trying to get a PR in, and the person you paired with who wrote it has moved on to other work.

Moreover you'll be stuck taking the blame down the road if they don't fire you, as the policy is to rebase squash merged in PR's so it will all unfortunately be under your name.

  • 3
    This is why I say CYA is job one. Some approaches to mitigate this and cover your ass:

    1. When you rebase, retain the commit messages with rebase -i and squash
    2. Save a backup of the log and create a repo called CYA you push branches to for this type of rainy day*
    3. If the rebase doesn't provide enough info, keep the branch local (to defend against orphan trimming) and use the following to replace the commit message after rebase:
    git log --pretty="format:Author: %an | hash: %h | %s"**

    With all that combined, you can flip over to the appropriate branch "git blame" all day long and get the real culprit.

    *can be local if you want to rely on file backup, just init the repo in some other folder with git init --bare, then in your source repo, git remote add cya /path/to/folder
    ** this will produce a result in the format of:
    "Author: author name | hash: {commit hash} | {commit message}"
Add Comment