You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that the definition of "dirty" in the plugin is a bit different from that of git describe: untracked files always make the working copy dirty. If this is intended behaviour, it would be nice to have an option to ignore untracked files.
Steps to reproduce the problem
git clone https://github.com/nemerosa/versioning.git
cd versioning
touch tmp
git status
git describe --always --tags --dirty
./gradlew versionDisplay
Expected behaviour
When git describe --dirty does not say the working tree is dirty, the plugin does not, either.
Actual behaviour
$ git status
On branch master
Your branch is up to date with 'origin/master'.
Untracked files:
(use "git add <file>..." to include in what will be committed)
tmp
nothing added to commit but untracked files present (use "git add" to track)
$ git describe --always --tags --dirty
2.8.2-2-gc1d3ce2
$ ./gradlew versionDisplay
[version] scm = git
[version] branch = master
[version] branchType = master
[version] branchId = master
[version] commit = c1d3ce261c2449b792663db4e258d5790eb6e7f4
[version] full = master-c1d3ce2-dirty
[version] base =
[version] build = c1d3ce2
[version] display = master-c1d3ce2-dirty
[version] tag =
[version] lastTag = 2.8.2
[version] dirty = true
The text was updated successfully, but these errors were encountered:
Thanks for reporting this. As of the current version (2.8.2), any change in the status list is reporting as making the working copy considered dirty. It has been made this way to prevent having uncontrolled workspaces in a CI/CD environment.
However, if this suits any need, I could introduce a configuration parameter to ignore any unstaged change. I find this a bit dangerous since the current library I use (grgit) does not make any difference between unstaged changes and untracked changes.
I understand the change may introduce some problems to others, so it would be good to have a configuration parameter to ignore untracked files.
I am not sure how much other people want this behaviour: To me, it would be a nice occasion to reconsider my bad habit to have many untracked files (logs, test inputs...) in development, or I could just ignore the "dirty" flag in development, or maybe I could just write a script to use git describe for versioning by myself.
It seems that the definition of "dirty" in the plugin is a bit different from that of
git describe
: untracked files always make the working copy dirty. If this is intended behaviour, it would be nice to have an option to ignore untracked files.Steps to reproduce the problem
Expected behaviour
When
git describe --dirty
does not say the working tree is dirty, the plugin does not, either.Actual behaviour
The text was updated successfully, but these errors were encountered: