sbt / sbt/sbt-git

Untracked files in source directory result in a version without SNAPSHOT suffix

Open
#176 0 comments 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

Creating a new file (and not adding it to git) results in a version without SNAPSHOT suffix.

uncommittedSignifier (SNAPSHOT,dirty, etc...) is not applied if the only change is the creation of new files. Without adding them to git, they are not considered uncommitted changes:

https://github.com/sbt/sbt-git/blob/3dd1343ba8c2d77cda92080f65aab91331822a1a/src/main/scala/com/typesafe/sbt/git/JGit.scala#L89
from hasUncommittedChanges documentation: "true if any tracked file is changed"

Running a build in a directory containing non-tracked files should result in SNAPSHOT suffix (or at least it should be configurable). The sources used for such build do not match sources committed in the repository.

jgitver-maven-plugin uses !status.isClean(), rather than hasUncommitedChanges.

isClean considers untracked files.

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 in src/main/scala/com/typesafe/sbt/git/JGit.scala around line 89 and compare hasUncommittedChanges with JGit Status.isClean, using the linked JGit documentation. Verify behavior with an untracked source file; done when the version receives the SNAPSHOT or configured dirty suffix, consistent with the chosen behavior.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.