Skip to content

Remove totally unnecessary transitive sbt-git dependency (!) - #471

Merged
eed3si9n merged 1 commit into
sbt:mainfrom
mkurz:remove-transitive-sbt-git
Jul 6, 2026
Merged

Remove totally unnecessary transitive sbt-git dependency (!)#471
eed3si9n merged 1 commit into
sbt:mainfrom
mkurz:remove-transitive-sbt-git

Conversation

@mkurz

@mkurz mkurz commented Jul 6, 2026

Copy link
Copy Markdown
Member

sbt-ci-release no longer uses sbt-git APIs directly. The scmInfo fallback shells out to git ls-remote --get-url origin, and versioning continues to come from sbt-dynver (which does NOT use sbt-git).

This also removes sbt-git from the local meta-build and updates the README so users are not told that sbt-git is brought in transitively.

Note

Just having sbt-git on the classpath causes all those issues listed in sbt/sbt-git#382 when people are inside a linked worktree. Just having sbt-git on the plugin classpath is enough to activate its settings. Then its build settings evaluate Git metadata, including ThisBuild / gitUncommittedChanges := gitReader.value.withGit(_.hasUncommittedChanges)
With current released sbt-git/JGit 5, that read path uses JGit by default. In a linked worktree, JGit 5 cannot resolve the worktree correctly and throws: NoWorkTreeException: Bare Repository has neither a working tree, nor an index
So the chain is:
sbt-ci-release depends on sbt-git
-> sbt-git is on plugin classpath
-> GitPlugin auto-enables
-> gitUncommittedChanges gets evaluated during setting loading
-> JGit 5 status fails in linked worktree

sbt-ci-release no longer uses sbt-git APIs. scmInfo is
populated by shelling out to git directly, while versioning
continues to come from sbt-dynver.

Drop sbt-git from the published plugin dependency set and from
the local meta-build. Update the README so users are not told
that sbt-git is brought in transitively.

Verified with:
- sbt +test
- sbt scalafmtSbtCheck +scalafmtCheckAll
- sbt plugin/makePom
@mkurz

mkurz commented Jul 6, 2026

Copy link
Copy Markdown
Member Author

@eed3si9n If you could also tag a new release, that would be awesome, because that would solve many people's linked worktree problems (as sbt-dynver does not use sbt-git but shells out to the git command anyway)

@eed3si9n eed3si9n left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks!

@eed3si9n
eed3si9n merged commit 2c5666e into sbt:main Jul 6, 2026
3 checks passed
@mkurz
mkurz deleted the remove-transitive-sbt-git branch July 6, 2026 22:02
@eed3si9n

eed3si9n commented Jul 6, 2026

Copy link
Copy Markdown
Member

Done - https://github.com/sbt/sbt-ci-release/releases/tag/v1.12.0

@mkurz

mkurz commented Jul 6, 2026

Copy link
Copy Markdown
Member Author

Thanks!

@SethTisue

Copy link
Copy Markdown
Member

Excellent catch!!

jigarkhwar added a commit to galax-io/gatling-jdbc-plugin that referenced this pull request Jul 12, 2026
sbt-ci-release 1.12.0 removed its bundled sbt-git dependency (sbt/sbt-ci-release#471), so GitVersioning used in build.sbt no longer resolves and project load fails (CI: 'not found: value GitVersioning'). Restore sbt-git 2.1.0 explicitly.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
jigarkhwar added a commit to galax-io/sbt-schema-registry-plugin that referenced this pull request Jul 19, 2026
sbt-ci-release 1.12.0 no longer pulls in sbt-git (sbt/sbt-ci-release#471),
but publish.sbt imports com.github.sbt.git.SbtGit. Declare sbt-git 2.1.0
directly to keep the build loading.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
jigarkhwar added a commit to galax-io/sbt-schema-registry-plugin that referenced this pull request Jul 19, 2026
* Update sbt-ci-release to 1.12.0

* fix: pin sbt-git explicitly

sbt-ci-release 1.12.0 no longer pulls in sbt-git (sbt/sbt-ci-release#471),
but publish.sbt imports com.github.sbt.git.SbtGit. Declare sbt-git 2.1.0
directly to keep the build loading.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: John Axe <jigarkhwar88@gmail.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
jigarkhwar added a commit to galax-io/gatling-amqp-plugin that referenced this pull request Aug 9, 2026
sbt-ci-release 1.12.0 no longer depends on sbt-git (sbt/sbt-ci-release#471),
so `GitVersioning` is unresolvable and project loading fails with
"not found: value GitVersioning".

Versioning already comes from sbt-dynver, which sbt-ci-release still bundles
and which does not use sbt-git. Verified on a clean checkout of tag v1.3.3:
`version` and `dynver` both resolve to 1.3.3, identical to the previous
behaviour, and `scmInfo` still resolves via the git-ls-remote fallback.

Dropping sbt-git also fixes the jgit NoWorkTreeException that made sbt
unloadable from a linked git worktree.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
jigarkhwar added a commit to galax-io/gatling-amqp-plugin that referenced this pull request Aug 9, 2026
* Update sbt-ci-release to 1.12.0

* fix: drop GitVersioning after sbt-ci-release 1.12.0 removed sbt-git

sbt-ci-release 1.12.0 no longer depends on sbt-git (sbt/sbt-ci-release#471),
so `GitVersioning` is unresolvable and project loading fails with
"not found: value GitVersioning".

Versioning already comes from sbt-dynver, which sbt-ci-release still bundles
and which does not use sbt-git. Verified on a clean checkout of tag v1.3.3:
`version` and `dynver` both resolve to 1.3.3, identical to the previous
behaviour, and `scmInfo` still resolves via the git-ls-remote fallback.

Dropping sbt-git also fixes the jgit NoWorkTreeException that made sbt
unloadable from a linked git worktree.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: John Axe <jigarkhwar88@gmail.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants