Recently I've had an argument with a teammate that I wanted to have a reverted commit on the master branch from where releases are made as a standalone commit and not merged with future changes.
- My point of view was that I wanted explicitly show that I reverted another's teammates work and then on top of that I introduced new behavior. For me it was more important to show exactly that I reverted a certain commit.
- His point of view was that the git history doesn't make sense at that reverted standalone commit because in the commit message I need to reason that I reverted that work in order to introduce a new work in a future commit. Especially that that "future" commit reasoning he didn't like. His view was that I should combine my new work with the reverted commit because only then the commit as a whole makes sense.
Are there best practices when reverting commits?
Should they be shown as separate commits or merged with other (new) meaningful changes and I'm especially interested in the why you would do one or the other?
If this is subjective feel free to close it, never the less I'm really interested how others handle reverted commits in the git history.
git revertwill always create a revert commit. So what are you actually doing that not creating a revert commit is on the table?