Skip to content

commentChar default should use git config core.commentchar #3190

Closed
@jscheid

Description

@jscheid

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:

// Strip comments if reading from `.git/COMMIT_EDIT_MSG` using the
// commentChar from the parser preset falling back to a `#` if that is not
// set
if (flags.edit && typeof opts.parserOpts.commentChar !== 'string') {
opts.parserOpts.commentChar = '#';
}

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions