eclipse-jgit / jgit

JGit, the Java implementation of git
https://www.eclipse.org/jgit/
Other
92 stars 31 forks source link

Add support for blobless clones #26

Open henryju opened 4 months ago

henryju commented 4 months ago

Description

Blobless clones are a suggested optimization to clone large repositories. git clone --filter=blob:none <url>

The native Git CLI will lazy load blobs on-demand, but JGit simply fails:

$ ./org.eclipse.jgit.pgm-6.8.0.202311291450-r.sh blame build.gradle 
fatal: Missing blob fc321990ffac88fc65d90d41c483db443833aa93

Motivation

I am not sure this is a popular practice to use blobless clones on developer machines, so this is likely not a use case for EGit. But for other use cases where JGit is used on CI/CD platforms (Jenkins, Maven, Sonar, ...) it would be great to support this feature.

Alternatives considered

The current alternative is to ask users to not use blobless clones, or to stop using JGit and use the native Git CLI.

Additional context

https://community.sonarsource.com/t/missing-blob-jgit-error-with-sonarcloud/109574 https://community.sonarsource.com/t/scan-on-git-blobless-clone-failed/106038

brettjohnsen-sy commented 4 months ago

We are noticing these issues in our Projects using CircleCI and SonarCloud. We would greatly appreciate support for this in the future without workarounds 👍