Commit messages with Oda

The DataMind Oda extension can write your Git commit message for you. It reads the changes you have staged and your repository's recent commit subjects, and writes a message into the commit box for you to review.

What the extension adds to your editor is on The Oda extension for VS Code.

Write a commit message

  1. Stage the changes the commit should describe.
  2. Open the Source Control view and choose Generate Commit Message with Oda in its title bar. The button is offered when a Git repository is open in your window.
  3. Oda writes the message into the commit box as it goes. While it works, the button becomes Stop Generating Commit Message.
  4. Check the message, change it if you want, and commit as usual. Oda does not commit anything for you.

What Oda reads

Oda keeps the subject within 72 characters. If the staged changes are too large to read whole, Oda trims the material it reads: up to 60,000 characters of diff in total and 20,000 per file. The parts it leaves out are marked: (diff not shown: <n> lines added, <n> removed) for a file it trimmed, and (<n> more changed files not shown) once the total is reached.

If something gets in the way

Messages from other parts of Oda are in Troubleshooting.

Questions, answered

Which changes does the message describe?

Only the staged ones. Stage everything the commit should describe before choosing the button; edits you have not staged are not part of the message.

Does Oda commit the changes for me?

No. Oda writes the message into the commit box; you review it, change it if you want, and create the commit yourself.

What does Oda read to write the message?

The staged changes and the repository's last ten commit subjects, in a single model call with no tools.

What happens if my staged changes are very large?

Oda still writes a message. It reads up to 60,000 characters of diff in total and 20,000 per file, and marks what it left out: (diff not shown: <n> lines added, <n> removed) for a trimmed file and (<n> more changed files not shown) once the total is reached.

Can I stop Oda while it writes the message?

Yes. While Oda is writing, the button shows Stop Generating Commit Message; choose it to stop. Text Oda had already written stays in the box; the box goes back to what it held before you started only when it is empty when you stop.

Can I change the message before I commit?

Yes. The message is ordinary text in the commit box; edit it or replace it freely before you commit.

Which repository does Oda use when several are open?

With several repositories open, Oda asks Which repository's staged changes? Pick the repository whose staged changes the commit should describe.

Oda says nothing is staged. What do I do?

Stage the changes the commit should describe, then choose the button again. Oda reads only staged changes, so there is nothing to describe until you stage something.

Why is the button not showing?

The button appears in the Source Control title bar when a Git repository is open in your window. Open the folder that holds your repository, and it appears there.

Why does Oda say the Git extension is off?

VS Code's built-in Git extension is disabled in your window, so Oda cannot read the staged changes. Turn the Git extension back on in VS Code and try again.

Oda wrote no message, or could not write one. What now?

DataMind Oda wrote no message. means the answer came back empty: choose the button again. DataMind Oda could not write a commit message: <cause> means the call failed and names the cause; try again, and restart Oda from VS Code if it repeats.