Open DrVanScott opened 4 years ago
Or is this a jgit issue?
for this kind of thing jgitver delegates fully to jgit. Is that an issue with jgit or a lack of parameters/settings in the usage of jgit : it would require some trials/tests with jgit to have an idea.
How is the repository created ? Do you have a reproducer ?
I have tried to reproduce by cloning a local repository:
$ git clone https://github.com/jgitver/jgitver jgitver-local
$ git clone --reference jgitver-local https://github.com/jgitver/jgitver jgitver-with-reference
$ cd jgitver-with-reference
$ mvn validate
OpenJDK 64-Bit Server VM warning: Ignoring option MaxPermSize; support was removed in 8.0
[INFO] Using jgitver configuration file: C:\workspace\demos\jgitver-with-reference\.mvn\jgitver.config.xml
[INFO] Using jgitver-maven-plugin [1.5.1] (sha1: e45d1669b39cedb98720dd33cc14d0185b455ca1)
[INFO] version '0.12.1-SNAPSHOT' computed in 657 ms
[INFO]
[INFO] Scanning for projects...
[INFO] jgitver-maven-plugin is about to change project(s) version(s)
[INFO] fr.brouillard.oss::jgitver::0 -> 0.12.1-SNAPSHOT
[INFO]
[INFO] ---------------------< fr.brouillard.oss:jgitver >----------------------
[INFO] Building GIT versioning using jgit 0.12.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] --- license-maven-plugin:2.11:check (default) @ jgitver ---
[INFO] Checking licenses...
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.186 s
[INFO] Finished at: 2020-07-16T11:44:56+02:00
[INFO] ------------------------------------------------------------------------
But then jgitver works as expected inside jgitver-with-reference
.
Please provide a reproducer.
On GitHub actions, you may get a similar exception:
Caused by: org.eclipse.jgit.errors.MissingObjectException: Missing commit ....hash...
Error: -07T10:37:52.726+0000 [ERROR] [org.gradle.internal.buildevents.BuildExceptionReporter]
at org.eclipse.jgit.internal.storage.file.WindowCursor.open(WindowCursor.java:164)
This is because by default, GitHub's actions/checkout
only fetches a single commit. You need to configure your .github/workflows/.yml
to pull all history with fetch-depth: 0
:
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # for jgitver
Hi,
I use jgitver via mvn plugin in project witch is build in a docker container on CI (bamboo). The source code had been provided by bamboo doing git clone. When maven starts to run in the container, it fails with
The problem is, that Bamboo provides the clone using a mechanism called "referenced clone", see man git clone --referece:
Workaround: Use
git repack -a -d
to "unreference". Or try to mount the referenced git repository into the containerMaybe improve the error message? Some hints to clone --reference, or "path in .aitsrc/.git/objects/info/alternates does not exist"?
Or is this a jgit issue?
The Warning about "jgitver has changed!" is wrong in this situation...