Date: Tue, 6 Apr 2021 15:07:28 GMT From: Rene Ladan <rene@FreeBSD.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org Subject: git: 6d299fa340de - main - rmport: fix and simplify workflow Message-ID: <202104061507.136F7SbI050780@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by rene: URL: https://cgit.FreeBSD.org/ports/commit/?id=6d299fa340def7265630d8c2e8343b3bfaf7134b commit 6d299fa340def7265630d8c2e8343b3bfaf7134b Author: Rene Ladan <rene@FreeBSD.org> AuthorDate: 2021-04-06 15:04:22 +0000 Commit: Rene Ladan <rene@FreeBSD.org> CommitDate: 2021-04-06 15:07:06 +0000 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(-) 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202104061507.136F7SbI050780>