aboutsummaryrefslogtreecommitdiffstats
path: root/build-aux/git-hooks/commit-msg-files.awk
diff options
context:
space:
mode:
authorJim Porter2023-04-23 11:43:07 -0700
committerJim Porter2023-04-23 12:07:08 -0700
commit3ce462c8fda02c29e79ec80fb389fc44d550142a (patch)
treeddbfa1d0b863ce8e1372ba1cef3b851691b26399 /build-aux/git-hooks/commit-msg-files.awk
parente26dcc0e1441ded286b83eefb358d965748dd6db (diff)
downloademacs-3ce462c8fda02c29e79ec80fb389fc44d550142a.tar.gz
emacs-3ce462c8fda02c29e79ec80fb389fc44d550142a.zip
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.
Diffstat (limited to 'build-aux/git-hooks/commit-msg-files.awk')
-rw-r--r--build-aux/git-hooks/commit-msg-files.awk2
1 files changed, 1 insertions, 1 deletions
diff --git a/build-aux/git-hooks/commit-msg-files.awk b/build-aux/git-hooks/commit-msg-files.awk
index 2117681343f..5c9b70a5de5 100644
--- a/build-aux/git-hooks/commit-msg-files.awk
+++ b/build-aux/git-hooks/commit-msg-files.awk
@@ -33,7 +33,7 @@
33function get_commit_changes(commit_sha, changes, cmd, i, j, len, \ 33function get_commit_changes(commit_sha, changes, cmd, i, j, len, \
34 bits, filename) { 34 bits, filename) {
35 # Collect all the files touched in the specified commit. 35 # Collect all the files touched in the specified commit.
36 cmd = ("git log -1 --name-status --format= " commit_sha) 36 cmd = ("git show --name-status --first-parent --format= " commit_sha)
37 while ((cmd | getline) > 0) { 37 while ((cmd | getline) > 0) {
38 for (i = 2; i <= NF; i++) { 38 for (i = 2; i <= NF; i++) {
39 len = split($i, bits, "/") 39 len = split($i, bits, "/")