Skip Menu |

This queue is for tickets about the Dist-Zilla-Plugin-Git CPAN distribution.

Report information
The Basics
Id: 78898
Status: resolved
Priority: 0/
Queue: Dist-Zilla-Plugin-Git

People
Owner: Nobody in particular
Requestors: cjm [...] cpan.org
Cc: DOHERTY [...] cpan.org
friedo [...] friedo.com
lucs [...] cpan.org
AdminCc:

Bug Information
Severity: Critical
Broken in: 1.113220
Fixed in: 1.122460



CC: lucs [...] cpan.org
Subject: Git::Check allows too much (allow_dirty is now regex)
With this commit: https://github.com/jquelin/dist-zilla-plugin-git/commit/cbd241447d66032465a1fe69707565755fc3eb8f Mike Friedman quietly changed the allow_dirty attribute from an exact string match to a regex match anchored only at the end. The intention was to allow it to work with the default config even when the dzil root was in a subdirectory of the Git repo (e.g. git ls-files reports "perl/Changes" instead of "Changes"). However, the result was a major change in the semantics of allow_dirty *and this was never even documented anywhere*. The entries are now considered to be regexps (with an implicit $ appended) and any file with a path that matches one of the regexps is allowed to be dirty. In particular, "allow_dirty =", which is documented to mean "no files are allowed to be dirty" now actually means "all files are allowed to be dirty". (As a workaround, you can use "allow_dirty = NOTHING AT ALL", and as long as you don't have a file whose name ends with "NOTHING AT ALL" it will work as intended.) Also, since the entries are now regexps, "dist.ini" will also match "dist_ini" and "example-dist-ini". (This is probably not a significant issue, but it needs to be documented.) I'm not sure what the best solution to this is. At the least, the match should be anchored at (?:^|/). But this still allows things like corpus/Test-Dist/Changes to be dirty, when that was probably not the author's intention. Personally, I would vote for removing the feature entirely. Go back to an exact string match, and if somebody wants the dzil root in a subdirectory of the repo, make them specify that in allow_dirty. (This bug was originally discovered by Luc St-Louis. I tracked down the cause.)
Starting with 1.122460, allow_dirty is again an exact string match, but if your repo_root is not the dzil root, then the paths in allow_dirty are interpreted relative to the dzil_root, not the repo_root.