]> git.ipfire.org Git - thirdparty/git.git/commit
notes: avoid empty line in template
authorMichael J Gruber <git@grubix.eu>
Wed, 16 Nov 2022 15:56:40 +0000 (16:56 +0100)
committerTaylor Blau <me@ttaylorr.com>
Wed, 16 Nov 2022 19:57:32 +0000 (14:57 -0500)
commit3c9b01f0bf4f53eb8437bae725c854049a981865
treeff3ae89c43a4f2e373590215ca122b2327638b11
parenteea7033409a0ed713c78437fc76486983d211e25
notes: avoid empty line in template

When `git notes` prepares the template it adds an empty newline between
the comment header and the content:

>
> #
> # Write/edit the notes for the following object:
>
> # commit 0f3c55d4c2b7864bffb2d92278eff08d0b2e083f
> # etc

This is wrong structurally because that newline is part of the comment,
too, and thus should be commented. Also, it throws off some positioning
strategies of editors and plugins, and it differs from how we do commit
templates.

Change this to follow the standard set by `git commit`:

>
> #
> # Write/edit the notes for the following object:
> #
> # commit 0f3c55d4c2b7864bffb2d92278eff08d0b2e083f
>

Tests pass unchanged after this code change.

Signed-off-by: Michael J Gruber <git@grubix.eu>
Signed-off-by: Taylor Blau <me@ttaylorr.com>
builtin/notes.c