Skip to content

Instantly share code, notes, and snippets.

@xuwei-k
Created November 1, 2020 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xuwei-k/d566c1f18deefdd578edc441bb370ac0 to your computer and use it in GitHub Desktop.
Save xuwei-k/d566c1f18deefdd578edc441bb370ac0 to your computer and use it in GitHub Desktop.
Global / remoteCacheId := remoteCacheIdCandidates.value.head
// https://git-scm.com/docs/git-log
// https://github.com/sbt/sbt/blob/4a2aaabb9b41a9e016e/main/src/main/scala/sbt/internal/RemoteCache.scala#L32-L41
Global / remoteCacheIdCandidates := {
sys.process
.Process("git log -n 5 -s --pretty=format:%cd-%H --date=format:%Y-%m-%d")
.!!
.linesIterator
.map(_.take(24))
.toList
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment