0

I saw this in the v1.76 release notes of VS Code:

Git commit syntax highlighting:
Git commit syntax highlighting

What is meant by "new Git grammar"?

I want to define some git commit rules for my company. Rules build on VS Codes git grammer respectivly the syntax hightlighting of git commit messages may be a good idea?!

starball
  • 20,030
  • 7
  • 43
  • 238

1 Answers1

1

The release notes being referred to are here: https://code.visualstudio.com/updates/v1_76#_git-commit-syntax-highlighting.

The relevant issue ticket is here: https://github.com/microsoft/vscode/issues/3876.

The commit that implemented it is here: https://github.com/microsoft/vscode/commit/cc226c05816dbc1b58260486eed72b83642ec63d.

The git grammar provides syntax highlighting for the commit and rebase message templates that git provides (and that you can configure (see How to specify a git commit message template for a repository in a file at a relative path to the repository?)) for editing commit messages, and which VS Code presents to you when you want to commit and your git.useEditorAsCommitInput is true (which it is by default if you don't set it to anything).

(Example template that you might have seen something like before):

# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
#
# On branch main
#
# Initial commit
#
# Changes to be committed:
# new file:   bar/bar.js
# new file:   foo.js
#
# Changes not staged for commit:
# modified:   foo.js
#
# Untracked files:
# .vscode/
# index.html
#
starball
  • 20,030
  • 7
  • 43
  • 238