summaryrefslogtreecommitdiff
path: root/util/tagbranch.sh
diff options
context:
space:
mode:
authorJack Rosenthal <jrosenth@chromium.org>2021-11-04 12:11:58 -0600
committerCommit Bot <commit-bot@chromium.org>2021-11-05 04:22:34 +0000
commit252457d4b21f46889eebad61d4c0a65331919cec (patch)
tree01856c4d31d710b20e85a74c8d7b5836e35c3b98 /util/tagbranch.sh
parent08f5a1e6fc2c9467230444ac9b582dcf4d9f0068 (diff)
downloadchrome-ec-stabilize-14388.62.B-ish.tar.gz
In the interest of making long-term branch maintenance incur as little technical debt on us as possible, we should not maintain any files on the branch we are not actually using. This has the added effect of making it extremely clear when merging CLs from the main branch when changes have the possibility to affect us. The follow-on CL adds a convenience script to actually pull updates from the main branch and generate a CL for the update. BUG=b:204206272 BRANCH=ish TEST=make BOARD=arcada_ish && make BOARD=drallion_ish Signed-off-by: Jack Rosenthal <jrosenth@chromium.org> Change-Id: I17e4694c38219b5a0823e0a3e55a28d1348f4b18 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3262038 Reviewed-by: Jett Rink <jettrink@chromium.org> Reviewed-by: Tom Hughes <tomhughes@chromium.org>
Diffstat (limited to 'util/tagbranch.sh')
-rwxr-xr-xutil/tagbranch.sh84
1 files changed, 0 insertions, 84 deletions
diff --git a/util/tagbranch.sh b/util/tagbranch.sh
deleted file mode 100755
index 3e196b6f25..0000000000
--- a/util/tagbranch.sh
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/bin/bash
-#
-# Copyright 2017 The Chromium OS Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-#
-# Generate git strings for tagging EC branches.
-#
-# This script builds up on ideas put by vpalatin@ into util/getversion.sh
-#
-# Git allows to count number of patches between the current state of the tree
-# and any directly preceding tag in the tree. That is if we tag the first
-# patch in the current branch, we can tell how many patches are in the branch
-# above that tag. And if we tag the branch such that the tag string includes
-# the branch name, we can also say what branch we are in looking at the
-# closest tag in the tree.
-#
-# This admittedly brittle script automates the process of tagging for the EC
-# git tree in Chrome OS repo, but it could be used for any other Chrome OS
-# repo git tree just as well.
-#
-# The script is brittle because it relies on the following assumptions which
-# are true for Chrome OS repo at the time of writing:
-#
-# - the upstream branch alias name shows up in the 'git branch -a' output
-# separated by ->
-# - the upstream branch alias name has the format of
-# cros/<branch name>
-# - the remote git server name shows up in 'git config -l' output in the
-# line starting with "remote.cros.url="
-# - firmware branch names have format of firmware-<board>-XXXXXX
-# - the current branch was cut off of <remote name>/master
-#
-# The tag name generated by this script would be the XXXXX string with dots,
-# if any, replaced by underscores.
-
-# Retrieve the upstream branch alias name
-UPSTREAM="$(git branch -a | awk '/->/ {print $3}')"
-if [[ -z "${UPSTREAM}" ]]; then
- echo "Failed to determine upstream branch alias" >&2
- exit 1
-fi
-
-export ORIGIN_NAME="cros"
-ORIGIN="$(git config "remote.${ORIGIN_NAME}.url")"
-
-# The last common patch between this branch and the master.
-BRANCH_POINT="$(git merge-base "${UPSTREAM}" "${ORIGIN_NAME}/master")"
-if [[ -z "${BRANCH_POINT}" ]]; then
- echo "Failed to determine cros/master branch point" >&2
- exit 1
-fi
-
-# Derive tag base string from the upstream branch name as described above.
-TAG_BASE="$(sed 's/.*-// # drop everything up to including the last -
- s/\./_/g # replace dots and dashes with underscores
- ' <<< "${UPSTREAM}" )"
-
-if [[ "${TAG_BASE}" == "master" ]]; then
- echo "Nothing to tag in master branch" >&2
- exit 1
-fi
-
-TAG="v1.${TAG_BASE}.0"
-
-#SHA1 of the first patch of this branch
-BASE_SHA="$(git rev-list --ancestry-path "${BRANCH_POINT}".."${UPSTREAM}" |
- tail -1)"
-
-echo "Will run git tag -a -m \"firmware branch ${TAG}\" ${TAG} ${BASE_SHA}"
-if git tag -a -m "firmware branch ${TAG}" "${TAG}" "${BASE_SHA}"; then
- cat <<EOF
-
-A new tag '$TAG' has been set. Use the following command
-to push it to the server
-
-git push --tags ${ORIGIN} ${TAG}
-
-Or if you want to delete it:
-
-git tag -d $TAG
-
-EOF
-fi