FreshPorts / freshports

The website part of FreshPorts
http://www.freshports.org/
BSD 2-Clause "Simplified" License
68 stars 24 forks source link

move 'last commit processes' from repo to file #522

Open dlangille opened 8 months ago

dlangille commented 8 months ago

During commit processing, FreshPorts records the last commit it grabbed from a given repo. It uses this as a starting point when processing starts again.

This reference was once stored in a file. Then it was moved into the repo. I want to move it to a file again.

Reasoning:

See LATEST_FILE used in https://news.freshports.org/2020/11/22/git-commit-processing-how-is-it-done/

See refname in https://github.com/FreshPorts/git_proc_commit/blob/master/git-to-freshports/git-delta.sh

dlangille commented 8 months ago

NOTE: this feature is only used on the repos used by the ingress user (at ~ingress/repos/) and not on the repo used by the freshports user (at /jails/freshports/usr/ports).

This came to light when refreshing a jail from FreeBSD 13.2 to FreeBSD 14 (see #521) - the existing repo (at /usr/ports) could merely be copied over into the new jail. I think it's much easier to set up a new jail, completely independent of an existing jail, then copy over the required data. I know that sounds like the same thing, but I'm not completely sold on retaining important FreshPorts data within the FreeBSD repo.

However, backing up the FreshPorts data within a repo should be easy. Pull the values out, save them to a file, backup the file.

Something like this:

[13:52 dev-ingress01 dan ~ingress/repos/ports] % echo /usr/local/bin/git rev-parse -q --verify freshports/origin/main^{} | sudo su -fm ingress     
581c7caa3b1bbdeb0267642105eea875b4928c94

For every branch.

dlangille commented 8 months ago

A new script has been written which dumps the required data:

https://github.com/FreshPorts/git_proc_commit/blob/master/git-to-freshports/git-last-processed-tags.sh

With that information backed up: