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

Accept and encourage "minus-prefix" for unset gitattributes as per gitattributes documentation #4780

Merged
merged 5 commits into from
Jan 23, 2020

Conversation

lildude
Copy link
Member

@lildude lildude commented Jan 23, 2020

Description

@cespare rightly pointed out in #4624 that we're being "special" by requiring people to use the false string to negate or unset a behaviour via .gitattributes and really should accept and encourage the "minus-prefixed" -linguist-whatever method for unsetting/negating.

As per the gitattributes documentation:

Unset

The path has the attribute with special value "false"; this is specified by listing the name of the attribute prefixed with a dash - in the attribute list.

@cespare got the ball rolling with updating the documentation and I've now implemented the necessary code changes in this PR for the negation to work. This covers both the gitattributes documented behaviour and our old =false behaviour so we don't catch anyone by surprise.

The setting/enabling part already works so no changes on that side.

This PR needs the changes in #4779.

Checklist:

  • I am adding new or changing current functionality
    • I have added or updated the tests for the new or changed functionality.

lildude and others added 5 commits January 23, 2020 15:24
ie this from the gitattributes docs:

Unset

    The path has the attribute with special value "false"; this is specified by listing the name of the attribute prefixed with a dash `-` in the attribute list.
# README.md linguist-documentation=false
# samples/Arduino/* linguist-documentation
# samples/Markdown/*.md linguist-detectable=true
# samples/HTML/*.html linguist-detectable=false
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The four lines above have been added to the .gitattributes in the test branch but this side hasn't been update to reflect this, so I'm adding them as part of this PR.

@lildude lildude requested review from pchaigno and Alhadis January 23, 2020 14:25
Copy link
Contributor

@pchaigno pchaigno left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lots of StackOverflow answers to update now 😄

@lildude lildude merged commit ce0973a into master Jan 23, 2020
@lildude lildude deleted the lildude/accept-bool-attribs-per-docs branch January 23, 2020 15:09
@cespare
Copy link
Contributor

cespare commented Jan 23, 2020

@lildude friendly reminder to update https://help.github.com/en/github/administering-a-repository/customizing-how-changed-files-appear-on-github to use

search/index.json linguist-generated

(I haven't searched recently to see if there are other GitHub doc pages that need updating.)

@lildude
Copy link
Member Author

lildude commented Jan 24, 2020

I'll let our docs team know.

@eloyesp
Copy link

eloyesp commented May 17, 2024

I'll let our docs team know.

It seems that they forgot to change that in this place:

image

@lildude
Copy link
Member Author

lildude commented May 17, 2024

Not really. It still works. Not sure what happened to me original issue. I'll see if I can find time to dig it up, but there's no urgency.

@github-linguist github-linguist locked as resolved and limited conversation to collaborators Jun 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants