IntelliJ IDEA 2018.1 EAP: Partial Git commits and more

It’s time for our next IntelliJ IDEA 2018.1 EAP build with all its shiny new features. We encourage you to download the new EAP build from our website, or make an update via the Toolbox App.

First of all, the upcoming IntelliJ IDEA 2018.1 supports partial Git commits (git add -p). Starting with this latest EAP, the IDE commits only selected changes from the file and skips all other changes.

You can include code chunks into a commit using the checkboxes in the Diff pane of the Commit Changes dialog.

Screen Shot 2018-02-20 at 11.57.53

Additionally, the IDE now provides the ability to associate the code chunks, not the whole file, with a changelist, and track them separately. Code chunks can be quickly moved between changelists using the Move to another changelist action which is available from the context menu of the Diff pane in the Commit Changes dialog.

Screen Shot 2018-02-20 at 12.00.20

Alternatively, you can add code chunks to a changelist right from the editor – click on a change marker in the gutter. In the pop-up which appears you can choose from the available changelists or create a new one.

We plan to publish a dedicated blog post about the support for the Git partial commit feature as soon as possible. Stay tuned!

With the upcoming IntelliJ IDEA 2018.1 you can choose how to display your local changes by grouping them according to their: directory, module or repository with the new Group by icon, available in the Local Changes tab in the Version Control Tool Window. Previously the IDE only allowed you to group or ungroup your local changes simultaneously by directory and module. Now you can select one of the grouping options or all three at once if needed. Please note that grouping by the repository will only be available when you have 2 or more roots configured in your project.

Screen Shot 2018-02-15 at 18.39.32

Postfix code completion enhancements

The upcoming IntelliJ IDEA 2018.1 has had improvements made to the postfix code completion. The IDE now provides the ability to define the custom postfix Java templates at Preferences | Editor | General | Postfix Completion.

You can now create your own Java templates or edit and rename some of the predefined Java templates.

Screen Shot 2018-02-19 at 18.33.35

postfix

The IDE now also provides the .arg postfix completion that wraps an object with a method call.

In other news, the Kotlin plugin bundled with the IDE has been updated to v1.2.30-eap-60.

For the complete list of changes, please refer to the Release Notes.

We’re very excited about these new features, and we hope that you’ll find these improvements useful. Give this new build a try and share your feedback with us in our discussion forum, issue tracker or twitter.

Happy Developing!

About Zlata Kalyuzhnaya

IntelliJ IDEA Marketing Manager at JetBrains. twitter: @ZlataKalyuzhnay ‏
This entry was posted in EAP Releases, New Features and tagged . Bookmark the permalink.

