Skip to content

untracked files in git are creating dirty state #109

Closed
@jaraco

Description

@jaraco

In Mercurial and in Git prior to the fix for #86 released with setuptools_scm 1.13.1, untracked files would not cause a dirty state, but since 1.13.1, they do.

$ 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)

    .tox/

nothing added to commit but untracked files present (use "git add" to track)
$ python -m pip install setuptools_scm==1.13.0
Collecting setuptools_scm==1.13.0
  Downloading setuptools_scm-1.13.0-py2.py3-none-any.whl
Installing collected packages: setuptools-scm
Successfully installed setuptools-scm-1.13.0
$ python setup.py --quiet sdist
$ ls dist
rwt-2.13.tar.gz
$ python -m pip uninstall -y setuptools_scm
Uninstalling setuptools-scm-1.13.0:
  Successfully uninstalled setuptools-scm-1.13.0
$ python setup.py --quiet sdist            
$ ls dist
rwt-2.13.tar.gz                 rwt-2.14.dev0+ngd08ab93.d20161012.tar.gz

My opinion and the expectation of environments based on past behavior is that untracked files shouldn't create a dirty state. Only modified files or perhaps staged files should cause the project to detect as dirty. The git describe output seems to be the same before and after removing the untracked files.

$ git describe --tags --long   
2.13-0-gd08ab93
$ rm -R .tox
$ git describe --tags --long
2.13-0-gd08ab93

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions