-
Notifications
You must be signed in to change notification settings - Fork 301
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
Support of git worktree option (for JGIT) #215
Comments
Hi, Recently started discussion on eclipse about the "worktree" Also it should be worth quoting from here https://github.com/blog/2042-git-2-5-including-multiple-worktrees-and-triangular-workflows:
Is it still experimental? if so we still have a bit time to implement ;-) |
@qboileau @TheSnoozer Now it is 2017 and git comes to version 2.12.x, but I am still having issue with git-commit-id-plugin:2.2.2, that when I tried to build a maven project under a git worktree, it gave me:
Could you help me please? |
Would be happy to have this in this plugin as well, but as outlined its a JGit issue (a library we use inside the plugin). If the library doesn't support it, this plugin doesn't support it either. The Bug 7 Enhancement request for JGit (https://bugs.eclipse.org/bugs/show_bug.cgi?id=477475) is still open and thus it is not available afaik. |
Note: This feature will prop break java jdk 1.7 support. With jgit v4.6 the build was moved towards 1.8 only (https://bugs.eclipse.org/bugs/show_bug.cgi?id=500059) |
Well sometimes third party libs takes ages...the bug /enhancement request for JGit (https://bugs.eclipse.org/bugs/show_bug.cgi?id=477475) is still open and thus it is not available for jgit...just saying if it isn't obvious....the native git-implementation ( |
@TheSnoozer That's sad... But on the other hand I can at least skip execution of this plugin from now on when I am on a git worktree since Added property to skip from CLI is released in 2.2.3. |
@athrunsun agree this is kinda annoying... In a nutshell you can't skip by command-line when the property is configured as plugin configuration (a maven bug). The workaround that even was suggested by the maven team is outlined in #315 (comment) |
@TheSnoozer That sounds really great, thanks for the fix! Looking forward to 2.2.4 release. |
FWIW, I still get the error with 2.2.4:
Or am doing sth. wrong? The workaround with adding |
Well this issue that is reported here is still open and the corresponding changes about git worktree are still not merged into jgit. So if you are using git worktree I'd suggest to follow #215 (comment) If you don't use git worktree, check if you have any commits in your repo (thats at least what the error says). |
Thanks for the reply -- I got confused about the "Closed" message above, which references another issue; sorry about that. I do have commits in the repo; I guess jgit gets confused that |
There is finally some progress on the JGit side on this issue (https://bugs.eclipse.org/bugs/show_bug.cgi?id=477475). The native git-implementation ( |
2019 and it looks like JGit finally supports read-operations on worktrees, which might be enough to fix this issue, since we don't want to create/modify/delete worktrees here? |
Maybe I'm missing something, but the changes are not merged?!? At least the linked change-set (e.g. https://git.eclipse.org/r/#/c/126440/, https://git.eclipse.org/r/#/c/126454/ or https://git.eclipse.org/r/#/c/67873/ are labeled as |
You are right. I was just reading the linked issue, but did not check the actual code/patches. |
Yeah...thanks for reminding me on this issue, but sadly it seems there is no progress on the JGit-side....the native git-implementation ( |
Hey folks, are there any news on this issue? The Eclipse Package contains org.eclipse.jgit 5.8.0.202006012134 Cheers, |
Hi, I know there is also an unofficial build linked in the discussion you mentioned, however I'd rather have some official support over some random binary shared via dropbox. Perhaps I'm missing a link? |
Hi, in regard to your question:
No, but maybe we could check the source he attached and build a „unofficial test Version“ as well in order to see if it works for us. Andre Bossert wrote:
Thanks in advance, |
Ah thanks for the clarifications on your observation! Technically we potentially could assemble our own JGit version with the support of worktrees, however I feel I'm not the maintainer or a contributor to jGit. This plugin (or me in the case) are "simply" users. What happens if such support doesn't work accurate? Then I'm forced to keep monkey-patching a release and integrate whatever JGit changes come in. From the perspective of the plugin user's still can work when using All together I'd prefer to wait until the changes are integrated officially. |
Understood, thanks for clarifying 👍 |
For the record (and folks who hit this via an Internet search), version 4.0.3 of this plugin still has challenges with "worktree". Not sure about 4.0.4 (the latest release as of this comment) |
FWIW, https://git.eclipse.org/r/c/jgit/jgit/+/163940/ (upstream jgit gerrit review) still exists, last activity there is from mid-December 2020; that patch has a merge conflict. I am not surprised then that version 4.0.4 of this plugin remains unhappy about worktrees; I suppose the workaround mentioned above - |
Hi, thanks for the update. Indeed if JGit doesn't support worktrees the plugin will sadly will not suddenly work with JGit. The workaround by using the native git implementation (via |
Interestingly, the JGit change to correctly solve this issue https://bugs.eclipse.org/bugs/show_bug.cgi?id=477475 has 85 votes, the highest JGit one at the moment by nearly three times, with the next highest at 29 votes. While the entry is 6 years old, there are promising comments this year (June, October) on implementation movement. |
This is a workaround for inability to build Trino in a git worktree. This is a long-standing issue in the plugin, see git-commit-id/git-commit-id-maven-plugin#215.
This is a workaround for inability to build Trino in a git worktree. This is a long-standing issue in the plugin, see git-commit-id/git-commit-id-maven-plugin#215.
…rktrees (#1285) ### Motivation You cannot use git worktrees in KOP development. ### Modifications see git-commit-id/git-commit-id-maven-plugin#215
…rktrees (#1285) ### Motivation You cannot use git worktrees in KOP development. ### Modifications see git-commit-id/git-commit-id-maven-plugin#215 (cherry picked from commit dbea538)
…rktrees (#1285) ### Motivation You cannot use git worktrees in KOP development. ### Modifications see git-commit-id/git-commit-id-maven-plugin#215 (cherry picked from commit dbea538)
…rktrees (#1285) ### Motivation You cannot use git worktrees in KOP development. ### Modifications see git-commit-id/git-commit-id-maven-plugin#215 (cherry picked from commit dbea538)
…rktrees (#1285) ### Motivation You cannot use git worktrees in KOP development. ### Modifications see git-commit-id/git-commit-id-maven-plugin#215 (cherry picked from commit dbea538)
…rktrees (#1285) ### Motivation You cannot use git worktrees in KOP development. ### Modifications see git-commit-id/git-commit-id-maven-plugin#215 (cherry picked from commit dbea538) (cherry picked from commit e9d4e20)
Does this help anyone out?Set Workaround: Command Line
Workaround: pom.xml
Tested with:
|
yes, it works for me, albeit I am using the following clone/fork with this setting: <build>
<plugins>
<plugin>
<groupId>pl.project13.maven</groupId>
<artifactId>git-commit-id-plugin</artifactId>
[...]
<configuration>
<useNativeGit>true</useNativeGit>
[...]
</configuration>
</plugin>
</plugins> Cheers,
|
Not sure if any of the initial reporters still monitors this discussion...but JGIT seems to have finally added (read) support for git worktrees.
Using the native git is still an option and I certainly haven't run any tests whatsoever... |
Hi, since git 2.5.0 worktree option allow to create many working tree linked to a single repository.
Building a linked working tree using git-commit-id-plugin mojo failed because current git reference can't be retrieve. Seems to be JGit issue, but I think it's useful to report here first.
Build exception :
The text was updated successfully, but these errors were encountered: