
'git ls-files --exclude=<pattern>' was changed (intentionally!) not to exclude anything files that are actually in the index. Since git ls-files by default simply lists the files in the index, this is a problem. Emulating this in shell went past the limits of what made sense, so move it to a simple external python script.