ports and git, first steps

Ulrich Spörlein uqs at freebsd.org
Thu Mar 4 20:39:10 UTC 2021

On Thu, 2021-03-04 at 14:46:13 +0100, Michael Grimm wrote:
>Ulrich Spörlein <uqs at FreeBSD.org> wrote:
>> On Wed, 2021-03-03 at 16:10:15 +0100, Michael Grimm wrote:
>>> Does anyone know if poudriere is using 'git pull —rebase' as default?
>> It's just a bunch of shell scripts, so easy to check:
>> % git grep GIT_CMD
>> src/share/poudriere/common.sh:: ${GIT_CMD:=git}
>> src/share/poudriere/jail.sh:                    ${GIT_CMD} clone ${GIT_DEPTH} -q -b ${VERSION} ${GIT_FULLURL} ${SRC_BASE} || err 1 " fail"
>> src/share/poudriere/jail.sh:                    ${GIT_CMD} -C ${SRC_BASE} pull --rebase -q || err 1 " fail"
>> src/share/poudriere/jail.sh:                            ${GIT_CMD} checkout -q "${TORELEASE}" || err 1 " fail"
>> src/share/poudriere/jail.sh:            git_sha=$(${GIT_CMD} -C ${SRC_BASE} rev-parse --short HEAD)
>> src/share/poudriere/ports.sh:                   ${GIT_CMD} clone --depth=1 --single-branch ${quiet} -b ${BRANCH} ${GIT_FULLURL} ${PTMNT} || err 1 " fail"
>> src/share/poudriere/ports.sh:           ${GIT_CMD} -C ${PORTSMNT:-${PTMNT}} pull --rebase ${quiet}
>Sorry for the noise, I should have find out by myself :-(
>> Besides, `git pull --rebase` is pretty much the only sane choice for poudriere anyway.
>Good to know. Now, all I need to modify is the git repository's server name after the final migration.

Yes and no. It defaults to using the Github mirror and we will 
force-push the new content there, but `git pull --rebase` will totally 
barf on that, so you'll need to manually:

- git fetch --prune
- git checkout -B main origin/main
- git branch -D master

or something like that. (you need to rebase your stuff from old-master 
to new-main as well).

We could actually bake this logic into poudriere and have it do its 
thing during a ports update, but it'll be rather fragile I suppose.


More information about the freebsd-git mailing list