codemix / codemix/gitignore-parser

gitignore `/a` should differ from 'a'

Open
#16 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
98
Forks
21
PR merge metrics
No merged PRs in 30d

Description

https://git-scm.com/docs/gitignore#_pattern_format

> If there is a separator at the beginning or middle (or both) of the pattern, then the pattern is relative to the directory level of the particular .gitignore file itself. Otherwise the pattern may also match at any level below the .gitignore level.
>
> [...]
>
> For example, a pattern doc/frotz/ matches doc/frotz directory, but not a/doc/frotz directory; however frotz/ matches frotz and a/frotz that is a directory (all paths are relative from the .gitignore file).

---

Now gitignore-parser creates regexes for both which are wrong: only the `/a` should become `/^a/` while `a` should be turned into a regex like `/a/` (or possibly `/(^|[\/])a/` ...)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.