Skip to content

Commit 426acbc

Browse files
committed
build: remove git mailmap usage
The support of :mailmap flag in git-for-each-ref starts from git 2.43.0, our dev cluster repository apt 2.4.13 (amd64) has git upto 2.34.1, thus breaking our release script. Using git log options instead to extract tag information with mailmap applied. This will help users having same view in git commit messages and debian changelogs. Signed-off-by: Ye Xiang <[email protected]>
1 parent f69c808 commit 426acbc

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

contrib/scripts/generate_debian_changelog.sh

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
11
#!/bin/bash
22

3-
fmt=" \
4-
tagname=%(refname:short) \
5-
tagger_name=%(taggername:mailmap) \
6-
tagger_email=%(taggeremail:mailmap) \
7-
tagger_when=%(taggerdate) \
8-
committer_name=%(committername:mailmap) \
9-
committer_email=%(committeremail:mailmap) \
10-
committer_when=%(committerdate) \
11-
"
12-
133
if [ $# -eq 0 ]; then
144
tag=HEAD
155
else
@@ -22,7 +12,8 @@ if [ $? -ne 0 ]; then
2212
exit 0
2313
fi
2414

25-
git for-each-ref --shell --sort=-v:refname --format "$fmt" --merged "$tag" | {
15+
git log --use-mailmap --no-walk --format="tagname='%D' tagger_name='%aN' tagger_email='<%aE>' tagger_when='%ad' committer_name='%cN' committer_email='<%cE>' committer_when='%cd'" \
16+
--date="format:%a %b %-d %T %Y %z" $(git tag --merged "$tag") | sed "s/tagname='tag: \([^,']*\)'/tagname='\1'/" | {
2617
while read line; do
2718
eval $line
2819
(echo ${tagname} | grep -qE '^v[0-9]') || continue

0 commit comments

Comments
 (0)