pre_merge.sh: tag last pre-merge commit

Change-Id: Iaf7ffada4c7cc77b85547e7b3c64aaa96e80b64b
This commit is contained in:
SpiritCroc 2022-11-18 15:12:38 +01:00
parent cf0dc42020
commit 791766dce2
3 changed files with 27 additions and 19 deletions

View File

@ -43,25 +43,6 @@ fi
last_tag=`downstream_latest_tag`
build_gradle="vector-app/build.gradle"
get_prop() {
local prop="$1"
cat "$build_gradle" | grep "$prop = " | sed "s|$prop = ||"
}
set_prop() {
local prop="$1"
local value="$2"
if grep -q "$prop =" "$build_gradle"; then
local equals="= "
local not_equals=""
else
local equals=""
# Don't touch lines that have an equals in it, but not for this prop
local not_equals="/=/! "
fi
sed -i "$not_equals""s|\($prop $equals\).*|\1$value|g" "$build_gradle"
}
# Legacy versioning, based on Element's version codes
#calculate_version_code() {

View File

@ -1,5 +1,25 @@
#!/bin/bash
build_gradle="vector-app/build.gradle"
get_prop() {
local prop="$1"
cat "$build_gradle" | grep "$prop = " | sed "s|$prop = ||"
}
set_prop() {
local prop="$1"
local value="$2"
if grep -q "$prop =" "$build_gradle"; then
local equals="= "
local not_equals=""
else
local equals=""
# Don't touch lines that have an equals in it, but not for this prop
local not_equals="/=/! "
fi
sed -i "$not_equals""s|\($prop $equals\).*|\1$value|g" "$build_gradle"
}
find_last_commit_for_title() {
local title="$1"
git log --oneline --author=SpiritCroc | grep "$title" | head -n 1 | sed 's| .*||'

View File

@ -8,6 +8,13 @@ source "$mydir/merge_helpers.sh"
# Require clean git state
require_clean_git
# Tag this version for easier git diff-ing
versionMajor=`get_prop ext.versionMajor`
versionMinor=`get_prop ext.versionMinor`
versionPatch=`get_prop ext.versionPatch`
tag="sc_last_v$versionMajor.$versionMinor.$versionPatch"
git tag "$tag"
# Revert Schildi's upstream string changes
git checkout `upstream_common_base` -- "$mydir/library/ui-strings/src/main/res/**/strings.xml"
git commit -m "Automatic revert to unchanged upstream strings, pt.1"