eclipse-jgit / jgit

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

[WARNING] unknown commit-graph chunk: 0x47444132 #12

Open TheSnoozer opened 8 months ago

TheSnoozer commented 8 months ago

Version

6.7.0.202309050840-r

Operating System

MacOS

Bug description

When running the git-commit-id-maven-plugin (which uses jgit under the hood) a warning about unknown commit-graph chunk is reported.

This warning seems to only be reproducible under mac using a

Apache Maven 3.9.6 (bc0240f3c744dd6b6ec2920b3cd08dcc295161ae)
Maven home: /Users/khm/tools/maven
Java version: 21.0.1, vendor: Oracle Corporation, runtime: /Users/khm/.sdkman/candidates/java/21.0.1-open
Default locale: en_DE, platform encoding: UTF-8
OS name: "mac os x", version: "14.0", arch: "aarch64", family: "mac"

The message templates are defined in:

org.eclipse.jgit/resources/org/eclipse/jgit/internal/JGitText.properties:commitGraphChunkUnknown=unknown commit-graph chunk: 0x{0}

and the error observed comes from: https://github.com/eclipse-jgit/jgit/blob/b1cc74b75b771279d81de15833da514c71513648/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/commitgraph/CommitGraphLoader.java#L194-L196.

Actual behavior

When running jgit a warning about an unknown commit-graph chunk is reported:

[INFO] --- git-commit-id:7.0.0:revision (default) @ tree ---
[WARNING] unknown commit-graph chunk: 0x47444132
[WARNING] unknown commit-graph chunk: 0x47444132
[WARNING] unknown commit-graph chunk: 0x47444132
[WARNING] unknown commit-graph chunk: 0x47444132

Expected behavior

No warning.

Relevant log output

No response

Other information

To reproduce checkout the branch https://github.com/khmarbaise/maven-it-extension/tree/git-commit-id-maven-plugin-issue-687 and run mvn clean verify.

Can be reproduced using:

Can not be reproduced under linux and the same repository/branch/commit.

original bug-report: https://github.com/git-commit-id/git-commit-id-maven-plugin/issues/687

TheSnoozer commented 8 months ago

I found more context on this.

Jgit's constants are defined here:

https://github.com/eclipse-jgit/jgit/blob/b1cc74b75b771279d81de15833da514c71513648/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/commitgraph/CommitGraphConstants.java#L18-L30

This 0x47444132 seems to come from https://github.com/git/git/blob/a26002b62827b89a19b1084bd75d9371d565d03c/commit-graph.c#L48-L49 and is simply not listed as magic value in jgit.

It was introduced with this change: https://github.com/git/git/commit/6dbf4b8172ef9edd50bdf9ca2da4681ba9153f75

I found the relevant references on this discussion

msohn commented 6 days ago

there is a stale change 203182 in review adding support for writing generation numbers

ifradeo commented 5 days ago

That chunk is for GDA2 (generation numbers v2). JGit doesn't support that yet. When the parser finds an unknown chunk, it just logs it and ignores that chunk.

If this bug is about the warning log, we can close it as "working as intended". The actual feature request is "support generation number v2" in jgit.