Node: Agree on commit reverting strategy

Created on 11 May 2017  路  7Comments  路  Source: nodejs/node

The COLLABORATOR_GUIDE doesn't seem to cover how to revert commits, and specifically what the commit message should be. I think we should try to agree what the standard process is.

For single commits with git revert HASH:

  1. Leave the commit message as is.
  2. Modify (not least to pass node-validate-commit), e.g. https://github.com/nodejs/node/pull/12976

For multiple commits with git revert FROM...TO:

  1. Leave as individual commits
  2. Format commit messages, e.g. https://github.com/nodejs/node/pull/4679
  3. Squash the commits
meta

Most helpful comment

Ah..wait, but this practice is still not documented, no?

All 7 comments

FWIW my preference is 1. and 2.

I was under the impression we always used just git revert <sha> and then amended the commit message with the reason for reverting

I don't believe I've ever seen us do a multiple commit revert. My preference is definitely git revert HASH on a single commit at a time with an amended commit message.

Refs https://github.com/nodejs/node/pull/4679#issuecomment-172421320 from @rvagg :

FYI, we've consistently used the format: Revert "original commit msg" as reversion messages, so even the subsystem prefix goes into the quotes. The tooling we have recognises this format too.

Okay, I think we have consensus, so I'll close this as decided. We use git revert, and leave the commits as they are.

If anyone disagrees then comment/reopen.

Ah..wait, but this practice is still not documented, no?

@joyeecheung Good point

Was this page helpful?
0 / 5 - 0 ratings