axion-release-plugin icon indicating copy to clipboard operation
axion-release-plugin copied to clipboard

Plugin issues with Git worktrees

Open zyxist opened this issue 3 years ago • 2 comments

I would like to use Git worktrees to work on two tasks in parallel (e.g. one worktree for my primary work, second worktree for emergency fixes). Unfortunately there are a couple of issues with Axion Release Plugin, when working in this way:

  1. in the second worktree, the plugin does not recognize that it is in a Git repository. It looks like it only checks for the presence of .git directory, but it is insufficient. It should also check registered worktrees.
  2. once it does not find .git directory, it tries to check other options and it crashes upon encountering config directory (it expects the file)

Point 2 is also not valid. If the plugin notices config directory while expecting a file, it should silently skip it instead of crashing. Many tools use config directory (Checkstyle, PMD to mention some) and in my case, they auto-generate the basic configuration every time I launch Gradle, and I need to remove this directory manually over and over again just to make it work.

Example output:

Build file '/path/to/my/project/build.gradle.kts' line: 87

java.io.FileNotFoundException: /path/to/my/project/config (Is a directory)
> /path/to/my/project/config (Is a directory)

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

zyxist avatar Dec 20 '21 13:12 zyxist

hi, seems fair to detect registered worktrees, care to make a PR? :)

bgalek avatar Jan 05 '22 15:01 bgalek