Date: Sun, 29 Nov 2020 16:47:07 +0000 From: Rene Ladan <rene@freebsd.org> To: crees@freebsd.org, git@freebsd.org, portmgr@freebsd.org Subject: converting rmport to git Message-ID: <20201129164707.GA31739@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
Hello, I started converting some scripts in the port tree to git, and hit a design decision with Tools/scripts/rmport. In the current SVN world it checks out a sparse copy of the tree to work on (just LEGAL, MOVED, category/Makefile and the port directory itself) and commits from that copy. This has the advantage of not clobbering an existing work tree and indeed does not need a pre-existing checkout at all. I could try to replicate this with git, but it seems like partial checkouts (not to be confused with shallow checkouts) are a bit of an afterthought [1] and need reasonably recent versions of the git binary and protocol. An alternative would be to just create a temporary branch on an existing checkout, say rmport-$USER-$EPOCH, do the removal work there, merge that branch to main, remove the temporary branch and push the new main. This feels less cryptic to me. It might also allow for better handling of merge conflicts with MOVED in case that file gets updated by someone else and you are in the middle of a big removal (say Python 2.7). Currently such conflicts crash the script (no work is lost because the temporary checkout is left alone in that case). What do you think? It looks like we can use a similar solution to the addport and perhaps mfh scripts. [1] https://unix.stackexchange.com/questions/233327/is-it-possible-to-clone-only-part-of-a-git-project René
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20201129164707.GA31739>