Search code examples
gitintellij-ideaidepycharm

How to continue "creating" a commit after TODO review or jump to source in IntelliJ Idea?


This is getting very annoying so I assume I just do something wrong.

The problem: I spent some time carefully choosing what exactly to commit (git), writing the commit message, selecting the author. When I press commit and I get Before Commit hook/inspection that notifies me that I have some TODOs files about to be committed. Fine, I fix this and now what? I open commit menu (Ctrl+K) again, and nothing is saved apart from the message! Same if I decide to jump to source for some file to apply some fix or to just examine it more closely.

There is definitely something wrong here, since I don't see how this can be though as productive and none other git tools/git cli behave like this.

Note that I'm not against pre-commit inspection (I know how to disable it). I want it. I just want to resume the commit from there I left off.

Edit: another similar situation - the commit failed for whatever reason. I'd like to just repeat it changing few small things. But Idea forgets about it. I need to go through whole process again.


Solution

  • Update Feb 2023:

    Since version 2020.1 IntelliJ features a Commit Toolwindow as the main interface for committing (for git). With the Toolwindow (non-modal commit interface), Code analyses and ToDo checks can be reviewed without cancelling the entire commit process.


    Old reply:

    Unfortunately, TODO/ Code analysis review from commit dialog closes the dialog and there is no way to continue it. There is a request to allow this - https://youtrack.jetbrains.com/issue/IDEA-126948, see also related.

    However, commit message should be saved in the process. If it does not happen, there is probably some bug. List of selected files/chunk is not saved - see https://youtrack.jetbrains.com/issue/IDEA-106867 and related