Community
Participate
Working Groups
EGit does that on Squash (using #, not core.commentChar), but otherwise it just passes on all lines to JGit. JGit also doesn't remove comment lines. EGit should do so, otherwise one invariable includes the "Conflicting..." lines in the commit message after having resolved merge conflicts. Doing this unconditionally may be a disruptive departure from current behavior, though. I'm unsure how this would best be done. Preference? Warning in the staging view if the commit message has lines starting with the comment character, with a link/button to remove them? Or pop-up dialog asking the user? See also Lakshmi's EclipseCon2019 demo @20:21,[1] where she also ended up with a commit message including these conflict lines. Also see bug 548529. [1] https://www.youtube.com/watch?v=D73L9YlBlP8&list=PLy7t4z5SYNaT_yo5Dhajb9i-Pf0LbQ3z8&index=118&t=1221s
I think that's a bug in JGit which should be fixed there. I don't care if this departs from current behaviour which clearly breaks behaviour by native git.
(In reply to Matthias Sohn from comment #1) > I think that's a bug in JGit which should be fixed there. > I don't care if this departs from current behaviour which clearly breaks > behaviour by native git. Might changing it in JGit not affect current JGit clients? And if done in JGit, should be done honoring core.commentChar. (Maybe minus the 'auto' setting?) There's also bug 513726. (Fixup in interactive rebase strips, but shouldn't.) Haven't checked whether that's a bug in JGit or in EGit.
*** Bug 395001 has been marked as a duplicate of this bug. ***
Also see commit command option --cleanup [1] and core.commentChar value "auto" [2]. [1] https://git-scm.com/docs/git-commit#Documentation/git-commit.txt---cleanupltmodegt [2] https://git-scm.com/docs/git-config#Documentation/git-config.txt-corecommentChar
New Gerrit change created: https://git.eclipse.org/r/c/jgit/jgit/+/189723
New Gerrit change created: https://git.eclipse.org/r/c/jgit/jgit/+/189724
Gerrit change https://git.eclipse.org/r/c/jgit/jgit/+/189724 was merged to [master]. Commit: http://git.eclipse.org/c/jgit/jgit.git/commit/?id=513c7318de881a70b230fc18dec121033a458e62
Gerrit change https://git.eclipse.org/r/c/jgit/jgit/+/189723 was merged to [master]. Commit: http://git.eclipse.org/c/jgit/jgit.git/commit/?id=318a25f0e62553ee771962369462d54f0e8870c8