linguist icon indicating copy to clipboard operation
linguist copied to clipboard

Add `gitcommit` and `gitrebase` language?

Open spenserblack opened this issue 3 years ago • 4 comments

Language name

  • Git Commit
  • Git Rebase

URL of example repository

I think this is N/A, since a normal repository wouldn't commit any files that are in the .git directory.

URL of syntax highlighting grammar

  • https://github.com/textmate/git.tmbundle/blob/master/Syntaxes/Git%20Commit%20Message.tmLanguage
  • https://github.com/textmate/git.tmbundle/blob/master/Syntaxes/Git%20Rebase%20Message.tmLanguage

Most popular extensions

Likely N/A, but the filenames are

  • COMMIT_EDITMSG
  • git-rebase-todo

Detected language

None/Plain text


While the files themselves are unlikely to be present in a repository (there are a lot of results for COMMIT_EDITMSG, though), GitHub also uses linguist to highlight code blocks in Markdown, per my understanding.

Considering that these are common git use cases, I believe that the option to highlight their syntax in Markdown should be available. I think that GitHub should support syntax highlighting for git filetypes :laughing:

If it is reasonable to support syntax highlighting for these types of files, could you please consider it?

spenserblack avatar Oct 15 '21 12:10 spenserblack

Sorry, we don't make exceptions to the rules. 😉 However, in this case, I don't think we have to: there are, indeed, a lot of results for COMMIT_EDITMSG files on GitHub, and even git-rebase-todo looks promising (only 869 results, but they appear to be well-distributed between users). So, you might be in luck.

Alhadis avatar Oct 18 '21 10:10 Alhadis

Thanks for looking that up! I'm glad that it might not an exception to the rule after all :smiley:

spenserblack avatar Oct 18 '21 12:10 spenserblack

GitHub also uses linguist to highlight code blocks in Markdown, per my understanding.

What is the mapping between ```foo and the language chosen by linguist?

eric-wieser avatar Jan 30 '24 23:01 eric-wieser

Wow, this issue is a blast from the past :laughing: Looking it up again, here are the relevant docs. I believe that the language's name or one of its aliases can be foo in this case.

spenserblack avatar Jan 31 '24 00:01 spenserblack