Problems with commit message titles start with #

Offen
#736 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 1 Tag

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
22/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
git, ruby
Bereich
devtools

Rechercherichtung

Start with the EmptyMessage commit-msg rule, since it rejects the commit once Git has stripped the #16: title. Reproduce by committing a message beginning with # under the default config, with core.commentchar set to ;, and with --cleanup=whitespace, and compare how Overcommit reads the message in each case. Done means a #-prefixed title is kept and not rejected as empty, while genuinely empty messages still fail.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

I'm facing this obscure issue that with commit message titles start with # (e.g. #16: This is a sample commit for the issue 16)

Behaviours:

Without Overcommit (or after overcommit --uninstall)

  • No problems with commit messages start with #

With Overcommit

  • With the default Git config
    • Git will clean up and strip the commit title, so it becomes empty
    • Then overcommit rejects it due to EmptyMessage rule (which is the correct behaviour of course)
  • With git config --global core.commentchar ';' set
    • Git still cleans up and strips the commit title with #, so it becomes empty again
    • Then overcommit ignores the empty message and doesn't reject the commit (even if EmptyMessage is enabled by default)
  • With git config --global commit.cleanup whitespace set
    • Maybe I'm doing something wrong here. Setting git commit.cleanup mode has no effect on anything. The commit message is still gone and overcommit is rejecting the empty message.
  • Use git commit -m "#16: This is a sample commit for the issue 16" --cleanup=whitespace
    • Same as above. No effect when it should.
Vorherrschende Sprache
Ruby
Sterne
4k
Forks
288
Ø Merge
2 T. 4 Std.
Gemergte PRs (30 T.)
18

Entwicklungsumgebung

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus sds/overcommit

Alle Issues in sds/overcommit

Ähnliche Issues

Weitere Issues zu Ruby

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.