Skip to content

Different gitignore pattern interpretations between node-ignore and Git #155

@tomokinakamaru

Description

@tomokinakamaru

I've noticed that the following five gitignore patterns are interpreted differently between node-ignore and Git:

pattern path node-ignore Git
foo**/bar foobar Tracked 1 Ignored
bar/ foo/bar/ Tracked 2 Ignored
[!] ! Ignored 3 Tracked
\\* \\ Tracked 4 Ignored
\* \ Ignored 5 Tracked

In my opinion, Git's interpretations are somewhat confusing, but given the wide use of node-ignore, I wanted to report these differences for clarification. I would be happy if the node-ignore follows Git perfectly, but I understand if it behaves differently against these edge cases.

Are these differences expected or known issues?

Footnotes

  1. https://github.com/tomokinakamaru/node-ignore/blob/872e34fe0cf276571085a565e9bacfae0a30c19c/test/fixtures/cases.js#L34-L42

  2. https://github.com/tomokinakamaru/node-ignore/blob/872e34fe0cf276571085a565e9bacfae0a30c19c/test/fixtures/cases.js#L43-L51

  3. https://github.com/tomokinakamaru/node-ignore/blob/872e34fe0cf276571085a565e9bacfae0a30c19c/test/fixtures/cases.js#L52-L60

  4. https://github.com/tomokinakamaru/node-ignore/blob/872e34fe0cf276571085a565e9bacfae0a30c19c/test/fixtures/cases.js#L61-L69

  5. https://github.com/tomokinakamaru/node-ignore/blob/872e34fe0cf276571085a565e9bacfae0a30c19c/test/fixtures/cases.js#L70-L78

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions