[arch-general] Why no git --depth=1 option for makepkg?

Carsten Mattner carstenmattner at gmail.com
Sun Mar 4 20:27:49 UTC 2018


On 3/4/18, Eli Schwartz <eschwartz at archlinux.org> wrote:
> On 03/04/2018 10:58 AM, Carsten Mattner wrote:
>> At least for GitHub remotes, don't they still support checking out
>> with SVN? If they do, this would be faster and use less space, too,
>> when we just need a certain revision and no history at all.
>>
>> Other than that, I'm "pretty sure" that a git depth of 10 commits
>> will work for most repositories when you clone normally, not
>> shallow. Should also work for tags. However, it's true that git's
>> limited depth clone isn't implemented fully. There are many unhandled
>> cases and surprises.
>>
>> All that being said, I can report that in CI of personal and company
>> projects, I haven't yet run into problems with depth=5. It speeds up
>> checking out the tree, even when it's a fast local network remote.
>
> depth=1 is perfectly okay for most travis cases, as you don't need any
> history at all unless your build system looks for it... this is a
> bizarre comparison.
>
> The point, is that PKGBUILDs do look for history, and make use of it --
> figuring out clever ways to avoid pulling history is completely missing
> the point that we, well, want history.

Interesting. What does PKGBUILD do with history of more than 10 revisions?
If we checkout a tag or specific commit (e.g. xf86-video-intel), what
does PKGBUILD need prior revisions for? I'm sure you're correct, I'd
like to know what it is, if you don't mind explaining.

> depth=10 will only work for tags that are present in the last ten
> commits, which unsurprisingly is exactly the opposite of most projects
> (which don't have tags at all and therefore require all history without
> exception in order to implement the pkgver() function) or even most
> projects with tags (which don't release stable releases on basically
> every other commit).

Eli, you certainly have more experience, so I'm trusting your word here.
However, I don't understand how depth=10 can fail when trying to checkout
a specific git tag. Wouldn't the tag be the HEAD in that case?


Checking out with SVN is a speedup trick, and I still think it can make
sense if depth limiting git clone is not possible. svn checkout is
basically just copying the tree of that revision (or branch/tag path)
specified.


More information about the arch-general mailing list