Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

jgit upgrade to support git worktree#12910

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
mkurz wants to merge3 commits intoplayframework:main
base:main
Choose a base branch
Loading
frommkurz:jgit-upgrade_support_git-worktree

Conversation

mkurz
Copy link
Member

The comment in the diff explains everything.

See

Personally I make use of git worktree, I checked out the 3.0.x and and 2.9.x in separate folders. Until now I had to make a workaround by settingThisBuild / com.github.sbt.git.SbtGit.GitKeys.gitUncommittedChanges := false otherwise sbt wont start up the project and you run into following exception:

Exception with jgit 5 (and 6) (click to expand)
$ sbt[info] welcome to sbt 1.10.2 (Eclipse Adoptium Java 17.0.12)[info] loading global plugins from /home/mkurz/.sbt/1.0/plugins...org.eclipse.jgit.errors.NoWorkTreeException: Bare Repository has neither a working tree, nor an index        at org.eclipse.jgit.lib.Repository.getWorkTree(Repository.java:1570)        at org.eclipse.jgit.treewalk.FileTreeIterator.<init>(FileTreeIterator.java:87)        at org.eclipse.jgit.treewalk.FileTreeIterator.<init>(FileTreeIterator.java:73)        at org.eclipse.jgit.api.StatusCommand.call(StatusCommand.java:113)        at com.github.sbt.git.JGit.hasUncommittedChanges(JGit.scala:94)        at com.github.sbt.git.SbtGit$.$anonfun$buildSettings$22(GitPlugin.scala:126)        at com.github.sbt.git.SbtGit$.$anonfun$buildSettings$22$adapted(GitPlugin.scala:126)        at com.github.sbt.git.DefaultReadableGit.withGit(ReadableGit.scala:44)        at com.github.sbt.git.SbtGit$.$anonfun$buildSettings$21(GitPlugin.scala:126)        at com.github.sbt.git.SbtGit$.$anonfun$buildSettings$21$adapted(GitPlugin.scala:126)        at scala.Function1.$anonfun$compose$1(Function1.scala:49)        at sbt.internal.util.EvaluateSettings$MixedNode.evaluate0(INode.scala:229)        at sbt.internal.util.EvaluateSettings$INode.evaluate(INode.scala:171)        at sbt.internal.util.EvaluateSettings.$anonfun$submitEvaluate$1(INode.scala:88)        at sbt.internal.util.EvaluateSettings.sbt$internal$util$EvaluateSettings$$run0(INode.scala:100)        at sbt.internal.util.EvaluateSettings$$anon$3.run(INode.scala:95)        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)        at java.base/java.lang.Thread.run(Thread.java:840)[error] org.eclipse.jgit.errors.NoWorkTreeException: Bare Repository has neither a working tree, nor an index[error] Use 'last' for the full log.

sbt-git introduced a setting (useReadableConsoleGit) to avoid using jgit and fall back to command line git:

Also they want to soon detect if a project is checked out in a linked worktree or not and only disable jgit if you are:

However, if we just ugprade to jgit 7+ we can avoid all of that because it supports git worktree out of the box.
One of those small things that makes development just smoother out of the box...

@@ -0,0 +1 @@
addDependencyTreePlugin
Copy link
MemberAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Ah yeah I added this so I can rundependencyBrowseTreeHTML in the meta-build. IMHO adding it to the meta-build does not hurt.

@mkurzmkurzforce-pushed thejgit-upgrade_support_git-worktree branch from3c079d4 toc6cb97bCompareOctober 16, 2024 13:29
@mkurz
Copy link
MemberAuthor

Waiting for a reply in

to see if we need to set

ThisBuild/ com.github.sbt.git.SbtGit.GitKeys.useConsoleForROGit:=false

inbuild.sbt

@mkurzmkurzforce-pushed thejgit-upgrade_support_git-worktree branch fromc6cb97b to25556a9CompareOctober 25, 2024 07:03
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

1 participant
@mkurz

[8]ページ先頭

©2009-2025 Movatter.jp