Skip to content

Commit bdfd17c

Browse files
krystian-hebelfilipleple
authored andcommitted
util/dasharo/tag-with-changelog: list edk2 and submodules commits
Other payloads aren't supported. Both submodules and edk2 commits are nested one level deeper that the main log. This is a compromise between enough information (previously just the number of commit added in a submodule was printed) and clear grouping between categories. Changelog for edk2 is limited in history, it starts with the first commit pointed to by common Kconfig default. For releases made before this commit, a warning about a possibly incomplete edk2 changelog will be shown in the comment just above the changelog. The changelog will be complete only if older tag is made after this commit, in most cases this will be two releases (or release candidates) from now, for each platform separately. Upstream-Status: Inappropriate [Dasharo downstream] Change-Id: I9db19340b25ba8fe3c8382217e777c9dbe901d04 Signed-off-by: Krystian Hebel <krystian.hebel@3mdeb.com>
1 parent 4232d62 commit bdfd17c

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

util/dasharo/tag-with-changelog

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,12 @@ get_log_submodule() {
155155

156156
if [ -n "$log" ]; then
157157
printf -- "- %s: Update from commit id %s to %s (%s commits)\n" "${submodule_dir}" "${old_version:0:10}" "${new_version:0:10}" "${commits}" >> "$LOGFILE"
158+
(
159+
IFS=$'\n'
160+
for l in $log; do
161+
printf -- " %s\n" "$l" >> "$LOGFILE"
162+
done
163+
)
158164
fi
159165
); then
160166
version_ctrl_c
@@ -187,6 +193,9 @@ for module in $(git submodule --quiet foreach pwd); do
187193
version="${name^^}_OLD_VERSION"
188194
declare "$version"="$(get_latest_commit_id "$module")"
189195
done
196+
OLD_EDK2_GIT_VERSION=$(grep -A1 EDK2_TAG_OR_REV payloads/external/edk2/Kconfig.dasharo | tail -n1)
197+
OLD_EDK2_GIT_VERSION=${OLD_EDK2_GIT_VERSION#*\"}
198+
OLD_EDK2_GIT_VERSION=${OLD_EDK2_GIT_VERSION%\"}
190199

191200
#check out new version and get information
192201
printf -- "\nFinding new submodule versions...\n" >&2
@@ -199,6 +208,9 @@ for module in $(git submodule --quiet foreach pwd); do
199208
version="${name^^}_NEW_VERSION"
200209
declare "$version"="$(get_latest_commit_id "$module")"
201210
done
211+
NEW_EDK2_GIT_VERSION=$(grep -A1 EDK2_TAG_OR_REV payloads/external/edk2/Kconfig.dasharo | tail -n1)
212+
NEW_EDK2_GIT_VERSION=${NEW_EDK2_GIT_VERSION#*\"}
213+
NEW_EDK2_GIT_VERSION=${NEW_EDK2_GIT_VERSION%\"}
202214

203215
git checkout "$NEW_GIT_VERSION" > /dev/null 2>&1
204216
git submodule update --init --checkout > /dev/null 2>&1
@@ -410,6 +422,26 @@ for module in $(git submodule --quiet foreach pwd); do
410422
get_log_submodule "${!old_version}" "${!new_version}" "${path}"
411423
done
412424

425+
echo "##############" >> "$LOGFILE"
426+
echo "#### EDK2 ####" >> "$LOGFILE"
427+
echo "##############" >> "$LOGFILE"
428+
# Hardcoded, probably won't ever change
429+
URL="https://github.com/Dasharo/edk2"
430+
# This is the first digest from common Kconfig option. While it could be pointed
431+
# to by previous release (in which case the changelog would be complete), it
432+
# isn't trivial to differentiate between such case and use as placeholder value.
433+
PREHISTORY="f0459dff1425c0c02d0736de5737eb23a1b671ec"
434+
435+
if [ -z "$OLD_EDK2_GIT_VERSION" ]; then
436+
echo "# Old EDK2 version couldn't be obtained, changelog may be incomplete!" >> "$LOGFILE"
437+
echo "# Commits older than ${PREHISTORY:0:10} won't be shown" >> "$LOGFILE"
438+
OLD_EDK2_GIT_VERSION="$PREHISTORY"
439+
fi
440+
441+
git clone "$URL" || version_ctrl_c
442+
get_log_submodule "$OLD_EDK2_GIT_VERSION" "$NEW_EDK2_GIT_VERSION" "edk2"
443+
rm -rf edk2
444+
413445
# Create signed tag, use LOGFILE as message, open editor, or fail if tag exists
414446
git tag -s -F "$LOGFILE" -e "$NEW_TAG_NAME" || version_ctrl_c
415447
echo "New tag has been created. To push it:"

0 commit comments

Comments
 (0)