Skip to content

Commit

Permalink
sync: Commit .mailmap changes from script when sync-ing repo
Browse files Browse the repository at this point in the history
In commit 4794f18 ("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 <qmo@kernel.org>
  • Loading branch information
qmonnet authored and anakryiko committed May 2, 2024
1 parent 255b705 commit e055420
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions scripts/sync-kernel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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

0 comments on commit e055420

Please sign in to comment.