1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 18:40:39 -08:00

When examining merge commits in our Git hooks, only check the first parent

This does two things:

  1. We can properly validate log entries in merge commits.
  2. We don't check commits that were merged in from other branches.

* build-aux/git-hooks/commit-msg-files.awk (get_commit_changes): Get
the changes compared to the first parent.

* build-aux/git-hooks/pre-push: Only get the first parent of merge
commits when returning the rev-list, and only check "master" or
"emacs-NN" branches.
This commit is contained in:
Jim Porter 2023-04-23 11:43:07 -07:00
parent e26dcc0e14
commit 3ce462c8fd
2 changed files with 7 additions and 4 deletions

View file

@ -33,7 +33,7 @@
function get_commit_changes(commit_sha, changes, cmd, i, j, len, \
bits, filename) {
# Collect all the files touched in the specified commit.
cmd = ("git log -1 --name-status --format= " commit_sha)
cmd = ("git show --name-status --first-parent --format= " commit_sha)
while ((cmd | getline) > 0) {
for (i = 2; i <= NF; i++) {
len = split($i, bits, "/")