+6

Add support for Artificial Intelligence in generating commit messages

Adhoniran Gomes 1 year ago updated by Daniel Siegl 4 months ago 14

This is a meta-issue. When voting, please include your favorite platform (or just upvote other comments for that platform). Also, comment if this process must work locally (which may not be possible with the current LLM technology today).

JetBrains IDE's Git tool is capable of using an AI Assistant to generate commit messages powered by Artificial Intelligence. All changed files are listed and I can select the files to include in the commit message to be generated, as staged changes. After confirming, the AI Assistant analyzes the changes and automatically generates the commit message. This is a useful time saver and boring task killer that I would love to have available in SmartGit features.

Ref.: https://blog.jetbrains.com/idea/2023/06/ai-assistant-in-jetbrains-ides/

Below are some examples of commit messages generated through artificial intelligence:

Refactor handling of config file and enhance port validation regex

This commit updates the handling of a configuration file in the 'circuitid.py' script.
Previously, the file was only opened for writing but now it's also being opened for reading directly after it's written to. This is done to ensure that the configurations are properly loaded.

Furthermore, the regular expression used for port validation was updated. The previous pattern did not limit then length of the port and accepted any string that started with letters followed by numbers. Now, the port requires being 2 to 16 alphanumeric characters long, which helps standardize the port labeling system.

Refactor circuit ID generator for better readability and performance

Updated the circuit ID generator Python script to improve code readability and performance. Major changes include breaking down functionalities into smaller, more manageable functions and translating comments from Portuguese to English to make them accessible to a wider audience. Additionally, the procedural code was refactored to an object-oriented model wherein functions were encapsulated within a class, CircuitIDGenerator. Variable names were also updated for clarity. These changes help improve maintainability of the code and provide a clearer structure for understanding the logic behind circuit ID generation. The script also now checks if it is run as the main program before creating an instance of the CircuitIDGenerator class to start the application.

Commit dialog Improve Git commands

I would live to have it. I use copilot and gpt on daily bases. I would say I'm getting AI dependent even on my steaks effort estimations. Im a very granular committer. Have an AI to give me the right committ messages would be outstanding.

+1

I completely agree.
Moreover, this functionality already exists in Visual Studio code and It's awesome

Image 833

I also very much agree. The AI commit messages generation is very nice. Lately I've been loving VScode's AI commit generation feature. Of course, it is not fully functional yet and may require modification. I think it would be cooler if there was a function for the user to provide feedback to the AI to further modify the commit message or to provide a commit message template in advance.

For what kind of projects do you use AI commit message generation - open/closed source private/own/company, employer repository?

There are two reasons why this feature may not be available in my company. The first is because the company prohibits the use of AI that requires transmitting source code to external parties for security reasons. Second, the company's project has a template for commit messages that everyone must follow, and currently vscode AI does not have the function to create a commit message that matches the template.


Nevertheless, this feature provides me with great convenience when I am working on personal or test projects. When I work on such projects, I often write rough commit messages, but ai generates better commit messages than that. Also, I sometimes look at the commit messages generated by AI and review the code again. This makes me feel like AI is doing a code review.

Do I understand you correctly, that you are using the AI in your personal/test projects to fine-tune the human language of your commit messages?

For my personal and test projects, after writing or modifying code, I use VScode's AI feature to automatically generate commit messages. Then I push the completed commit.

However, sometimes when I look at the automatically generated commit messages, I realize that I've made mistakes in my code modifications. In such cases, I revise the code, generate a new commit message, and push it again.

In JetBrains AI the commit is generated but you can select the files to commit, then after create the commit you can review, modify, replace... then you have full control about the commit created.

It's an example using Goland JetBrains IDE for Go programming language.

Image 867

This commit text is the output after clicking the little purple spiral button beside "Amend" checkbox...

I see the solutions with public cloud services very problematic for none open source projects.

How would it be able to comply with ISO27001 with such a setup?

https://www.itgovernance.co.uk/iso27001

Can you be more specific?

What exactly are you referring to in relation to ISO 27001?

I think, either not saving information grabbed from the IA or ask for agreement should be enough.

But anyway this exists in Visual Studio code through GitHub Copilot so solution exists

Ofcourse...


I don't know how is now, but the JetBrains implementation were better than CoPilot.
CoPilot were very limited!!

I think that cost/beneficy implementation is to supports some populars LLM and each user contracts the LLM service directly to the provider.

To use the feature the user put your Token (as implemented for Github, for example).

Sound like very crazy?

We are investigating - but can't promise anything right now