common/scripts/lint-commits: fail on merge and fixup commits#58779
common/scripts/lint-commits: fail on merge and fixup commits#58779classabbyamp merged 1 commit intovoid-linux:masterfrom
Conversation
| !subject { | ||
| if (length > 50) { print "::warning title=Commit Lint::" C ": subject is a bit long" } | ||
| if (!($0 ~ ":" || $0 ~ "^Take over maintainership " || $0 ~ "^Orphan ")) { print "::error title=Commit Lint::" C ": subject does not follow CONTRIBUTING.md guildelines"; exit 1 } | ||
| if ($0 ~ "^fixup! ") { print "::error title=Commit Lint::" C ": fixup commit included, please squash commits"; exit 1 } |
There was a problem hiding this comment.
are there lots of examples where people pushed fixup! commits?
I usually only see something like
Commit A: New package: abc-123
Commit B: Fix changelog and cross-build
Commit C: Update srcpkgs/template/abc
Commit D: Merge master into ...
So it might also make sense to look for ^[Ff]ix and ^Update?
There was a problem hiding this comment.
if someone uses git commit --fixup (I do a lot) it adds thosefixup! commits.
we can add other regexes too
There was a problem hiding this comment.
I didn't know git has something inbuilt for this.
Good to know, thanks for the explanation :)
There was a problem hiding this comment.
the other cases you mentioned should be caught by line 51
|
I agree that this is addition makes sense, I've seen a lot of cases where people included additional commits instead of squashing. |
Testing the changes