mesonbuild / meson

The Meson Build System
http://mesonbuild.com
Apache License 2.0
5.3k stars 1.52k forks source link

mdist: gracefully handle stale Git index #13152

Closed bgilbert closed 2 weeks ago

bgilbert commented 3 weeks ago

Running touch on a tracked file in Git, to update its timestamp, and then running meson dist would cause dist to fail:

ERROR: Repository has uncommitted changes that will not be included in the dist tarball
Use --allow-dirty to ignore the warning and proceed anyway

Unlike git status and git diff, git diff-index doesn't refresh the index before comparing, so stat changes are assumed to imply content changes. Run git update-index -q --refresh first to refresh the index.

Fixes: #12985

jpakkane commented 3 weeks ago

Will it still error out if there are actual changes, not just a timestamp update?

bgilbert commented 3 weeks ago

git diff-index will still error out, yes. We're just avoiding false positives.