
On 02/10/2021 11.08, Jan Engelhardt wrote:
On Saturday 2021-10-02 10:12, Bernhard M. Wiedemann wrote:
wouldn't it be nice, if we could have packages in OBS without tarballs, with a reference to an upstream git repo and commit id? It would still need a git clone --depth 1 in OBS, to ensure that we can build even if the original git server/commit vanishes.
``--depth 1`` mandates that the vanishing project has correctly made a git tag (or at least, a branch head) for every release. There is bound to be someone who messes that up too, so on the OBS side, there will need to be a way to use the implied default of infinite depth.
It turns out, it is possible to shallow-clone a commit-id since git 2.5 Found out via https://stackoverflow.com/questions/31278902/how-to-shallow-clone-a-specific... My test shows that it works with github: git init git remote add origin https://github.com/bmwiedemann/openSUSE.git git fetch --depth 1 origin e07bd24453d6bcdeb0b7d0ae2ab2ec5edc9282b4 git checkout FETCH_HEAD du -s .git 227676 .git and then we can tag it with release-numbers on our side to prevent garbage-collection and as a pointer to the releases using that commit-id. Ciao Bernhard M.