nebula-plugins / nebula-release-plugin

Release opinions based around gradle-git
Apache License 2.0
220 stars 56 forks source link

Support worktree out of the box #241

Closed jonatan-ivanov closed 10 months ago

jonatan-ivanov commented 12 months ago

The info plugin can work in case of a worktree is used. Can we make this plugin work even if it is checked out into a worktree? Setting the git.root property is an ok workaround but can we make this work out of the box? For example:

  1. Use the value of git.root if present
  2. Use the value of git rev-parse --path-format=absolute --git-common-dir if present
  3. Use the value project.rootProject.projectDir if nothing else present

Here: https://github.com/nebula-plugins/nebula-release-plugin/blob/bdea694a10d7256ecb6fd6f01ded66905801c192/src/main/groovy/nebula/plugin/release/ReleasePlugin.groovy#L78

jonatan-ivanov commented 10 months ago

Since https://github.com/nebula-plugins/nebula-release-plugin/pull/243 removed jgit/grgit and the plugin uses the git executable now, this works out of the box since unlike jgit, the git cli can handle git worktrees.

This is available starting from 18.0.0.

Thank you @rpalcolea!