aosp-merger: Make script output a bit more readable

Change-Id: Ia624f82dd19b7d6e7902eaec3584748db72a90b5
This commit is contained in:
Michael Bestas 2023-11-06 23:23:29 +02:00
parent 99807baa54
commit 259965cf96
No known key found for this signature in database
GPG Key ID: F2D6C348F85577F5
9 changed files with 31 additions and 31 deletions

View File

@ -1,7 +1,7 @@
#!/bin/bash
#
# SPDX-FileCopyrightText: 2017, 2020-2022 The LineageOS Project
# SPDX-FileCopyrightText: 2021-2022 The Calyx Institute
# SPDX-FileCopyrightText: 2021-2023 The Calyx Institute
#
# SPDX-License-Identifier: Apache-2.0
#
@ -105,7 +105,7 @@ if [ ! -z "${OLDTAG}" ]; then
fi
if [[ "${OPERATION}" == "merge" ]]; then
echo "#### Merging ${NEWTAG} into ${PROJECTPATH} ####"
echo -e "\n#### Merging ${NEWTAG} into ${PROJECTPATH} ####"
if [ -f ".gitupstream-lineage" ]; then
git merge --no-commit --log lineage/"${LINEAGEBRANCH}" && git commit --no-edit
else
@ -120,7 +120,7 @@ if [[ "${OPERATION}" == "merge" ]]; then
exit 0
fi
elif [[ "${OPERATION}" == "rebase" ]]; then
echo "#### Rebasing ${PROJECTPATH} onto ${NEWTAG} ####"
echo -e "\n#### Rebasing ${PROJECTPATH} onto ${NEWTAG} ####"
git rebase --onto "${NEWTAG}" "${OLDTAG}"
fi

View File

@ -1,7 +1,7 @@
#!/bin/bash
#
# SPDX-FileCopyrightText: 2017, 2020-2022 The LineageOS Project
# SPDX-FileCopyrightText: 2021-2022 The Calyx Institute
# SPDX-FileCopyrightText: 2021-2023 The Calyx Institute
#
# SPDX-License-Identifier: Apache-2.0
#
@ -98,7 +98,7 @@ fi
CONFLICT=""
echo "#### Merging ${NEWTAG} into ${PROJECTPATH} ####"
echo -e "\n#### Merging ${NEWTAG} into ${PROJECTPATH} ####"
git merge --no-commit --log "${NEWTAG}"
if [[ -z "$(git diff --no-ext-diff HEAD)" ]]; then

View File

@ -1,7 +1,7 @@
#!/bin/bash
#
# SPDX-FileCopyrightText: 2017, 2020-2022 The LineageOS Project
# SPDX-FileCopyrightText: 2021-2022 The Calyx Institute
# SPDX-FileCopyrightText: 2021-2023 The Calyx Institute
#
# SPDX-License-Identifier: Apache-2.0
#
@ -59,10 +59,10 @@ STAGINGBRANCH="staging/${BRANCHSUFFIX}"
# Build list of forked repos
PROJECTPATHS=$(grep "name=\"CalyxOS/" "${MANIFEST}" | sed -n 's/.*path="\([^"]\+\)".*/\1/p')
echo "#### Old tag = ${OLDTAG} Branch = ${BRANCH} Staging branch = ${STAGINGBRANCH} ####"
echo -e "\n#### Old tag = ${OLDTAG} Branch = ${BRANCH} Staging branch = ${STAGINGBRANCH} ####"
# Make sure manifest and forked repos are in a consistent state
echo "#### Verifying there are no uncommitted changes on forked AOSP projects ####"
echo -e "\n#### Verifying there are no uncommitted changes on forked AOSP projects ####"
for PROJECTPATH in ${PROJECTPATHS} .repo/manifests; do
cd "${TOP}/${PROJECTPATH}"
if [[ -n "$(git status --porcelain)" ]]; then

View File

@ -1,7 +1,7 @@
#!/bin/bash
#
# SPDX-FileCopyrightText: 2017, 2020-2022 The LineageOS Project
# SPDX-FileCopyrightText: 2021-2022 The Calyx Institute
# SPDX-FileCopyrightText: 2021-2023 The Calyx Institute
#
# SPDX-License-Identifier: Apache-2.0
#
@ -59,10 +59,10 @@ STAGINGBRANCH="staging/${BRANCHSUFFIX}"
# Build list of AOSP repos
PROJECTPATHS=$(grep -v "remote=\"gitlab" "${MANIFEST}" | grep -v "clone-depth=\"1" | sed -n 's/.*path="\([^"]\+\)".*/\1/p')
echo "#### Old tag = ${OLDTAG} New tag = ${NEWTAG} Staging branch = ${STAGINGBRANCH} ####"
echo -e "\n#### Old tag = ${OLDTAG} New tag = ${NEWTAG} Staging branch = ${STAGINGBRANCH} ####"
# Make sure manifest and forked repos are in a consistent state
echo "#### Verifying there are no uncommitted changes on AOSP projects ####"
echo -e "\n#### Verifying there are no uncommitted changes on AOSP projects ####"
for PROJECTPATH in ${PROJECTPATHS} .repo/manifests; do
cd "${TOP}/${PROJECTPATH}"
if [[ -n "$(git status --porcelain)" ]]; then

