I need to follow a git commit message format that starts with a #
(ex. #1234 ...
).
This is not a duplicate of Start a git commit message with a hashmark (#) because I know about the commentchar
and I already configured my git
to use a different comment character:
gino@myrepo$ git config --global --get core.commentchar
;
gino@myrepo$ git config --get core.commentchar
;
I've also confirmed that it works if I commit from the command line:
gino@myrepo$ git log
Author: ...
Date: Wed Nov 13 21:59:40 2019 +0900
# Test `git commit` from terminal
# These 2 lines should not be treated as comments
The problem is when I try to do my commits from VS Code's Commit UI:
VS Code's Git does not seem to honor the config that #
is not a comment, because when I check the git log
, it only shows the 2nd line:
gino@myrepo$ git log
commit 1254416d309588293372b96fd1f71e30af51b1fe (HEAD -> master)
Author: ...
Date: Wed Nov 13 22:23:17 2019 +0900
These lines should be details.
It's worse when I try to use a one-line message (#4567: blah
). The Commit UI will not allow me to commit (nothing happens when I click on the commit button) and the Command Palette > Git: Commit command will simply abort the commit (probably because it gets treated as an empty commit message).
How do I get VS Code to recognize the custom commentchar
setting?
Notes:
- I know that VS Code uses my
git config
(global or local) because when I try changing other settings (ex.user.name
), it applies it correctly - It's not a duplicate of Start a git commit message with a hashmark (#) because I am talking about committing via VS Code's Commit UI, not via the command line
- I can't find a VS Code > Git setting related to commit messages
- I'm using VS Code 1.40.0