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

Add support for Git Revision List files #5903

Merged
merged 7 commits into from Jun 7, 2022

Conversation

Nixinova
Copy link
Contributor

@Nixinova Nixinova commented May 21, 2022

Description

Adds the simple git-blame-ignore-revs file format, which is just a list of commit hashes with hash-comments allowed.

Checklist:

  • I am adding a new language.
    • The extension of the new language is used in hundreds of repositories on GitHub.com.
    • I have included a real-world usage sample for all extensions added in this PR:
    • I have included a syntax highlighting grammar:
    • I have updated the heuristics to distinguish my language from others using the same extension.

Not sure whether the submodule updating was committed.

@Nixinova Nixinova marked this pull request as ready for review May 21, 2022 08:26
@Nixinova Nixinova requested a review from a team as a code owner May 21, 2022 08:26
lib/linguist/languages.yml Outdated Show resolved Hide resolved
lib/linguist/languages.yml Outdated Show resolved Hide resolved
Alhadis referenced this pull request in Nixinova/NovaGrammars May 21, 2022
Adapted from the generic hash-commented grammar, with highlighting for invalid lines.
@lildude
Copy link
Member

lildude commented May 21, 2022

🤔 does this really need its own entry? Why not add it to the list of files under the “Ignore List”? From a quick test it highlights fine.

@Nixinova
Copy link
Contributor Author

does this really need its own entry? Why not add it to the list of files under the “Ignore List”? From a quick test it highlights fine.

I defaulted to using a separate language so it could have the invalid content highlighting but I can change it to be under Ignore-List if you would prefer that.


```git-blame-ignore
image

```ignore-list
image

@lildude
Copy link
Member

lildude commented May 23, 2022

I hadn't considered invalid syntax, but now you mention it, it looks like the current gitignore grammar doesn't handle invalid syntax either so maybe it's worth updating that instead?

@Alhadis
Copy link
Collaborator

Alhadis commented May 25, 2022

so maybe it's worth updating that instead?

@lildude The grammar used to highlight .gitignore files is actually responsible for highlighting several nearly-identical filetypes, most of them deliberately modelled off the familiar gitignore(5) format.

For that reason, I'd advise against enforcing any lexical integrity via highlighting, especially since whitespace in a gitignore(5) pattern may be intentional (and therefore impossible to disambiguate from a legitimate error in other contexts):

pathname with spaces/

@Alhadis
Copy link
Collaborator

Alhadis commented May 25, 2022

@Nixinova I've sent you a pull-request to correct a few remaining highlighting issues, as well as to rename the grammar for the reasons I explained earlier. Your PR will need to be updated to reflect the outcome of that PR.

@Nixinova Nixinova marked this pull request as draft May 27, 2022 09:47
@Nixinova Nixinova changed the title Add support for Git Blame Ignore files Add support for Git Revision List files Jun 4, 2022
@Nixinova Nixinova marked this pull request as ready for review June 5, 2022 03:53
lib/linguist/languages.yml Outdated Show resolved Hide resolved
@lildude lildude merged commit 957f6ed into github-linguist:master Jun 7, 2022
@Nixinova Nixinova deleted the git-blame-ignore-revs branch June 8, 2022 21:59
Alhadis added a commit to Alhadis/language-file-magic that referenced this pull request Oct 26, 2022
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.

Add git-blame-ignore-revs
3 participants