From 1db8374f0c20bec732a2236d3d1d7720aa44ee21 Mon Sep 17 00:00:00 2001
From: Virgile Prevosto <virgile.prevosto@m4x.org>
Date: Tue, 6 Sep 2022 18:44:03 +0200
Subject: [PATCH] [headers] better info message on checked headers in presence
 of renaming

---
 share/Makefile.headers | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/share/Makefile.headers b/share/Makefile.headers
index dcb65262090..7e0beb06fc8 100644
--- a/share/Makefile.headers
+++ b/share/Makefile.headers
@@ -206,8 +206,12 @@ else
 
 ifneq ($(HDRCK.HAS_GIT),)
 
+define HDRCK.file-list-from-git-diff-info
+$(GIT) diff --name-status $(1) | $(GREP) -v "^D" | $(SED) -e "s/^[CR][0-9]\+[ \t]\+[^ \t]\+[ \t]\+//" -e "s/^[AM][ \t]*//"
+endef
+
 define HDRCK.file-list-from-git-diff
-$(GIT) diff --name-status $(1) | $(GREP) -v "^D" | $(SED) -e "s/^[CR][0-9]\+[ \t]\+[^ \t]\+[ \t]\+//" -e "s/^[AM][ \t]*//" | $(TR) '\n' '\000' | $(HDRCK.FILE_ATTR)
+ $(call HDRCK.file-list-from-git-diff-info,$(1)) | $(TR) '\n' '\000' | $(HDRCK.FILE_ATTR)
 endef
 
 HDRCK.main-targets=check-headers headers
@@ -218,7 +222,7 @@ $$(HDRCK.$(1)-filter-targets):: HDRCK.SPEC=$$(call HDRCK.file-list-from-git-diff
 $$(HDRCK.$(1)-filter-targets):: %.$(1) : $(3) %
 	@echo [HDRCK] Done: HDRCK_DIFF=\"$(2)\" make $$(basename $$@)
 	@echo [HDRCK] checked file list:
-	$$(GIT) diff --name-status $(2)
+	$$(call HDRCK.file-list-from-git-diff-info,$(2))
 endef
 
 ifneq ($(HEADER_DIFF),)
-- 
GitLab