Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Git worktree support #44

Closed
delanym opened this issue Jan 16, 2023 · 5 comments
Closed

Git worktree support #44

delanym opened this issue Jan 16, 2023 · 5 comments
Labels
bug Something isn't working
Milestone

Comments

@delanym
Copy link

delanym commented Jan 16, 2023

The plugin fails to detect the repository when in a worktree:

git worktree add ../newworktree
mvn -f ../newworktree

Could not find or initialise a local git repository. A repository is required.

@rudikershaw
Copy link
Owner

Hi there,

I'm afraid I didn't even realise the git worktree feature existed until you raised this issue. I haven't had much time to work on the project recently, but I am hoping to find a big chunk of time soon to fix some issues and make some improvements.

I will take a look and see what I can work out. Would you be able to include a link to a minimal project that demonstrates the issue?

@rudikershaw rudikershaw added the bug Something isn't working label Jan 18, 2023
@delanym
Copy link
Author

delanym commented Jan 18, 2023

Just take your own project, create an alternative worktree, and try run the plugin (see updated command above)

@rudikershaw
Copy link
Owner

Looks like this is a bug in jgit (which we are using to run git commands in the plugin).

https://bugs.eclipse.org/bugs/show_bug.cgi?id=477475

It's been known about since 2015 and hasn't been fixed. Looks like jgit is not being pro-actively maintained. There is a fork with a fix, but it is not published. I think it is probably safest to assume that jgit will never create a fix, so I will look into alternatives.

@rudikershaw rudikershaw added this to the 3.4.0 milestone Mar 4, 2023
@rudikershaw
Copy link
Owner

I have released a fix in 3.4.0. You should be able to upgrade and you will be able to use worktrees without the error you were seeing.

The behaviour has been changed so that the configure goal will not attempt to apply configuration changes in a worktree. You should see a warning in your build output to that effect.

@rudikershaw
Copy link
Owner

Resolving this issue. Feel free to open a new issue if you have any further problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants