Git revision searcher fails build from shallow clone

… that happened.

The repo is cloned via git clone github ... yacy/ --depth 1, to reduce download time and disk space, in case that matters.

Buildfile: /home/parnikkapore/Documents/progfiles/yacy/build.xml

clean:
   [delete] Deleting: /home/parnikkapore/Documents/progfiles/yacy/libbuild/GitRevTask.jar

buildGitRevTask:
    [javac] Compiling 1 source file
      [jar] Building jar: /home/parnikkapore/Documents/progfiles/yacy/libbuild/GitRevTask.jar

determineGitRevision:
   [gitRev] SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
   [gitRev] SLF4J: Defaulting to no-operation (NOP) logger implementation
   [gitRev] SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

BUILD FAILED
/home/parnikkapore/Documents/progfiles/yacy/build.xml:114: org.eclipse.jgit.errors.RevWalkException: Walk failure.
	at org.eclipse.jgit.revwalk.RevWalk.iterator(RevWalk.java:1324)
	at GitRevTask.execute(Unknown Source)
	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
	at jdk.internal.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
	at org.apache.tools.ant.Task.perform(Task.java:350)
	at org.apache.tools.ant.Target.execute(Target.java:449)
	at org.apache.tools.ant.Target.performTasks(Target.java:470)
	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1388)
	at org.apache.tools.ant.Project.executeTarget(Project.java:1361)
	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
	at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
	at org.apache.tools.ant.Main.runBuild(Main.java:834)
	at org.apache.tools.ant.Main.startAnt(Main.java:223)
	at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284)
	at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)
Caused by: org.eclipse.jgit.errors.MissingObjectException: Missing commit 3a46b07603c41a51750f0468b76666802d4b637e
	at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:159)
	at org.eclipse.jgit.revwalk.RevWalk.getCachedBytes(RevWalk.java:903)
	at org.eclipse.jgit.revwalk.RevCommit.parseHeaders(RevCommit.java:155)
	at org.eclipse.jgit.revwalk.PendingGenerator.next(PendingGenerator.java:147)
	at org.eclipse.jgit.revwalk.StartGenerator.next(StartGenerator.java:184)
	at org.eclipse.jgit.revwalk.RevWalk.next(RevWalk.java:435)
	at org.eclipse.jgit.revwalk.RevWalk.iterator(RevWalk.java:1322)
	... 17 more

Confirmed: the shallow clone is the reason the build failed. The whole repo took a GB, but some games are more than ten gigs I guess.

Also, building took 16 seconds. That’s very fast!

Is there a way to only download the current state of the repo and not older commits, while maintaining compatibility with the build tools? (I’m using git so I can pull delta updates when the time comes)