Let's squash 'em commits

Hi folks,

I’ve noticed recently that the number of commits on Orekit develop branch has kinda exploded. And I don’t think it’s just because we’re delivering loads of new features. Recently I proposed here to change MR default settings and it was received with mixed feelings. Whilst I understand the will to keep a thorough history of the most significant changes and contribution, I really think that we should get rid of what I would call “hiccups” along the way: checkstyle fixing, javadoc corrections, editing a single test, changing the name of an attribute, etc. You get the idea

I mean with IDEs like IntelliJ, it’s very easy to select two or more commits and squash them together. I do it all the time (and I’m far from being a git wizard), exactly to get rid of the aforementioned hiccups. I don’t want to force anybody’s hand and make it an official policy or something, I would just really like to have a more readable commit history. Please help me

Cheers,
Romain.

Hi @Serrof,

I agree with you, keeping a clean history is a good thing.

The “interactive rebase” tool of IntelliJ makes it really easy.

Cheers,

Maxime

Hello, I did a quick analysis into the commit history. Of the 10K commits, 3% contain the word “style”, 4% “javadoc”, and 20% “merge”. I think these are contributing to the overall difficulty of seeing what’s going on. While changing the commit history is challenging for an open source project, there are command line tricks that can help you.

You can try the following command:

git log --oneline | grep -i -v style | grep -i -v merge | grep -i -v javadoc

It has multiple pipes(|) but it should be easy to follow: first it creates a one-liner history for all commits. Then it excludes all commits that contain the word “style”, then “merge”, then “java doc”. After that, there are mostly solid commits. You can add another pipe at the end to control how many lines you want to see using “head”.

Say you only want to see the most recent 20 commits:

git log --oneline | grep -i -v style | grep -i -v merge | grep -i -v javadoc | head -20