Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don’t show comments from .gitignore #59

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tigt
Copy link

@tigt tigt commented Jul 31, 2019

If a .gitignore file has comment lines, browser-refresh will announce them as patterns, like so:

$ browser-refresh index.js
[browser-refresh] Watching: /Users/me/git/project
[browser-refresh] Ignore rule: #### MacOS ####
[browser-refresh] Ignore rule: .DS_Store
[browser-refresh] Ignore rule: .AppleDouble
[browser-refresh] Ignore rule: .LSOverride
[browser-refresh] Ignore rule: # Icon must end with two \r
[browser-refresh] Ignore rule: Icon
[browser-refresh] Ignore rule: # Thumbnails
[browser-refresh] Ignore rule: ._*
[browser-refresh] Ignore rule: #### Node.JS ####

I’m unsure this is the place to filter them out, though — technically a filename can start with the gitconfig comment characters (# and ;). I couldn’t find the code that parses out patterns from .gitignore, but if you show me where I’ll filter there instead!

If a `.gitignore` file has comment lines, `browser-refresh` will announce them as patterns, like so:

```sh
$ browser-refresh index.js
[browser-refresh] Watching: /Users/me/git/project
[browser-refresh] Ignore rule: #### MacOS ####
[browser-refresh] Ignore rule: .DS_Store
[browser-refresh] Ignore rule: .AppleDouble
[browser-refresh] Ignore rule: .LSOverride
[browser-refresh] Ignore rule: # Icon must end with two \r
[browser-refresh] Ignore rule: Icon
[browser-refresh] Ignore rule: # Thumbnails
[browser-refresh] Ignore rule: ._*
[browser-refresh] Ignore rule: #### Node.JS ####
```

I’m unsure this is the place to filter them out, though — _technically_ a filename can start with the gitconfig comment characters (`#` and `;`). I couldn’t find the code that parses out patterns from `.gitignore`, but if you show me where I’ll filter there instead!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant