Add support for .gitignore pattern negation

Issue #190 new
Wade Berrier
created an issue

See for reference:

If a pattern starts with !, it negates that pattern.

The repo clones just fine, but when running status, this error message comes up:

.gitignore: unsupported ignore pattern '!.gitignore'

Here's a sample repo that uses these types of ignore files:


Comments (3)

  1. Pierre Augier

    I encountered the same issue. It is indeed a serious bug because you can not do anything with git repositories using this pattern negation.

    Would it be difficult to solve this problem?

  2. Marc Tamsky

    @Pierre Augier asks:

    Would it be difficult to solve this problem?

    when it was suggested, it was claimed to be difficult, leaning toward very hard:

    although perhaps now, the conventions selected by git could help resolve the ambiguities and performance issues that were outlined in 2008.

    An optional prefix "!" which negates the pattern; any matching file excluded by a previous pattern will become included again. It is not possible to re-include a file if a parent directory of that file is excluded. Git doesn’t list excluded directories for performance reasons, so any patterns on contained files have no effect, no matter where they are defined.

  3. Log in to comment