Skip to content

Commit b1df0b1

Browse files
authored
Merge pull request #230 from jpassaro/publicize-console-ro-settings
Publicize option to disable JGit
2 parents 101142c + 9030976 commit b1df0b1

File tree

3 files changed

+51
-18
lines changed

3 files changed

+51
-18
lines changed

README.md

+25-10
Original file line numberDiff line numberDiff line change
@@ -27,27 +27,42 @@ Add the following to your `project/plugins.sbt` or `~/.sbt/0.13/plugins/plugins.
2727

2828
additionally, use one of the older README.md files: (https://github.com/sbt/sbt-git/blob/v0.7.1/README.md)
2929

30-
### Using JGit ###
30+
### JGit ###
3131

32-
If you do not have git installed and available on your path (e.g. you use windows),
33-
make sure your `git.sbt` or `~/.sbt/0.13/git.sbt` file looks like this:
32+
JGit is a Java interface to git that allows some git operations to be
33+
performed in the JVM without invoking an external git executable. By default,
34+
this plugin uses JGit for read-only operations such as inspecting HEAD; for
35+
write operations, it assumes a git executable is present and on the PATH and
36+
it uses that.
37+
38+
In certain circumstances you may want to force the use of JGit or an
39+
executable for both read-only and read-write operations; for example, if no
40+
git executable is present (e.g. you use windows and you haven't installed git
41+
or it's not on your PATH) you need to disable the console interface, or if
42+
you rely on a git feature that JGit does not support (e.g. worktrees) you need
43+
to disable the JGit interface.
44+
45+
The following settings will force the use of only JGit or a git executable,
46+
respectively:
47+
48+
* `useJGit`
49+
* `useReadableConsoleGit`
50+
51+
These settings can be included in your project's `git.sbt` or in
52+
`~/.sbt/1.0/git.sbt` -- for example, if no git executable is installed,
53+
either file can have the following contents:
3454

3555
useJGit
3656

37-
Or you can type this into the prompt:
57+
Or you can `set` the appropriate setting in the sbt prompt:
3858

39-
> set useJGit
59+
> set useReadableConsoleGit
4060
[info] Reapplying settings...
4161
[info] Set current project to scala-arm (in build file:...)
4262
> session save
4363
[info] Reapplying settings...
4464
[info] Set current project to scala-arm (in build file:...)
4565

46-
This will enable a java-only GIT solution that, while not supporting all the same
47-
commands that can be run in the standard git command line, is good enough for most
48-
git activities.
49-
50-
5166
## Versioning with Git ##
5267

5368
You can begin to use git to control your project versions.

src/main/scala/com/github/sbt/git/GitPlugin.scala

+1
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,7 @@ object GitPlugin extends AutoPlugin {
329329
def versionWithGit = SbtGit.versionWithGit
330330
def versionProjectWithGit = SbtGit.versionProjectWithGit
331331
def useJGit = SbtGit.useJGit
332+
def useReadableConsoleGit = SbtGit.useReadableConsoleGit
332333
def showCurrentGitBranch = SbtGit.showCurrentGitBranch
333334
}
334335
override def buildSettings: Seq[Setting[_]] = SbtGit.buildSettings

src/sbt-test/git-versioning/multi-module-project-use-describe/README2.md

+25-8
Original file line numberDiff line numberDiff line change
@@ -27,25 +27,42 @@ Add the following to your `project/plugins.sbt` or `~/.sbt/0.13/plugins/plugins.
2727

2828
additionally, use one of the older README.md files: (https://github.com/sbt/sbt-git/blob/v0.7.1/README.md)
2929

30-
### Using JGit ###
30+
### JGit ###
3131

32-
If you do not have git installed and available on your path (e.g. you use windows),
33-
make sure your `git.sbt` or `~/.sbt/0.13/git.sbt` file looks like this:
32+
JGit is a Java interface to git that allows some git operations to be
33+
performed in the JVM without invoking an external git executable. By default,
34+
this plugin uses JGit for read-only operations such as inspecting HEAD; for
35+
write operations, it assumes a git executable is present and on the PATH and
36+
it uses that.
37+
38+
In certain circumstances you may want to force the use of JGit or an
39+
executable for both read-only and read-write operations; for example, if no
40+
git executable is present (e.g. you use windows and you haven't installed git
41+
or it's not on your PATH) you need to disable the console interface, or if
42+
you rely on a git feature that JGit does not support (e.g. worktrees) you need
43+
to disable the JGit interface.
44+
45+
The following settings will force the use of only JGit or a git executable,
46+
respectively:
47+
48+
* `useJGit`
49+
* `useReadableConsoleGit`
50+
51+
These settings can be included in your project's `git.sbt` or in
52+
`~/.sbt/1.0/git.sbt` -- for example, if no git executable is installed,
53+
either file can have the following contents:
3454

3555
useJGit
3656

37-
Or you can type this into the prompt:
57+
Or you can `set` the appropriate setting in the sbt prompt:
3858

39-
> set useJGit
59+
> set useReadableConsoleGit
4060
[info] Reapplying settings...
4161
[info] Set current project to scala-arm (in build file:...)
4262
> session save
4363
[info] Reapplying settings...
4464
[info] Set current project to scala-arm (in build file:...)
4565

46-
This will enable a java-only GIT solution that, while not supporting all the same
47-
commands that can be run in the standard git command line, is good enough for most
48-
git activities.
4966

5067

5168
## Versioning with Git ##

0 commit comments

Comments
 (0)