Skip to content

checkout correct branch in case of GITFLAGS are present

solo turn requested to merge soloturn/pacman:filter-blob-none into master

passing GITFLAGS is desired to speed up clone when making packages. possible flags are --filter=tree:0 or --depth=1. makepkg makes a partial or shallow clone subsequently,which in some cases fail, especially the update case. so make sure the desired branch/tag specified in PKGBUILD is checked out in those cases.

when doing the default mirroring, this is not necessary, as all branches are on local disk.

tested with llvm-git, linux-mainline, swift-language-git, swift-language along the following lines:

git clone ssh://aur@aur.archlinux.org/llvm-git
cd llvm-git
GITFLAGS="--filter=tree:0" makepkg
# wait a while until remote repo got new commits
GITFLAGS="--filter=tree:0" makepkg
# or, to debug
GITFLAGS="--filter=tree:0" bash -x makepkg
git clone ssh://aur@aur.archlinux.org/llvm-git
cd llvm-git
GITFLAGS="--depth=1" makepkg
# wait a while until remote repo got new commits
GITFLAGS="--depth=1" makepkg
git clone ssh://aur@aur.archlinux.org/llvm-git
cd llvm-git
makepkg
# wait a while until remote repo got new commits
makepkg
sudo cp scripts/libmakepkg/source/git.sh.in /usr/share/makepkg/source/git.sh
paru -S llvm-git
Edited by solo turn

Merge request reports