question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

commentChar default should use git config `core.commentchar`

See original GitHub issue

Expected Behavior

Default setting for commentchar is the output of git config core.commentchar.

Current Behavior

Default setting for commentchar is #.

Affected packages

  • cli
  • core
  • prompt
  • config-angular

Context

Hi, thanks for this tool. The commentChar setting appears to default to # if not overridden explicitly: https://github.com/conventional-changelog/commitlint/blob/1ee518caca0cf758c8404554063d1ca42cacba8d/%40commitlint/cli/src/cli.ts#L224-L229

I think it would be better if it defaulted to the output of git config core.commentchar. I know I can override it in my config, but other people might have it set to something else (I have mine set globally in ~/.gitconfig) so not sure how I can make that work without being able to specify a global override.

This was brought up before in #2351.

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:11 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
jscheidcommented, Sep 21, 2022

Works great now, thanks again!

1reaction
jscheidcommented, May 22, 2022

Ah, yarn test works (but only after yarn build). Might want to update the instructions. All good.

Read more comments on GitHub >

github_iconTop Results From Across the Web

What does git core.commentChar=auto do? - Stack Overflow
It means a character that's not already in use in the current message before invoking the editor. That might seem redundant — why...
Read more >
git-config Documentation - Git
The file /etc/gitconfig can be used to store a system-wide default configuration. The configuration variables are used by both the Git plumbing and...
Read more >
Git Tips #3 - Change the Git rebase comment character
The default comment character in an interactive Git rebase is # . This is fine until you want ... git config --global core.commentchar...
Read more >
Configure Git's comment character - Sadique Ali
TL;DR - Use the core.commentchar configuration to change the character Git uses to mark comment lines in commit messages.
Read more >
579325 – Implement support for core.commentChar - Bugs
This git config can be either a specific character (default #), or "auto", in which case git automatically chooses a character (from the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found