sbt-git icon indicating copy to clipboard operation
sbt-git copied to clipboard

sbt-git v2.0.1 disables all ouput from git commands to sbt logs

Open seigert opened this issue 2 years ago • 5 comments

Steps to reproduce:

$ (~) > mkdir sbt-git-test && cd sbt-git-test 

$ (~/sbt-git-test ) > git init
Initialized empty Git repository in ~/junk/.git/

$ (~/sbt-git-test ) > mkdir project

$ (~/sbt-git-test ) > echo "sbt.version = 1.8.2" > project/build.properties

$ (~/sbt-git-test ) > echo 'addSbtPlugin("com.github.sbt" % "sbt-git" % "2.0.0")' > project/plugins.sbt

$ (~/sbt-git-test ) > sbt
[info] welcome to sbt 1.8.2 (Homebrew Java 11.0.17)
...
[info] started sbt server
sbt:sbt-git-test> git status
[info] On branch master
[info] No commits yet
[info] Untracked files:
[info]   (use "git add <file>..." to include in what will be committed)
[info] 	.bsp/
[info] 	project/
[info] 	target/
[info] nothing added to commit but untracked files present (use "git add" to track)
sbt:sbt-git-test>
[info] shutting down sbt server

$ (~/sbt-git-test ) > echo 'addSbtPlugin("com.github.sbt" % "sbt-git" % "2.0.1")' > project/plugins.sbt

$ (~/sbt-git-test ) > sbt
[info] welcome to sbt 1.8.2 (Homebrew Java 11.0.17)
...
[info] started sbt server
sbt:sbt-git-test> git status
sbt:sbt-git-test> git log -1
[error] fatal: your current branch 'master' does not have any commits yet
[error] Nonzero exit code (128) running git.
sbt:sbt-git-test> set logLevel := Level.Debug
[info] Defining logLevel
[info] The new value will be used by Test / test / testListeners, Test / testOnly / testListeners and 5 others.
[info] 	Run `last` for details.
[info] Reapplying settings...
[info] set current project to sbt-git-test (in build file:/Users/a.shuksto/Projects/junk/sbt-git-test/)
sbt:sbt-git-test> git status
sbt:sbt-git-test>

As you can see, running git commands from SBT w/o any visual cconfirmation is very inconvenient...

seigert avatar Feb 22 '23 11:02 seigert

Confirmed. I've been experiencing this too. I wonder if this has to do with I/O work within sbt in some version after sbt 1.5 ? This same lack of output from git commands happens for me with any sbt 1.9 version

reid-spencer avatar Nov 26 '23 16:11 reid-spencer

sbt-git 2.0.0 on sbt 1.9.7 will produce output, while sbt-git 2.0.1 on sbt 1.9.7 will not produce output. Which leads me to think that io work within sbt is not relevant. I want to blame #219 , but even sbt --debug git status will not produce output, and it should if the only change was that the git command log output was changed from info to debug.

rayrobdod avatar Nov 30 '23 22:11 rayrobdod

@rayrobdod - If that's the case then it should be pretty simple to track down the change producing no output: compare 2.0.0 with 2.0.1. I'm going to do this shortly and see if I can find a solution just on visual inspection of the delta.

reid-spencer avatar Dec 05 '23 18:12 reid-spencer

I've tested that assertion about sbt 1.9.7 with 2.0.0 producing output and 2.0.1 not producing output. That assertion doesn't hold for me. Neither 2.0.0 nor 2.0.1 produced output with sbt 1.97 in my project.

reid-spencer avatar Dec 05 '23 21:12 reid-spencer

I've tested that assertion about sbt 1.9.7 with 2.0.0 producing output and 2.0.1 not producing output. That assertion doesn't hold for me. Neither 2.0.0 nor 2.0.1 produced output with sbt 1.97 in my project.

That was a mistake. I had a build error that was still pulling in 2.0.1. I can confirm now that 2.0.0 does produce output.

reid-spencer avatar Dec 05 '23 21:12 reid-spencer