The reason this cannot be done is because for git, the commit is a snapshot of the status of all the files in the project at that point, and the affected files are later output by comparing the commit with its parent. (The affected files are only those files that are different from each other.) Thus, there is no way to artificially mark the path as affected because the commit does not actually store this information directly.
One thing you can do is change the file permissions (for example, set or disable recording in groups) on the appropriate paths - this will be committed as a change, although the contents of the file will be the same. And you can always have two adjacent commits - one that changes permissions, and the other - to change them - if you don't want permissions to stay changed. This is a bit dirty, but it will work, especially if the file permissions are not important in your case.
Jeff clites
source share