dkandalov / limited-wip

IntelliJ plugin to limit your work-in-progress
https://plugins.jetbrains.com/plugin/7655
111 stars 7 forks source link

TCR option to do "quick commit" when tests pass #15

Closed dkandalov closed 5 years ago

keraton commented 5 years ago

Hi, I prefer to be able automatic commit when tests pass, no need to do anything

dkandalov commented 5 years ago

Yes, this is what "quick commit" is about :)

keraton commented 5 years ago

Oh ok, I look a bit the code, now I understand what you mean. Here tested some modification in your code

fun openCommitDialog(changes: List<Change>? = null) {
    ApplicationManager.getApplication().invokeLater({
        val actionEvent = anActionEvent(changes)
        QuickCommitAction().actionPerformed(actionEvent) // Use the QuickCommit ☺️
    }, ModalityState.NON_MODAL)
}

And it works nicely except for the commit message. => 0, 1, So what is your plan ? Maybe I can help you with this.

dkandalov commented 5 years ago

No exact plan but I was going to give a try tomorrow.

Yes, this is the problem with QuickCommit it takes last message and adds a number to it. Maybe it's worth dropping this functionality and just use the last message.

But then the question is how to specify any meaningful commit message when in TCR mode 🤔

keraton commented 5 years ago

Hi I think you can do it like this :

dkandalov commented 5 years ago

Sorry it took me a while to look at the issue. It's strange that you don't get message when doing quick commit. I cannot reproduce it. Which IDE and version control system are you using?

For now I replaced "Open commit dialog on passed test" with "On passed test" dropdown with the following options:

I also made quick commit use the last message as it is (without numbers). Might make it configurable some time later to be "last commit", "change list name" or "current task name".

keraton commented 5 years ago

I think the issue is when i commit directly with git in command line

dkandalov commented 5 years ago

The feature is available in plugin version v0.3.2.