sbt / sbt/sbt-git

gitHeadCommitDate is wrapped in double quotes when useConsoleForROGit is true

Open Beginner friendly
#372 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Scala
Stars
355
Forks
104
Avg merge
1d 4h
Merged PRs (30d)
4

Description

When useConsoleForROGit is true, the value of the gitHeadCommitDate key is surrounded by a pair of double quotes. When useConsoleForROGit is false, it is not.

Expected behavior

useConsoleForROGit is not wrapped in quotes, regardless of the value of useConsoleForROGit.

Actual behavior

useConsoleForROGit is wrapped in quotes when useConsoleForROGit is true, but not when useConsoleForROGit is false.

Example

import com.github.sbt.git.SbtGit.GitKeys.useConsoleForROGit

lazy val echoGit = taskKey[Unit]("echoGit")
echoGit := println(git.gitHeadCommitDate.value)

ThisBuild / useConsoleForROGit := true

With useConsoleForROGit := true:

$ sbt echoGit
Some("2026-06-01T17:23:26-05:00")

With useConsoleForROGit := false:

$ sbt echoGit
Some(2026-06-01T17:23:26-05:00)

P.S.

I checked some of the other values in com.github.sbt.git.SbtGit.GitKeys, and the one other that I noticed that was meaningfully different is gitHeadMessage, which had an extra newline at the end when useConsoleForROGit is true.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the implementation of gitHeadCommitDate in com.github.sbt.git.SbtGit.GitKeys and trace the read-only Git console path selected by useConsoleForROGit. Reproduce the two sbt echoGit cases from the issue, then add or update regression coverage so the value is emitted without surrounding quotes in both modes.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, scala
Domain
build-system
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.