alexlarsson/xdg-app

Allow xdg-app-builder to shallow clone git repos

Closed this issue · 5 comments

hbons commented

Git repos can be huge, and when building you may not be interested in the full history.
Maybe a property in the json file (or even changing the default) to allow shallow cloning would save a lot of time and bandwidth.

Hmm, I can see how this could be useful. But its also somewhat tricky. For the initial pull things are fine, but on an update the depth is stored, so the new pull will drop all local history other than the new head of the branch you pulled.

If you're only pulling a repo once this is not really a problem. However, with xdg-app you can have a single download cache shared by multiple json files, or the same json file can refer to the same git repo (either directly or via submodules) which could be problematic if those refered to different branches (or direct commit ids).

I wish there was a way to do an initial shallow clone, but then allow further pulls to just get all changes between your current commit and the new HEAD.

hbons commented

I think recent Git releases fixed this. You can do a shallow clone and then pull whatever else you need later.

There was some kind of fix, but I don't think it does quite what we want here anyway.

hbons commented

Shallow clones are the default setting in SparkleShare and it works great, so it might be worth looking into. :)

This issue was moved to flatpak/flatpak#15