groboclown / p4ic4idea

Perforce IDEA Community VCS Integration
Apache License 2.0
32 stars 11 forks source link

Submit enabled even with Empty commit message #52

Open thsaravana opened 9 years ago

thsaravana commented 9 years ago

"Submit" button should not be enabled when there is no "commit message". I checked both the Eclipse plugin and the P4V Client, both does not let the user Submit without a Commit Message.

groboclown commented 9 years ago

Thanks for the bug report. This is definitely an issue, because it causes the UI to allow an invalid checkin (causing an error). Unfortunately, IntelliJ doesn't provide an API hook into changing the submit button state, as far as I can tell. There is a flag that a user can manually set in the settings Version Control / Confirmation dialog for "Force non-empty checkin comments", but even that doesn't alter the behavior of the submit button state.

There might be an area of opportunity to change this behavior indirectly that I'm investigating, but I fear that it might not be supported for past and future versions.

groboclown commented 8 years ago

The new Idea 15 has been released, and I'm going to investigate whether this is easier to implement there once the 0.7.0 plugin is released.

groboclown commented 8 years ago

This still is really not possible. With some work, I could monitor the state of the comments text (the text is easily accessible, and the monitor thread wouldn't be too much effort), but then actually disabling the button would require all kinds of reflection magic that it would just scream fragile. I'll leave this open as an enhancement, and I'll see if I can work with the IntelliJ community edition folks to make this a new feature for future releases.

groboclown commented 5 years ago

Even now, in the IntelliJ 18.3 release, the IDE does not give any hooks into setting the state of the submit button based on the contents of the comment. I don't think this will ever be fixed by them. I'm instead going to just mitigate the issue as much as possible.

groboclown commented 5 years ago

The UI now reports the error without trying to perform the submit. Not great, but a bit better than before.