Konubinix' opinionated web of thoughts

Git History Should Tell a Story. Really?


git history should tell a story. Really?

I tend to believe that when working on a branch, people should try as much as possible to clean the history so that people that will read the code later will understand not only the code, but also the path that was taken.

But, I often see branches shared among several collaborators and when the time to merge upstream is there, either one of them is not present and other team member don’t want to mess with per commits without per consent, or they don’t have much time left. They eventually merge the branch as is.

It is normal to try several things along the way, and the raw history should normally show those try and error. There will be commit like “dummy to trigger the CI” or “test”, or “wip”, or “commit to share the code with my colleague”.

I understand

  • the need to write such a shitty history
  • the impossibility to clean it afterwards
  • the theoretical importance of having a clean history for future collaborators

This puts me in cognitive dissonance.

Notes linking here