FS#67012 - [pacman] PKGBUILD handle git-lfs repository

Attached to Project: Pacman
Opened by bartus (bartus) - Tuesday, 16 June 2020, 00:00 GMT
Last edited by Allan McRae (Allan) - Tuesday, 16 June 2020, 00:25 GMT
Task Type Feature Request
Category makepkg
Status Unconfirmed
Assigned To No-one
Architecture All
Severity Medium
Priority Normal
Reported Version 5.2.1
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 3
Private No


I would like to point to an obscure case in which source array refers to `git-lfs` repository.
Currently we use `git clone --mirror` https://git.archlinux.org/pacman.git/tree/scripts/libmakepkg/source/git.sh.in#n51
to fetch content of the git repo, there should be one extra step afterwards: determine and pull git lfs objects.
I cant provide full implementation, but working rudimental sketch would look like this:
* https://github.com/bartoszek/pacman/pull/1/files
This task depends upon

Comment by Allan McRae (Allan) - Tuesday, 16 June 2020, 00:26 GMT
Your link does not work.
Comment by bartus (bartus) - Tuesday, 16 June 2020, 23:04 GMT
Comment by bartus (bartus) - Tuesday, 22 September 2020, 07:30 GMT
I would like to propose an extra "git-lfs+" vcs protocol for makepkg.

I've extracted `git-lfs` protocol form my AUR/openimagedenoise-{develop,git} packages and push it to AUR as `makepkg-git-lfs-proto`.
It adds `{download,extract}_git-lfs` functions which are wrappers for `{download,extract}-git` with additional `git lfs {init,fetch}` calls.
It works fine, but has to be installed before calling `makepkg` (`makepkg -s` won't work as `download_sources` is called before `handle_deps` installs `makepkg-git-lfs-proto`)
Moreover it requires including `git-lfs::git-lfs` in VCSCLIENTS array in `makepkg.conf`.

It would work better if was merged in to `pacman` (I've tried to push patch to `pacman-dev` but got rejected by pacman-dev-owner)

Regarding my investigate if it can be made transparent to package maintainers, by hiding `git lfs {init,fetch}` in `download_git` function.
It was confirmed by `git-lfs` devs that it can be easily determined if any refs has git-lfs object referenced, but this solution would require abusing VCSCLIENTS array by including two packages for git (VCSCLIENTS=('git::git','git::git-lfs'). Beside abusing VCSCLIENTS array, hidden implementation would also requires changes to `get_vcsclient` allowing it to return multiple executables, and changes to `executable_vsc` to allow examination of more than one vcs client binary presence.