Feature suggestion: automatic commit review (check if commit message agree with changes)

I see that " Automatic Generation of Commit Messages and PR Descriptions/Titles" [1] is coming, which I’m sure can be useful.

I’m personally more interested in sort-of the opposite though: Based on a commit message (and possible content of a linked issue), check if the actual changes agree with the commit message. I think this should be able to catch some errors early and incentives writing a good and detailed commit message expressing the intention behind the code.

I tried this out manually recently after catching a bug while reviewing the diff my self. I gave the full changed files, the diff, and the commit message, and asked if the commit message was consistent with the changes. It did not work immediate, but if I tweaked the commit message a bit (including a definition of a term) it spotted the error.

[1] PRD: Automatic Generation of Commit Messages and PR Descriptions/Titles for JetBrains Extension · Issue #2109 · sourcegraph/jetbrains · GitHub

3 Likes