22.01 / 2.6 - gitsync, pulling patches, knowing if a patch is installed etc.
-
I've been out of the loop for a bit and trying to get back on the development edge. I used to use gitsync to sync up with recent commits between releases. When I looked at the code in
/etc/phpshellsessions/gitsync
from my up-to-date 22.01.a.20211128.0600 test box, it seems possibly out of date - example, it still references 21.09, not 22.01. So I wasn't sure it was "safe" to run.E.g I wanted to check if a recent fix from vktg (
332052b
) had already been pulled in... is there any way to do that from the shell?I ended up just installing System Patches, putting the commit hash in there and hitting Test, but that seems a bit convoluted and I'm guessing there's a better way to do it (from the console) ?
-
@luckman212 said in 22.01 / 2.6 - gitsync, pulling patches, knowing if a patch is installed etc.:
I've been out of the loop for a bit and trying to get back on the development edge. I used to use gitsync to sync up with recent commits between releases. When I looked at the code in
/etc/phpshellsessions/gitsync
from my up-to-date 22.01.a.20211128.0600 test box, it seems possibly out of date - example, it still references 21.09, not 22.01. So I wasn't sure it was "safe" to run.Plus can't properly gitsync since the code repository isn't public. That's something we do hope to solve eventually, but it's not a priority.
E.g I wanted to check if a recent fix from vktg (
332052b
) had already been pulled in... is there any way to do that from the shell?You could fetch the diff manually and check the files with something like
patch
and its dry run option and then check the output, that's what the system patches GUI package does.I ended up just installing System Patches, putting the commit hash in there and hitting Test, but that seems a bit convoluted and I'm guessing there's a better way to do it (from the console) ?
That's really the best way to do it in an automated fashion.
-
@jimp Ok thanks for the confirmation. Makes sense that gitsync won't work with a private repo. Bit of a shame but at least I understand now.
-
I made a simple script to check if patches are applicable from the console. It's completely non-destructive (checks only).
GitHub gist: ptest.sh
Get
- save to your box with
fetch -o /root/ptest.sh https://gist.githubusercontent.com/luckman212/f58329c5c0e98d38154bcab910783f30/raw/48b82380572fb70de314bb463c279457077506c4/ptest.sh
- make executable:
chmod +x /root/ptest.sh
Run
./ptest.sh [-r] <commit-hash>
Sample output
[22.01-DEVELOPMENT][root@pfSense.home.arpa]/root: ./ptest 332052b8bd2a5d35662be2dba773b7a9f0d50681 commit: https://github.com/pfsense/pfsense/commit/332052b8bd2a5d35662be2dba773b7a9f0d50681 subject: Static routes handling update. Fixes #11599 #11895 #7547 result: patch CAN be cleanly applied
- save to your box with