Skip to content

Commit

Permalink
umpf: add new flag to insert 'Upstream-Status: Pending' lines to all …
Browse files Browse the repository at this point in the history
…patches

Starting with the mickledore release, the upstream status is required
for all patches in Yocto.
Add a new flag "upstreamstatus" to handle this. If set to "insert",
"Upstream-Status: Pending" is added to the commit message of all patches
during "umpf tag".

Signed-off-by: Michael Olbrich <[email protected]>
  • Loading branch information
michaelolbrich committed Feb 16, 2024
1 parent ee2ec1b commit 4b1aeb5
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions umpf
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,18 @@ GIT_DIR="${GIT_DIR:-.git}"
STATE="${GIT_DIR}/umpf"

### flags ####
SUPPORTED_FLAGS=("extraversion")
SUPPORTED_FLAGS=("extraversion" "upstreamstatus")

declare -A flag_extraversion

flag_extraversion[val]="replace"
flag_extraversion[values]="replace conflictfree"

declare -A flag_upstreamstatus

flag_upstreamstatus[val]="none"
flag_upstreamstatus[values]="none insert"

##############

info() {
Expand Down Expand Up @@ -1105,7 +1111,25 @@ rebase_branch() {
committerdate="$(${GIT} log -1 --format=%cd --date=raw "$(<"${STATE}/base")")"
fi
if ! FILTER_BRANCH_SQUELCH_WARNING=1 "${GIT}" filter-branch -f --env-filter "GIT_COMMITTER_DATE='$committerdate'; GIT_COMMITTER_NAME=umpf; [email protected]" "$(<"${STATE}/prev_head").."; then
declare -a msg_filter
if [ "${flag_upstreamstatus[val]}" = "insert" ]; then
msg_filter=(
--msg-filter
"awk '
/^[^\s]*-by:/ {
print \"Upstream-Status: Pending\n\"
done=1
}
{
print \$0
}
END {
if (!done)
print \"\nUpstream-Status: Pending\"
}'" )
fi
if ! FILTER_BRANCH_SQUELCH_WARNING=1 "${GIT}" filter-branch -f "${msg_filter[@]}" --env-filter "GIT_COMMITTER_DATE='$committerdate'; GIT_COMMITTER_NAME=umpf; [email protected]" "$(<"${STATE}/prev_head").."; then
bailout "rewrite for reproducible commit-ish failed."
fi
echo "# umpf-topic-range: $(<"${STATE}/prev_head")..$(${GIT} rev-parse HEAD)" >&${series_out}
Expand Down

0 comments on commit 4b1aeb5

Please sign in to comment.