From 6d299fa340def7265630d8c2e8343b3bfaf7134b Mon Sep 17 00:00:00 2001 From: Rene Ladan Date: Tue, 6 Apr 2021 17:04:22 +0200 Subject: rmport: fix and simplify workflow - gather information about the deleted port for the commit message before removing the port. I somehow missed that when testing the script. - Instead of a temporary branch, just operate on the current branch and incorporate upstream changes with git pull --rebase. This prevents one from being stranded on a temporary branch if the script crashes and oblivates the need for a squash merge [1] Suggested by: mat [1] --- Tools/scripts/rmport | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'Tools') diff --git a/Tools/scripts/rmport b/Tools/scripts/rmport index 221ff4d329b7..840bb2d5ddb5 100755 --- a/Tools/scripts/rmport +++ b/Tools/scripts/rmport @@ -339,9 +339,7 @@ commit() ${GIT} commit --file=${gitlog} answer=$(ask "Do you want to merge and tweak the commit message") if [ "${answer}" = "y" ] ; then - ${GIT} checkout main 2>&1 - ${GIT} pull --ff-only 2>&1 - ${GIT} merge --squash ${branch} 2>&1 # history remains linear + ${GIT} pull --ff-only --rebase 2>&1 ${GIT} commit 2>&1 # modify final commit message echo "All done, check the result and push when everything is OK." fi @@ -352,8 +350,6 @@ cleanup() log "cleaning up" rm -f ${gitlog} - ${GIT} checkout main - ${GIT} branch -D ${branch} } usage() @@ -430,8 +426,6 @@ if [ ${1} = "-a" ] ; then exit fi -branch="rmport-$(date +%s)" -${GIT} checkout -b ${branch} remotes/origin/main gitlog=$(mktemp -t gitlog) for catport in $* ; do @@ -459,9 +453,9 @@ for catport in $* ; do edit_Makefile ${cat} ${port} - rm_port ${catport} - append_Template ${catport} + + rm_port ${catport} done # give a chance to the committer to edit files by hand and recreate/review -- cgit v1.2.3