[Bug 6082] New: Support ! pattern negation in .hgignore as for Git

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Bug 6082] New: Support ! pattern negation in .hgignore as for Git

mercurial-bugs-2
https://bz.mercurial-scm.org/show_bug.cgi?id=6082

            Bug ID: 6082
           Summary: Support ! pattern negation in .hgignore as for Git
           Product: Mercurial
           Version: unspecified
          Hardware: PC
                OS: Linux
            Status: UNCONFIRMED
          Severity: feature
          Priority: wish
         Component: Mercurial
          Assignee: [hidden email]
          Reporter: [hidden email]
                CC: [hidden email]

It's difficult to work with hg-git for some Git repositories (example
https://github.com/pyenv) because they use in their .gitignore the ! pattern.

From the Git documentation:

"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. "

For a repository using such pattern, one gets: `.gitignore: unsupported ignore
pattern '!/.gitignore'`

There is an issue in the hg-git repository on Bitbucket
(https://bitbucket.org/durin42/hg-git/issues/190/add-support-for-gitignore-pattern-negation),
but it seems that it should be solved at the Mercurial level.

Note that Git does something reasonable in terms of performance ("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.") so
Mercurial could do the same?

--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel