public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox•com>
To: Phillip Wood <phillip.wood123@gmail•com>
Cc: git@vger•kernel.org,  Ayush Chandekar <ayu.chandekar@gmail•com>,
	 Oswald Buddenhagen <oswald.buddenhagen@gmx•de>,
	 Taylor Blau <me@ttaylorr•com>,
	Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail•com>
Subject: Re: [PATCH v2 1/3] breaking-changes: deprecate support for core.commentString=auto
Date: Thu, 31 Jul 2025 13:49:37 -0700	[thread overview]
Message-ID: <xmqqwm7oozku.fsf@gitster.g> (raw)
In-Reply-To: <a6355451d4b22730ffd20eb5ea5e820582d20b03.1753975294.git.phillip.wood@dunelm.org.uk> (Phillip Wood's message of "Thu, 31 Jul 2025 16:21:53 +0100")

Phillip Wood <phillip.wood123@gmail•com> writes:

> From: Phillip Wood <phillip.wood@dunelm•org.uk>
>
> When "core.commentString" is set to "auto" then "git commit" will
> automatically select the comment character ensuring that it is not the
> first character on any of the lines in the commit message. This was
> introduced by commit 84c9dc2c5a2 (commit: allow core.commentChar=auto
> for character auto selection, 2014-05-17) The motivation seems to be

"5-17) The" -> "5-17). The".

> to avoid commenting out lines from the existing message when amending
> a commit that was created with a message from a file.
>
> Unfortunately this feature does not work with:
>
>  * commit message templates that contain comments.
>
>  * prepare-commit-msg hooks that introduce comments.
>
>  * "git commit --cleanup=strip --edit -F <file>" which means that it
>    is incompatible with
>
>    - the "fixup" and "squash" commands of "git rebase -i" as the
>      comments added by those commands are then treated as part of
>      the commit message.
>
>    - the conflict comments added to the commit message by "git
>      cherry-pick", "git rebase" etc. as these comments are then
>      treated as part of the commit message.
>
> It is also ignored by "git notes" when amending a note.
>
> The issues with comments coming from a template, hook or file are a
> consequence of the design of this feature and are therefore hard to
> fix.
>
> As the costs of this feature outweigh the benefits deprecate it and

"the benefits deprecate" -> "the benefits, deprecate".

> remove it in Git 3.0. If someone comes up with some patches that fix
> all the issues in a maintainable way then I'd be happy to see this
> change reverted.
>
> The next commits will add a warning and some advice for users on how
> they can update their config settings.
>
> Signed-off-by: Phillip Wood <phillip.wood@dunelm•org.uk>
> ---
>  +
> -If set to "auto", `git-commit` would select a character that is not
> +ifndef::with-breaking-changes[]
> +If set to "auto", `git-commit` will select a character that is not
>  the beginning character of any line in existing commit messages.
> -+
> +Support for this value is deprecated and will be removed in Git 3.0
> +due to the following limitations:
> ++
> +--
> +* It is incompatible with adding comments in a commit message
> +  template. This includes the conflicts comments added to
> +  the commit message by `cherry-pick`, `merge`, `rebase` and
> +  `revert`.
> +* It is incompatible with adding comments to the commit message
> +  in the `prepare-commit-msg` hook.
> +* It is incompatible with the `fixup` and `squash` commands when
> +  rebasing,
> +* It is not respected by `git notes`
> +--
> ++
> +endif::with-breaking-changes[]

The above is shown to everybody before the 3.0 happens (and if you
opt into 3.0 early, you will stop seeing it earlier than others).

The rest of the patch looks good to me.

  reply	other threads:[~2025-07-31 20:49 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-08 13:56 [PATCH 0/2] breaking-changes: deprecate support for core.commentChar=auto Phillip Wood
2025-07-08 13:56 ` [PATCH 1/2] breaking-changes: deprecate support for core.commentString=auto Phillip Wood
2025-07-08 15:28   ` Ayush Chandekar
2025-07-09  9:40     ` Phillip Wood
2025-07-08 13:56 ` [PATCH 2/2] commit: print advice when core.commentString=auto Phillip Wood
2025-07-08 18:51 ` [PATCH 0/2] breaking-changes: deprecate support for core.commentChar=auto Junio C Hamano
2025-07-09  9:38   ` Phillip Wood
2025-07-09 16:20     ` Junio C Hamano
2025-07-11 15:09       ` Phillip Wood
2025-07-11 17:07         ` Junio C Hamano
2025-07-12  8:01           ` Oswald Buddenhagen
2025-07-12 14:06             ` Junio C Hamano
2025-07-26 23:15         ` Junio C Hamano
2025-07-27 15:46           ` Phillip Wood
2025-07-09  1:27 ` Junio C Hamano
2025-07-09  1:52   ` Ayush Chandekar
2025-07-09  9:38   ` Phillip Wood
2025-07-31 15:21 ` [PATCH v2 0/3] " Phillip Wood
2025-07-31 15:21   ` [PATCH v2 1/3] breaking-changes: deprecate support for core.commentString=auto Phillip Wood
2025-07-31 20:49     ` Junio C Hamano [this message]
2025-07-31 15:21   ` [PATCH v2 2/3] config: warn on core.commentString=auto Phillip Wood
2025-07-31 21:17     ` Junio C Hamano
2025-08-01 10:37       ` Phillip Wood
2025-08-01 14:36     ` Oswald Buddenhagen
2025-07-31 15:21   ` [PATCH v2 3/3] commit: print advice when core.commentString=auto Phillip Wood
2025-08-01 15:18     ` Oswald Buddenhagen
2025-08-01 17:19       ` Junio C Hamano
2025-08-26 13:33       ` Phillip Wood
2025-08-27  8:19         ` Oswald Buddenhagen
2025-08-27 16:39           ` Junio C Hamano
2025-08-27 22:38             ` Oswald Buddenhagen
2025-08-01  3:50   ` [PATCH v2 0/3] breaking-changes: deprecate support for core.commentChar=auto Junio C Hamano
2025-08-01 10:36     ` Phillip Wood
2025-08-01 16:41       ` Junio C Hamano
2025-08-26 13:35 ` [PATCH v3 " Phillip Wood
2025-08-26 13:35   ` [PATCH v3 1/3] breaking-changes: deprecate support for core.commentString=auto Phillip Wood
2025-08-26 13:35   ` [PATCH v3 2/3] config: warn on core.commentString=auto Phillip Wood
2025-08-26 15:52     ` Junio C Hamano
2025-08-27 15:29       ` Phillip Wood
2025-08-27 18:55         ` Junio C Hamano
2025-08-26 13:35   ` [PATCH v3 3/3] commit: print advice when core.commentString=auto Phillip Wood
2025-08-27 15:27 ` [PATCH v4 0/3] breaking-changes: deprecate support for core.commentChar=auto Phillip Wood
2025-08-27 15:27   ` [PATCH v4 1/3] breaking-changes: deprecate support for core.commentString=auto Phillip Wood
2025-08-27 15:27   ` [PATCH v4 2/3] config: warn on core.commentString=auto Phillip Wood
2025-08-27 15:27   ` [PATCH v4 3/3] commit: print advice when core.commentString=auto Phillip Wood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqwm7oozku.fsf@gitster.g \
    --to=gitster@pobox$(echo .)com \
    --cc=ayu.chandekar@gmail$(echo .)com \
    --cc=git@vger$(echo .)kernel.org \
    --cc=kristofferhaugsbakk@fastmail$(echo .)com \
    --cc=me@ttaylorr$(echo .)com \
    --cc=oswald.buddenhagen@gmx$(echo .)de \
    --cc=phillip.wood123@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox