From: Ayush Chandekar Date: Thu, 26 Jun 2025 21:28:21 GMT Subject: Re: [GSOC PATCH] commit: avoid scanning trailing comments when 'core.commentChar' is "auto" Message-ID: In-Reply-To: On Thu, Jun 26, 2025 at 9:10 PM Kristoffer Haugsbakk wrote: > > > > +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_must_fail git rebase branch-a && > > + printf "B\nA\n" >file && > > + git add file && > > + write_script fake-editor <<-\EOF && > > + exit 0 > > + EOF > > + FAKE_EDITOR="$(pwd)/fake-editor" && > > + GIT_EDITOR="\"\$FAKE_EDITOR\"" git -c core.commentChar=auto rebase --continue && > > How about > > GIT_EDITOR="cat >actual" > > Then you can `test_grep` on that. Like in > > https://lore.kernel.org/git/5ed77fab-678d-4a06-bbd0-ea25462a7562@gmail.com/ > > > + # Check that "#" is still the comment character. > > + test_grep "# Changes to be committed:" .git/COMMIT_EDITMSG > Thanks, that's much cleaner and faster! > Nit: > > test_grep "^# Changes to be committed:$" > Thanks for the catch. I'll fix it.