From e0554200338152aa5c9ffe635a5c312a0a0e86dc Mon Sep 17 00:00:00 2001 From: Quentin Monnet Date: Wed, 1 May 2024 09:49:09 +0100 Subject: [PATCH] sync: Commit .mailmap changes from script when sync-ing repo In commit 4794f18bf468 ("sync: Sync .mailmap entries"), we updated the sync-up script to automatically update libbpf's .mailmap; however, the script would not take care of committing the changes. Let's address this. The code is copied and adapted from the part where we commit changes to src/bpf_helper_defs.h. Signed-off-by: Quentin Monnet --- scripts/sync-kernel.sh | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/scripts/sync-kernel.sh b/scripts/sync-kernel.sh index 36bb96f..f3f5190 100755 --- a/scripts/sync-kernel.sh +++ b/scripts/sync-kernel.sh @@ -295,6 +295,22 @@ Latest changes to BPF helper definitions. " -- src/bpf_helper_defs.h fi +echo "Regenerating .mailmap..." +cd_to "${LINUX_REPO}" +git checkout "${TIP_SYM_REF}" +cd_to "${LIBBPF_REPO}" +"${LIBBPF_REPO}"/scripts/mailmap-update.sh "${LIBBPF_REPO}" "${LINUX_REPO}" +# if anything changed, commit it +mailmap_changes=$(git status --porcelain .mailmap | wc -l) +if ((${mailmap_changes} == 1)); then + git add .mailmap + git commit -s -m "sync: update .mailmap + +Update .mailmap based on libbpf's list of contributors and on the latest +.mailmap version in the upstream repository. +" -- .mailmap +fi + # Use generated cover-letter as a template for "sync commit" with # baseline and checkpoint commits from kernel repo (and leave summary # from cover letter intact, of course) @@ -352,10 +368,4 @@ else esac fi -echo "Regenerating .mailmap..." -cd_to "${LINUX_REPO}" -git checkout "${TIP_SYM_REF}" -cd_to "${LIBBPF_REPO}" -"${LIBBPF_REPO}"/scripts/mailmap-update.sh "${LIBBPF_REPO}" "${LINUX_REPO}" - cleanup