Hyperfoil / qDup

Lab automation and queuing scripting
Apache License 2.0
12 stars 12 forks source link

git-commit-id-plugin plugin causes error when git worktree feature is used. #200

Closed whitingjr closed 11 months ago

whitingjr commented 1 year ago

Using Git Worktree feature is useful to juggle multiple branches and tags.

However the path for all the Git metadata and directories is not always present. When working in a worktree path. For example a mvn package goal will fail due to the git-commit-id-plugin throwing an error.

[ERROR] Failed to execute goal pl.project13.maven:git-commit-id-plugin:3.0.0:revision (get-the-git-infos) on project qDup: Could not complete Mojo execution...: Error: Missing unknown 1fc7ef9fc818e5a6edff7a1b059375ce8a9c3ac7 -> [Help 1]

willr3 commented 1 year ago

We use this to embed the commit hash in the java code. Is there a different way to capture the git hash?

whitingjr commented 11 months ago

by creating the worktree in the folder worktrees allows the worktree branch to work as expected with Git.