Re: [GSOC PATCH v3] commit: avoid scanning trailing comments when 'core.commentChar' is "auto"
- From
- Phillip Wood <phillip.wood123@gmail.com>
- Date
- Jul 1, 2025, 13:17 UTC
- Message-ID
- <f22e864e-669d-457c-838e-961bbc977c4b@gmail.com>
- In-Reply-To
- <20250630182527.69167-1-ayu.chandekar@gmail.com>
Hi Ayush
On 30/06/2025 19:25, Ayush Chandekar wrote:
Show 36 quoted lines
>
> Range-diff with v2:
> 1: 4e74e7a9a6 ! 1: 693f890a36 commit: avoid scanning trailing comments when 'core.commentChar' is "auto"
> @@ Commit message
>
> The "auto" value for core.commentchar was introduced in the commit
> 84c9dc2c5a (commit: allow core.commentChar=auto for character auto
> - selection, 2014-05-17) but did not exhibt this issue at that time.
> + selection, 2014-05-17) but did not exhibit this issue at that time.
>
> The bug was introduced in commit a6c2654f83 (rebase -m: fix --signoff
> with conflicts, 2024-04-18) where Git started writing conflict comments
> @@ t/t3418-rebase-continue.sh: test_expect_success 'there is no --no-reschedule-fai
> '
>
> +test_expect_success 'no change in comment character due to conflicts markers with core.commentChar=auto' '
> -+ test_commit base file &&
> + git checkout -b branch-a &&
> -+ test_commit A file &&
> -+ git checkout -b branch-b base &&
> -+ test_commit B file &&
> ++ test_commit A F1 &&
> ++ git checkout -b branch-b HEAD^ &&
> ++ test_commit B F1 &&
> + test_must_fail git rebase branch-a &&
> -+ printf "B\nA\n" >file &&
> -+ git add file &&
> ++ printf "B\nA\n" >F1 &&
> ++ git add F1 &&
> + GIT_EDITOR="cat >actual" git -c core.commentChar=auto rebase --continue &&
> + # Check that "#" is still the comment character.
> -+ test_grep "^# Changes to be committed:$" actual
> ++ test_grep "^# Changes to be committed" actual
> +'
> +
> test_orig_head_helper () {The changes here look good but I think we want to update the config parsing as well so that comment_line_str is reset to '#' when core.commentString=auto. We probably want to do that in its own commit.
Thanks
Phillip