I am testing a new port written by Palle Girgensohn (https://github.com/girgen). He sent me the link https://github.com/girgen/freebsd-ports/tree/master/sysutils/filebeat to test.
I’ve never done this before, so I started thinking of how I might do so.
https://github.com/girgen/freebsd-ports being a fork of https://github.com/freebsd/freebsd-ports which in turn appears to be the mainline FreeBSD ports tree, I thought it would be possible to just get sysutils/filebeat into my own mainline ports tree (which I maintain with portsnap). So, combining my svn knowledge and git ignorance, I tried this:
root@travis:/usr/ports/sysutils # git clone https://github.com/girgen/freebsd-ports/tree/master/sysutils/filebeat filebeat Cloning into 'filebeat'... fatal: repository 'https://github.com/girgen/freebsd-ports/tree/master/sysutils/filebeat/' not found
A bit of searching tells me I can’t simply do a subtree clone or checkout. I decided to do this:
root@travis:~ # mv /usr/ports /usr/ports.bak root@travis:~ # git clone https://github.com/girgen/freebsd-ports /usr/ports
This worked, but (unsurprisingly) took a long time. I could then test the new port with the usual commands:
root@travis:~ # make -C /usr/ports/sysutils/filebeat install
So, I’ve achieved my short term goal, but it has left me wondering – how do other people do this? People who regularly test new ports or similar activity on anything other than the mainline ports tree surely have more streamlined practices. Somewhat complicated git commands to do a ‘sparse checkout’? Is it normal practice that Palle Girgensohn provided me a fork of the entire ports tree? I could ask him to do it differently. Hmm, I wonder if I could fork a subset of his fork, and then clone my entire ‘subfork’.