Re: [GSOC PATCH] commit: avoid scanning trailing comments when 'core.commentChar' is "auto"
- From
Ayush Chandekar <ayu.chandekar@gmail.com>
- Date
- Jun 26, 2025, 21:28 UTC
- Message-ID
- <CAE7as+aSG0BKeGDFs_GnHjo7juTv1jhKzRgTKGeoH+2X_-O=CA@mail.gmail.com>
- In-Reply-To
- <ca8e7670-cf4f-4915-a37f-09d2e4b7c62a@app.fastmail.com>
On Thu, Jun 26, 2025 at 9:10 PM Kristoffer Haugsbakk <kristofferhaugsbakk@fastmail.com> wrote:
Show 28 quoted lines
> > > > +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.