View File

@ -1,7 +1,7 @@
#!/bin/bash
#
# SPDX-FileCopyrightText: 2017, 2020-2022 The LineageOS Project
# SPDX-FileCopyrightText: 2021-2022 The Calyx Institute
# SPDX-FileCopyrightText: 2021-2023 The Calyx Institute
#
# SPDX-License-Identifier: Apache-2.0
#
@ -53,10 +53,10 @@ source "${TOP}/build/envsetup.sh"
# List of merged repos
PROJECTPATHS=$(cat ${MERGEDREPOS} | grep -w merge | awk '{printf "%s\n", $2}')
echo "#### Staging branch = ${STAGINGBRANCH} ####"
echo -e "\n#### Staging branch = ${STAGINGBRANCH} ####"
# Make sure manifest and forked repos are in a consistent state
echo "#### Verifying there are no uncommitted changes on forked AOSP projects ####"
echo -e "\n#### Verifying there are no uncommitted changes on forked AOSP projects ####"
for PROJECTPATH in ${PROJECTPATHS} .repo/manifests; do
cd "${TOP}/${PROJECTPATH}"
if [[ -n "$(git status --porcelain)" ]]; then
@ -66,7 +66,7 @@ for PROJECTPATH in ${PROJECTPATHS} .repo/manifests; do
done
echo "#### Verification complete - no uncommitted changes found ####"
echo "#### $(basename ${MERGEDREPOS}) ####"
echo -e "\n#### $(basename ${MERGEDREPOS}) ####"
read -p "Pushing ${STAGINGBRANCH}. Press enter to confirm."
# Iterate over each forked project
@ -82,7 +82,7 @@ for PROJECTPATH in ${PROJECTPATHS}; do
fi
fi
echo "#### Submitting ${PROJECTPATH} merge ####"
echo -e "\n#### Submitting ${PROJECTPATH} merge ####"
git checkout "${STAGINGBRANCH}"
calyxremote | grep -v "Remote 'calyx' created"
git push calyx HEAD:refs/heads/"${BRANCH}"

View File

@ -1,7 +1,7 @@
#!/bin/bash
#
# SPDX-FileCopyrightText: 2017, 2020-2022 The LineageOS Project
# SPDX-FileCopyrightText: 2021-2022 The Calyx Institute
# SPDX-FileCopyrightText: 2021-2023 The Calyx Institute
#
# SPDX-License-Identifier: Apache-2.0
#
@ -54,7 +54,7 @@ PROJECTPATHS=$(cat ${MERGEDREPOS} | grep -w merge | awk '{printf "%s\n", $2}')
read -p "Press enter to begin pushing upstream branch."
# Make sure manifest and forked repos are in a consistent state
echo "#### Verifying there are no uncommitted changes on forked AOSP projects ####"
echo -e "\n#### Verifying there are no uncommitted changes on forked AOSP projects ####"
for PROJECTPATH in ${PROJECTPATHS} .repo/manifests; do
cd "${TOP}/${PROJECTPATH}"
if [[ -n "$(git status --porcelain)" ]]; then
@ -74,7 +74,7 @@ for PROJECTPATH in ${PROJECTPATHS}; do
UPSTREAMBRANCH="${lineageos_branch}"
fi
fi
echo "#### Pushing upstream branch ${UPSTREAMBRANCH} for ${PROJECTPATH} ####"
echo -e "\n#### Pushing upstream branch ${UPSTREAMBRANCH} for ${PROJECTPATH} ####"
calyxremote | grep -v "Remote 'calyx' created"
if [ "${LINEAGE}" = true ]; then
git push calyx lineage/${UPSTREAMBRANCH}:refs/heads/upstream/${UPSTREAMBRANCH}

View File

