use of "ports-reset.sh" is not clear to me

I read the FreeBSD announcements message about ports-reset.sh. Maybe I'm just too tired, but it doesn't seem clear to me. Nor do the comments in the script itself, nor the help message put out by its "-h" parameter. Generally speaking, all of this seems to assume a level of knowledge about various things -- such as the inner workings of git, those of the FreeBSD ports system, and the actual problem that it is meant to resolve -- that I simply don't feel like I have.

Given that it is apparently intended to be able to solve whatever the problem is "for all consumers of the ports tree", perhaps it would be good to have more explicit instructions specifically on how a basic user of the ports tree -- not a committer, not someone who makes changes to ports, not someone who uses port tree overlays (or whatever they're called; I forget the term), just someone who does a "git -C /usr/ports pull" -- is supposed to use it.

I mean, I get that I'm supposed to run it from within /usr/ports. But is that it? Just run it, with no options or anything?

Or do I have to, for example, figure out what this "bad_hash1 and bad_hash2 must be ordered exactly as they appear in commit history, with bad_hash1 being older" stuff that "ports-reset.sh -h" definitely wants me to know about is supposed to mean?

I apologize if this comes off as complaining or whatever; I don't mean it. In fact I appreciate the work done to resolve this problem (and, more generally, all the work that goes into FreeBSD and its ports system). But I'm sitting here wondering if I'm going to cause some sort of even worse problem on my computer simply by trying my not-necessarily-good-enough-best to figure out what all this means on my own.
 
Fisrt of all, I don't have any personal branches for ports tree, just staging applied patches / my updates under tests before pulling updates and applying stashed local changes afterwards. So if you have local branches or local commits, the situation and works would differ.

What I did is as below.
  1. download the script and confirm sha256 hash, then, allow exec for it
  2. cd /usr/ports
  3. git stash
  4. run the script as root (as I've cloned ports repo as root at the first place)
  5. git stash apply
  6. confirm local changes are sanely applied with git diff
 
Simply execute it.
Code:
$ fetch -o /tmp https://www.freebsd.org/news/2026-ports-freeze/ports-reset.sh
$ cd /usr/ports
$ sh /tmp/ports-reset.sh
If the local ports tree doesn't affected (NOT including affected range of commits), the script would error out like below. But this doesn't need to worry. Just means the tree is sane.
This may be because the script is designed to be run only when local ports tree has all or parts of affected ranges of commits, not on sane tree.

Code:
# ports-reset.sh
fatal: ambiguous argument 'bb14266f00bb1bac62900477b93e5a7be984cd2f~2..HEAD': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'
#
 
Back
Top