From 7748a3c18ddebfc3f6360e49ea3d480d817e18b2 Mon Sep 17 00:00:00 2001 From: Michael Bestas Date: Mon, 6 Nov 2023 23:23:29 +0200 Subject: [PATCH] aosp-merger: Make script output a bit more readable Change-Id: Ia624f82dd19b7d6e7902eaec3584748db72a90b5 --- aosp-merger/_merge_helper.sh | 6 +++--- aosp-merger/_subtree_merge_helper.sh | 4 ++-- aosp-merger/merge-aosp-forks.sh | 6 +++--- aosp-merger/merge-aosp.sh | 6 +++--- aosp-merger/push-merge.sh | 10 +++++----- aosp-merger/squash.sh | 8 ++++---- aosp-merger/upload-merge.sh | 8 ++++---- aosp-merger/upload-squash.sh | 8 ++++---- 8 files changed, 28 insertions(+), 28 deletions(-) diff --git a/aosp-merger/_merge_helper.sh b/aosp-merger/_merge_helper.sh index b8fb735..2854658 100755 --- a/aosp-merger/_merge_helper.sh +++ b/aosp-merger/_merge_helper.sh @@ -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 # @@ -97,7 +97,7 @@ if [ ! -z "${OLDTAG}" ]; then fi if [[ "${OPERATION}" == "merge" ]]; then - echo "#### Merging ${NEWTAG} into ${PROJECTPATH} ####" + echo -e "\n#### Merging ${NEWTAG} into ${PROJECTPATH} ####" git merge --no-commit --log "${NEWTAG}" && git commit --no-edit # Check if we've actually changed anything after the merge @@ -108,7 +108,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 diff --git a/aosp-merger/_subtree_merge_helper.sh b/aosp-merger/_subtree_merge_helper.sh index a384a91..22358a6 100755 --- a/aosp-merger/_subtree_merge_helper.sh +++ b/aosp-merger/_subtree_merge_helper.sh @@ -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 diff --git a/aosp-merger/merge-aosp-forks.sh b/aosp-merger/merge-aosp-forks.sh index 9e470c4..04c5944 100755 --- a/aosp-merger/merge-aosp-forks.sh +++ b/aosp-merger/merge-aosp-forks.sh @@ -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=\"LineageOS/" "${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 diff --git a/aosp-merger/merge-aosp.sh b/aosp-merger/merge-aosp.sh index 8657f5e..7aaa093 100755 --- a/aosp-merger/merge-aosp.sh +++ b/aosp-merger/merge-aosp.sh @@ -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 diff --git a/aosp-merger/push-merge.sh b/aosp-merger/push-merge.sh index 1108390..77b208e 100755 --- a/aosp-merger/push-merge.sh +++ b/aosp-merger/push-merge.sh @@ -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 # @@ -49,10 +49,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 @@ -62,7 +62,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 @@ -78,7 +78,7 @@ for PROJECTPATH in ${PROJECTPATHS}; do fi fi - echo "#### Submitting ${PROJECTPATH} merge ####" + echo -e "\n#### Submitting ${PROJECTPATH} merge ####" git checkout "${STAGINGBRANCH}" lineageremote | grep -v "Remote 'lineage' created" git push lineage HEAD:refs/heads/"${BRANCH}" diff --git a/aosp-merger/squash.sh b/aosp-merger/squash.sh index 9e5401b..be88555 100755 --- a/aosp-merger/squash.sh +++ b/aosp-merger/squash.sh @@ -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}" diff --git a/aosp-merger/upload-merge.sh b/aosp-merger/upload-merge.sh index 3323667..74e3e65 100755 --- a/aosp-merger/upload-merge.sh +++ b/aosp-merger/upload-merge.sh @@ -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 @@ 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 @@ -85,7 +85,7 @@ for PROJECTPATH in ${PROJECTPATHS}; do fi fi - echo "#### Pushing ${PROJECTPATH} merge to review ####" + echo -e "\n#### Pushing ${PROJECTPATH} merge to review ####" git checkout "${STAGINGBRANCH}" lineageremote | grep -v "Remote 'lineage' created" FIRST_SHA="$(git show -s --pretty=%P HEAD | cut -d ' ' -f 1)" diff --git a/aosp-merger/upload-squash.sh b/aosp-merger/upload-squash.sh index 588d783..f0e86d4 100755 --- a/aosp-merger/upload-squash.sh +++ b/aosp-merger/upload-squash.sh @@ -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