@ -1,7 +1,7 @@
#!/bin/bash
#
# SPDX-FileCopyrightText: 2017, 2020-2022 The LineageOS Project
# SPDX-FileCopyrightText: 2021-2022 The Calyx Institute
# SPDX-FileCopyrightText: 2021-2023 The Calyx Institute
#
# SPDX-License-Identifier: Apache-2.0
#
@ -54,10 +54,10 @@ fi
# List of merged repos
PROJECTPATHS=$(cat ${MERGEDREPOS} | grep -w merge | awk '{printf "%s\n", $2}')
echo "#### Branch = ${BRANCH} Squash branch = ${SQUASHBRANCH} ####"
echo -e "\n#### Branch = ${BRANCH} Squash branch = ${SQUASHBRANCH} ####"
# Make sure manifest and forked repos are in a consistent state
echo "#### Verifying there are no uncommitted changes on forked AOSP projects ####"
echo -e "\n#### Verifying there are no uncommitted changes on forked AOSP projects ####"
for PROJECTPATH in ${PROJECTPATHS} .repo/manifests; do
cd "${TOP}/${PROJECTPATH}"
if [[ -n "$(git status --porcelain)" ]]; then
@ -70,7 +70,7 @@ echo "#### Verification complete - no uncommitted changes found ####"
# Iterate over each forked project
for PROJECTPATH in ${PROJECTPATHS}; do
cd "${TOP}/${PROJECTPATH}"
echo "#### Squashing ${PROJECTPATH} ####"
echo -e "\n#### Squashing ${PROJECTPATH} ####"
repo abandon "${SQUASHBRANCH}" .
git checkout -b "${SQUASHBRANCH}" "${STAGINGBRANCH}"
git branch --set-upstream-to=m/"${BRANCH}"

View File

@ -1,7 +1,7 @@
#!/bin/bash
#
# SPDX-FileCopyrightText: 2017, 2020-2022 The LineageOS Project
# SPDX-FileCopyrightText: 2021-2022 The Calyx Institute
# SPDX-FileCopyrightText: 2021-2023 The Calyx Institute
#
# SPDX-License-Identifier: Apache-2.0
#
@ -51,10 +51,10 @@ fi
# List of merged repos
PROJECTPATHS=$(cat ${MERGEDREPOS} | grep -w merge | awk '{printf "%s\n", $2}')
echo "#### Staging branch = ${STAGINGBRANCH} ####"
echo -e "\n#### Staging branch = ${STAGINGBRANCH} ####"
# Make sure manifest and forked repos are in a consistent state
echo "#### Verifying there are no uncommitted changes on forked AOSP projects ####"
echo -e "\n#### Verifying there are no uncommitted changes on forked AOSP projects ####"
for PROJECTPATH in ${PROJECTPATHS} .repo/manifests; do
cd "${TOP}/${PROJECTPATH}"
if [[ -n "$(git status --porcelain)" ]]; then
@ -67,6 +67,6 @@ echo "#### Verification complete - no uncommitted changes found ####"
# Iterate over each forked project
for PROJECTPATH in ${PROJECTPATHS}; do
cd "${TOP}/${PROJECTPATH}"
echo "#### Pushing ${PROJECTPATH} merge to review ####"
echo -e "\n#### Pushing ${PROJECTPATH} merge to review ####"
repo upload -c -y --no-verify -o topic="${TOPIC}" .
done

View File

@ -1,7 +1,7 @@
#!/bin/bash
#
# SPDX-FileCopyrightText: 2017, 2020-2022 The LineageOS Project
# SPDX-FileCopyrightText: 2021-2022 The Calyx Institute
# SPDX-FileCopyrightText: 2021-2023 The Calyx Institute
#
# SPDX-License-Identifier: Apache-2.0
#
@ -56,10 +56,10 @@ fi
# List of merged repos
PROJECTPATHS=$(cat ${MERGEDREPOS} | grep -w merge | awk '{printf "%s\n", $2}')
echo "#### Squash branch = ${SQUASHBRANCH} ####"
echo -e "\n#### Squash branch = ${SQUASHBRANCH} ####"
# Make sure manifest and forked repos are in a consistent state
echo "#### Verifying there are no uncommitted changes on forked AOSP projects ####"
echo -e "\n#### Verifying there are no uncommitted changes on forked AOSP projects ####"
for PROJECTPATH in ${PROJECTPATHS} .repo/manifests; do
cd "${TOP}/${PROJECTPATH}"
if [[ -n "$(git status --porcelain)" ]]; then
@ -72,7 +72,7 @@ echo "#### Verification complete - no uncommitted changes found ####"
# Iterate over each forked project
for PROJECTPATH in ${PROJECTPATHS}; do
cd "${TOP}/${PROJECTPATH}"
echo "#### Pushing ${PROJECTPATH} squash to review ####"
echo -e "\n#### Pushing ${PROJECTPATH} squash to review ####"
git checkout "${SQUASHBRANCH}"
repo upload -c -y --no-verify -o topic="${TOPIC}" .
done