well, the HgExcludeFilter already handles this distinction: https://github.com/composer/composer/blob/master/src/Composer/Package/Archiver/HgExcludeFilter.php

This class is only about parsing ``.gitignore``