Untracked files in source directory result in a version without SNAPSHOT suffix
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.
-
gradle-android-git-version can be configured (untrackedIsDirty)
-
jgitver-maven-plugin with "dirty" marker enabled (using useDirty option) considers presence of untracked files a dirty state.
jgitver-maven-plugin uses !status.isClean(), rather than hasUncommitedChanges.
isClean considers untracked files.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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