"Commit Changes" text generated by VCS
已回答
With the IntelliJ API is there a programmatic way to tell whether the "Commit Message" text in the "Commit Changes" dialog is generated by a VCS and not the previous content entered in that field (which is what it should normally be)? An example of such a VCS generated message is the one you get when trying to merge a Git branch: "Merge branch 'B1' of ..."
Thanks for helping
请先登录再写评论。
No, there is no way to identify this. Why do you need this? And what are the cases in which the behavior seems incorrect to you? Possibly, these are bugs which are to be fixed.
I'm working on a plugin that needs to overwrite the "Commit Message" field, but only in case the text is not provided by the VCS. Can this behavior be implemented?
I've noticed that the default behavior is that of caching the edited commit message when the dialog is closed and using it when the dialog is opened again. Yet, I found a case in which the message is not saved and the previous commit message is used instead of the last one, but I don't know if this is a bug or expected behavior. Here are some steps to reproduce it:
1. Use an IntelliJ project that contains several (more than one) files with changes
2. Open the "Commit Changes" dialog (right-click on project -> Git -> Commit Directory...)
3. Change the content of the "Commit Message" field
4. Unselect some of the changed files, so that some of the changed files will not be committed
5. Commit the selected changes
6. Open the "Commit Changes" dialog again
7. Notice that the message edited in step 3 doesn't show up in the dialog. This would not have been the case if we had committed all the files.
Any idea if the above behavior is intended or maybe a bug?
It looks like https://youtrack.jetbrains.com/issue/IDEA-113049. We'll try to prioritize the issue.
It does indeed look like the same issue. Fixing this behavior would solve a bug in our plugin. Many thanks!