I suspect I may have a commit on a branch of mine - after the branch point from a master branch - which is empty. I want to find this commit (or maybe more than one?) and have a look at its commit message
Now, I could of course examine all commits from the branch point one by one and check whether they're empty or not. I could probably even write a shell script which takes the number of commits to look back and keeps executing
git diff HEAD^{n+1} HEAD^^^^...lots of ^{n}
and checking the number of output lines, and using that to get the commit IDs. But - I was hoping there was some either way to better automate this. I know that there's a git filter-branch
command which could remove empty commits, but I first want to know whether I had any and where they are. Also I don't want to go all the way back to the initial commit.