GitSCMSource: No "@script" folder, Jenkinsfile fetched directly from Git without requiring a checkout
Well…not a “checkout” technically, but a naked clone. This is a caching layer implemented in GitSCMSource to work around the fact that the generic Git network protocol does not offer a way of retrieving an individual file revision; you need to fetch commits locally. (The Mercurial plugin does much the same thing.) The advantages over “heavyweight checkout” are that
- repositories consume less disk than working copies with repositories
- there is only cache repository for a given URL (the cache key computation is a little tricky here), rather than needing one per job
So BitbucketSCMSource could probably be improved merely by delegating this SCMFileSystem behavior to GitSCMSource.
But of course it could do a lot better still by using BitBucket APIs to retrieve blobs directly, as GitHubSCMSource does, avoiding the need for any clone on master (well GitHubSCMSource still has master-based clones for PR merges, pending
JENKINS-43194). This is not particularly hard to do in general, it just means implementing and testing some more APIs. See existing implementations.