AI-generated commit message

Is there any chance of having an AI-generated commit message directly in Source Control?:smiley:

10 Likes

Just for reference, I believe Aider git commits every accepted code suggestion. Not sure if that is desirable in Cursor, but interesting to know I think.

1 Like

i’m a huge fan of how Aider works in this respect. would love to see something similar in Cursor!

2 Likes

Thinking out loud, there are several prompt interfaces in Cursor:

  • Ctrl + L (interpreter and normal mode),
  • Ctrl + K (in Editor and Terminal)
  • Composer (Ctrl + I).

So first you would have to define in which scenarios the automatic git commit would be used.

And then you’d have to provide an easy way to undo those git commits (perhaps just using the default ‘discard changes’ button in the git tab would work).

I also know that when I use Composer, I am often approving one diff at a time whilst within the underlying file Editor area, so would need to specify if each of those accepted diffs would also be a commit or not.

So quite a bit to consider.

Perhaps @gbdr ‘s original request was for something simpler, just a ‘look at my staged changes and generate a commit message for me please?’

1 Like

exactly @litecode , I am referring to something like the copilot feature in VS Code - like in the screenshot
Screenshot 2024-07-28 alle 10.37.16

5 Likes

As a workaround (which might be implemented as a feature), I use

@commit followed by a prompt instruction in chat.

@commit Please generate a commit message that:",
“1. Summarizes the main purpose of the changes”,
“2. Follows best practices for commit message formatting”,
“3. Includes any relevant details about the implementation or impact”,
“4. Mentions any new files added or significant refactoring”,
“\nSuggested commit message format:”,
“<type>(<scope>): <subject>”,
“”,
“<body>”,
“”,
“<footer>”

Then I copy the result and paste it as the commit Message. I could probably automate this either using vscode extension or a keyboard meastro (mac application) macro, but it is just a few annoying clicks and I am curious what the cursor team comes up with as a solution.

1 Like

Hi @Malte ,

Out of interest, what is @ commit referring to?

I can’t see it in the docs for @ Symbols.

And I couldn’t see it mentioned in the docs for the @ Git symbol.

Is commit just a file in your folder with that prompt within it?

And you are @ 'ing that file?

(for reference, see here for more discussion on the topic of canned prompts)

In my chat it works… i type @commit and it defaults to @git->commit (Diff or working state). It does not work in inline editing. Not sure where this comes from if not from Cursor.

As for the canned response, interesting idea. so I could pipe the diff through to a piped response using another file which contains the prompt… hmmm… :slight_smile:

@shaoruu | @truell20 | @litecode

Hello everyone,

please add a function for AI-Commits (Auto-Commit / AutoComplete) for GIT.

As you can see for the CodeGPT plugin for VSCode, it has already implemented:

2 Likes

+1 for this

I was using copilot before and liked the one-click commit messages. It would be great to have this in Cursor. It would look at staged changes and describe what was done just by clicking the icon.

I think we have enough people to request this feature haha

1 Like

+1 for this. It’s a must :smiley:

It’s actually documented here, but I think a dedicated feature in the version control tab itself will be useful. There are other tools that can do that, like gitlens etc. but I believe cursor can do a better job.

Cursor - Build Software Faster.

1 Like

+1 from me too

+1 from me too

What you can try is to leave the commit message empty and press Commit button.

In my editor it opens then COMMIT_EDITMSG buffer in the Editor panel and since it’s an editor so the AI will suggest a message for the commit :raised_hands:t3: :laughing:

1 Like