Re: [GSOC PATCH] commit: avoid scanning trailing comments when 'core.commentChar' is "auto"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 26, 2025 at 9:10 PM Kristoffer Haugsbakk
<kristofferhaugsbakk@xxxxxxxxxxxx> 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@xxxxxxxxx/
>
> > +     # 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.





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux