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

Fix comments #562

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Fix comments #562

wants to merge 2 commits into from

Conversation

nielsbasjes
Copy link

Update

  • Template - Update existing .gitignore templates

Details

While working on my gitignore reader https://github.com/nielsbasjes/codeowners I ran into problems while using the templates that originated from here as a testing reference.

There are several places where the author of the template intended to create a comment but did not. The root cause is that in a .gitignore file a comment starts with a # as the first character on a line. In all other places it is NOT interpreted as a comment.

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

A line starting with # serves as a comment. 
Put a backslash ("\") in front of the first hash for patterns that begin with a hash.

I have verified this with the Dart.gitignore which has

*.js             # When generated by dart2js. Don't specify *.js if your

If I create a test.js it is not ignored by git.

I have checked all cases found by this:

find . -type f -name '*.gitignore' | xargs grep -v '^#' | fgrep '#'

Notes

This is 2 commits. One for the imported files from github and one for the files in this repo.
I have submitted these exact changes to github github/gitignore#4394 but it seems that repo has been unmanaged for over a year now.

Signed-off-by: Niels Basjes <niels@basjes.nl>
Signed-off-by: Niels Basjes <niels@basjes.nl>
@nielsbasjes nielsbasjes requested a review from a team as a code owner January 12, 2024 10:41
@nielsbasjes nielsbasjes requested review from alexmcode and konstrybakov and removed request for a team January 12, 2024 10:41
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