Skip to content
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

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

Open
seigert opened this issue Feb 22, 2023 · 5 comments
Open

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

seigert opened this issue Feb 22, 2023 · 5 comments

Comments

@seigert
Copy link

seigert commented Feb 22, 2023

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...

@reid-spencer
Copy link

reid-spencer commented Nov 26, 2023

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

@rayrobdod
Copy link

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.

@reid-spencer
Copy link

@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
Copy link

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
Copy link

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.

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

No branches or pull requests

3 participants