You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Revert commit message of Jgit is not consistent with the command line git revert operation.
Jgit uses the full commit message in revert commit message where as the command line git uses just the first line of commit message.
While reverting a following commit with message
This is a multi-line commit message to test revert on Jgit & c-Git.
With some text on line 2.
And some more text on line 3.
Jgit revert commit message is
commit 3142ef1f3345084fde2c23111208f2760e618244 (HEAD -> jGitRevert)
Author: Parashar Joshi <[email protected]>
Date: Thu Dec 5 13:09:15 2024 +0530
Revert "This is a multi-line commit message to test revert on Jgit & c-Git. With some text on line 2. And some more text on line 3."
This reverts commit 1286a7ea850f01a47c63b09e42912f9643214f92.
Command line revert message is
commit f9c16b9368f9da50e820cc6f2355b487859f5182 (HEAD -> cGitRevert)
Author: Parashar Joshi <[email protected]>
Date: Thu Dec 5 13:06:21 2024 +0530
Revert "This is a multi-line commit message to test revert on Jgit & c-Git."
This reverts commit 1286a7ea850f01a47c63b09e42912f9643214f92.
Actual behavior
Revert commit message of Jgit & c-git are not the same
Expected behavior
Revert commit message of Jgit & c-git are same
Relevant log output
No response
Other information
No response
The text was updated successfully, but these errors were encountered:
Agreed; C git uses only the first line of the commit subject (i.e., the first line of the commit message). JGit uses the first paragraph (everything up to the first empty line (two \ns), with line feeds inside that paragraph replaced by spaces. That's the usual format, used also in git log --oneline.
But the C git sequencer (which executes the revert) trims that to the first line only. See https://github.com/git/git/blob/23692e08c638/sequencer.c#L496-L498 . find_commit_subject extracts that first paragraph into &subject, and returns the position of the first line feed.
Version
6.7.0
Operating System
Linux/Unix, Windows
Bug description
The Revert commit message of Jgit is not consistent with the command line git revert operation.
Jgit uses the full commit message in revert commit message where as the command line git uses just the first line of commit message.
While reverting a following commit with message
Jgit revert commit message is
Command line revert message is
Actual behavior
Revert commit message of Jgit & c-git are not the same
Expected behavior
Revert commit message of Jgit & c-git are same
Relevant log output
No response
Other information
No response
The text was updated successfully, but these errors were encountered: