NeogitOrg / neogit

An interactive and powerful Git interface for Neovim, inspired by Magit
MIT License
4.08k stars 241 forks source link

core.commentChar support is incomplete #1530

Open KnBrckr opened 3 weeks ago

KnBrckr commented 3 weeks ago

Description

1095 detects the setting for core.commentChar however the support is incomplete in two ways.

  1. core.commentChar can be set to the string "auto", causing git-commit to select a character that does not appear at the beginning of any line of the existing commit message. See https://git-scm.com/docs/git-config/2.47.0#Documentation/git-config.txt-corecommentChar
  2. A new field core.commentString is available to allow setting of a multi-character string. commentChar will reject a setting that is more than a single ASCII character.

Using the setting "auto" for core.commentChar results in the same behavior described in #320 but with the string "auto" prefixed on the included help text.

Neovim version

NVIM v0.10.0 Build type: Release LuaJIT 2.1.1713484068

Operating system and version

AlmaLinux release 9.3 (Shamrock Pampas Cat) in WSL

Steps to reproduce

  1. Set core.commentChar to "auto"
  2. Commit a change using neogit

Expected behavior

The resulting comment message should not contain help content generated by neogit

Actual behavior

Commit message contains:

auto
auto Commands:
auto   q          Close
auto   <c-c><c-c> Submit
auto   <c-c><c-k> Abort
auto   <m-p>      Previous Message
auto   <m-n>      Next Message
auto   <m-r>      Reset Message

Minimal config

Use default configuration of neogit, no other plugins outside neogit dependencies needed.