converting rmport to git

Rene Ladan rene at freebsd.org
Sun Nov 29 16:47:07 UTC 2020


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é


More information about the freebsd-git mailing list