37 Responses to IntelliJ IDEA 2018.1 EAP: Partial Git commits and more

  1. Hi, thank you for new features. My only concern is that this is not partial staging support, but hunk staging support. Is it correct to say you can only stage complete hunk, not just specific lines? E.g. in vscode you can stage individual lines, which is very useful.

  2. nice says:

    Nice, used git add -p just this week.

    I often also delete stuff before commiting to make cleaner commits and then undo after commit 😛

  3. Max says:

    Checkboxes, ohrly? Guys, I realize you want to show a unified VCS view, but until you really embrace the index and realize that staging and committing are separate actions, this issue will not be solved satisfactorily.

    Eclipse had this right several years ago (and coincidentally is the only thing I sorely miss after having switched). I would love to see a proper visual index view in IntelliJ, that would let us stage lines, hunks or whole files and additionally diff either way (workspace/index, index/HEAD) with full editing support, just like Eclipse does. With proper staging support, you would not need third party git clients like GitKraken any more.

    • Dmitriy Smirnov says:

      Please clarify where exactly in your workflow you need the index?

      What scenario it allows you to use that is not possible using IDE UI with proper add -p support?

      • Mike says:

        IntelliJ should show me files that are changed that are staged and not staged for commit separately. I was actually very surprised that IntelliJ did not do this already (recently went to a new team that uses git)

        • Tagir Valeev says:

          I usually move files which I don’t want to commit to the separate changelist. This is even better, as with git you essentially have only two changelists (staged/not staged), while in IDEA you may have as many changelists as you want: like staged; not staged; some side bug fix which I postponed, but may stage tomorrow; etc. Are you using many changelists in your everyday work?

  4. Sebastian says:

    With git add -p you can also only stage complete hunks unless you go into edit mode and select the individual lines manually.

  5. Bruce says:

    Hi, the Rest Based Editor is a cool feature that I think deserves a lot of attention as well, basically I think there are many of us wanting to replace postman with it completely, do you plan on adding more features to it?

    • yunti says:

      Similar, I would love to be able to replace Postman with it, so it would be great to know what the future plans/roadmap is for this feature.

    • Maxim Kolmakov says:

      We continue developing REST client and recently we’ve added “assertions support” (see https://blog.jetbrains.com/phpstorm/2018/02/phpstorm-2018-1-eap-181-3494-16/) and support for JS code (see https://blog.jetbrains.com/phpstorm/2018/01/phpstorm-2018-1-eap-181-3263-18/). Those features available in IntelliJ as well.
      What would you like to see implemented? Which missing features stop you at the moment to replace Postman?

      • Andy Pahne says:

        To me the REST client is the most exciting addition to IntelliJ in the last two years. I am closely watching it since I know about it and my immediate thought about it was, that it could well replace the dreaded Postman at some time. But I think that it is not quite there yet.

        Here’s what’s missing, highly opinionated, of course:

        It lacks some essential usability features. I have to select an environment each time I execute a test. A simple dropdown to make my selected environment permanent for my session would be appreciated. Can I define suites? Can I define a “global” section in the environments definition? Key bindings for REST client actions are only partially possible.

        Then the REST client is not as highly integrated as other test features. For example, there are no run configurations to share. “Rerun last test” ignores REST client tests completly.

        Another thing is continous integration. If we are going to invest in creating a REST client suite, then we need the ability to integrate this suite into our CI. There are many ways to do this, one could be to provide a maven plugin that plays well with the maven report plugin.

        Please keep it up. I am looking forward to the day when we can really replace Postman as a development and testing tool.

  6. Michel says:

    Hi,
    Thank you also for the option to log Stacktrace to console on breakpoint!
    It’s very useful.

  7. Marcus Brito says:

    Why do you guys hate the git index so much?

    • Dmitriy Smirnov says:

      Please clarify where exactly in your workflow you need the index?

      What scenario it allows you to use that is not possible using IDE UI with proper add -p support?

      • Mike says:

        Supporting git add -p has nothing at all to do with supporting the index. I want to see files that are changed but have and have not been added to the index.

        I have no idea why you think supporting “git add -p” somehow erases the need for showing us the index.

        • Dmitriy Smirnov says:

          So what is your workflow behind this? How exactly you use index?

          If the scenario is “I put to the index the changes I am ready to commit” – changelists allow the same.

  8. Brice says:

    I would agree that a complete support of git would be better, I recently found myself editing the staged hunk because the added line was incorrect. So I think this would be useful although I don’t know how many would use this advanced staging / index actions.

    However “just” un/staging lines, may appeal to many more developers. Please do it :)

    However thanks a lot for working on this !

  9. Peter says:

    Hi,

    why is https://youtrack.jetbrains.com/issue/IDEA-160208 not in the EAP? When is this feature planned?

  10. Kyle Wood says:

    How is IDEA-64024 (git submodules) still not implemented? It nearly has 800 thumbs up now, and it’s been 7 years.

    • Dmitriy Smirnov says:

      Git Submodules can be used when registered as a separate root. Is there any specific issue with submodules you have in mind?

  11. Jeff says:

    Hello! I believe you guys need to update the bintray kotlin gradle plugin to avoid warnings with this EAP. The latest version in bintray is 1.2.30-eap-47 but it seems that the IDE uses eap-60. Note that the following exists:

    https://dl.bintray.com/kotlin/kotlin-eap/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.30-eap-47/

    but this does not:

    https://dl.bintray.com/kotlin/kotlin-eap/org/jetbrains/kotlin/kotlin-gradle-plugin/1.2.30-eap-60/

    Has the location for the eap plugins changed?

  12. Kent Ross says:

    The partial commit feature is cool. HOWEVER, when I select one or more specific files from local changes, then right click -> Commit, it now shows the selected files only briefly before selecting every current change regardless. I am constantly accidentally committing many files when I wanted to only commit one or two and having to undo-redo. This is a non-trivial usability regression from IDEA 2017.3.

    Reproduction:

    1. Have a git repo with files A, B, and C.
    2. Modify all three files, see that they appear in the Local Changes list in the Version Control tool window.
    3. Select the file A, right click it, and choose Commit…
    4. The commit Changes dialog will have all three files selected with all changes included in the commit to be made. Desired behavior: Only the file(s) that were selected will have their changes included in the commit.
    5. Cancel the commit, select files A and C, and repeat step 4, observing that once again file B is included in the commit.

  13. Dmitry says:

    Thanks for the partial commits! I’ve been waiting for them for a long time.

  14. Kieran says:

    Partial commits are great, been using Mercurial’s crecord plugin for years.

    So is this going to be rolled out to Mercurial too?

  15. Jessy Williams says:

    Hey, just want to say thank you to your team for this great feature! Also, I was wondering whether there is or will be a way to stage/unstage individual lines vs. just hunks?

    Thanks again!

  16. Anton Chepurov says:

    > You can include code chunks into a commit using the checkboxes in the Diff pane of the Commit Changes dialog.

    Only works in “Side-by-side viewer” Diff mode. Having to switch from convenient “Unified viewer” mode to inconvenient “Side-by-side” just for commit individual lines/hunks is… how to say… against the very idea of IntelliJ IDEA of being convenient, isn’t it?

  17. Pingback: CLion 2018.1 is released: more C++17, WSL, CMake Install, new languages supported, and much more! | CLion Blog

  18. Frank says:

    I just tried 2018.1 and 2018.2 EAP and I don’t see the checkboxes in my gutter for partial hunk commits.. And it’s not in the commit dialog box either. Could someone point me in the right direction? Thanks

Leave a Reply to Max Cancel reply

Your email address will not be published. Required fields are marked *