Thread (22 messages) 22 messages, 4 authors, 2025-07-16

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

From: Ayush Chandekar <hidden>
Date: 2025-06-26 21:28:33

On Thu, Jun 26, 2025 at 9:10 PM Kristoffer Haugsbakk
[off-list ref] wrote:
quoted
+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/ (local)
quoted
+     # 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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help