git-changelog-lib icon indicating copy to clipboard operation
git-changelog-lib copied to clipboard

git worktrees seem to break this lib

Open jeacott1 opened this issue 3 years ago • 2 comments
trafficstars

running from a git worktree

echo $(npx git-changelog-command-line --print-next-version)

Exception in thread "main" shadow.se.bjurr.gitchangelog.api.exceptions.GitChangelogRepositoryException: main not found in: Repo: Repository[C:\app\test\ideatest\xx.git\worktrees\xx]

    at shadow.se.bjurr.gitchangelog.internal.git.GitRepo.getRef(GitRepo.java:139)
    at shadow.se.bjurr.gitchangelog.api.GitChangelogApi.getId(GitChangelogApi.java:678)
    at shadow.se.bjurr.gitchangelog.api.GitChangelogApi.getChangelog(GitChangelogApi.java:624)
    at shadow.se.bjurr.gitchangelog.api.GitChangelogApi.getChangelog(GitChangelogApi.java:85)
    at shadow.se.bjurr.gitchangelog.api.GitChangelogApi.getHighestSemanticVersion(GitChangelogApi.java:200)
    at se.bjurr.gitchangelog.main.Main.main(Main.java:748)

jeacott1 avatar Jun 17 '22 06:06 jeacott1

Are you sure there is not more stacktrace? I never tried worktree. Not really sure how one would want the library to work with it.

tomasbjerre avatar Jun 19 '22 09:06 tomasbjerre

@tomasbjerre no more stacktrace - this is it. To be clear, I'm not asking you to add some functionality to your lib, I'm just asking that it doesnt break if a worktree is in use. I use worktrees a lot for local dev, but just the fact that they are active breaks your lib. give this a try. choose any git repo, create a worktree, and then try your lib in any of the folders. unfortunately this looks like a jgit limitation that has not yet officially been resolved. https://bugs.eclipse.org/bugs/show_bug.cgi?id=477475

jeacott1 avatar Jun 19 '22 23:06 jeacott1