Suggestion For Alternative Rebased Branch Comparison

Answered

Comparing rebased branches doesn't always give the result you want because the comparison is by hash and naturally rebasing has changed the hash.

Sometimes it is useful to compare by commit message even though it isn't a reliable diff.

For example: today I was working in a branch and I realised that one of the new commits had broken something. The project doesn't have very good test coverage so it wasn't obvious which commit had caused it.

I ended up creating a branch off the broken branch and started dropping suspicious commits until I got it to work. I'm pretty sure that I dropped too many so I wanted to try again with a sub-set of the dropped commits.

However, I couldn't remember all the commits I dropped and the compare options in IDEA couldn't help me.

I ended up exporting the log from each branch and putting them into Excel to work out what the dropped commits were.

It would be nice if IDEA could compare by commit message as well as by hash.

2 comments
Comment actions Permalink
Here is the request to support diffing branches by actual changes https://youtrack.jetbrains.com/issue/IDEA-84785
 
I ended up creating a branch off the broken branch and started dropping suspicious commits until I got it to work

Git has bisect for such a scenario - to find out what exact commit introduced the bug. The operation can be started from the command line. Related request for the IDE - https://youtrack.jetbrains.com/issue/IDEA-82718 However, this is a rather rare operation, so I am not sure we need UI to start it.

 

0
Comment actions Permalink

Whilst bisect might have worked, in the end it wasn't that simple to work out what caused the issue.

Anyway, the suggestion was more about comparing the commit messages rather than the actual commit hashes or file contents (even if the comparison is potentially unreliable)

0

Please sign in to leave a comment.