Skip to content

Fix commit message truncation and enable auto-execution for /git:commit#24

Merged
samucodesh merged 3 commits into
mainfrom
fix/double-quotes-truncation-auto-exec
May 17, 2026
Merged

Fix commit message truncation and enable auto-execution for /git:commit#24
samucodesh merged 3 commits into
mainfrom
fix/double-quotes-truncation-auto-exec

Conversation

@samucodesh
Copy link
Copy Markdown
Owner

@samucodesh samucodesh commented May 17, 2026

Summary

This PR addresses two primary issues with the /git:commit command that were degrading the
user experience and causing data loss in commit history.

  1. Commit Message Truncation: Previously, the AI might include double quotes (") within
    the generated commit message. When the command was constructed as git commit -m
    "...", the shell would treat the first internal double quote as the end of the
    message, leading to truncated logs.
  2. Lack of Auto-execution: Despite instructions, the extension often defaulted to
    providing a text block for the user to copy-paste rather than executing the commit
    directly.

How to Verify

  1. Stage a few files in a test repository using git add.
  2. Run the /git:commit command.
  3. Verify Auto-execution: The command should now invoke the shell tool and complete the
    commit without asking you to copy-paste a command.
  4. Verify String Integrity: Force a scenario where the AI might want to use quotes
    (e.g., by including a note like "referencing 'new' logic" in your changes). Check the
    resulting git log to ensure the message is not truncated and uses single quotes.

Related Issues

Closes #23

Type of Change

Please select the type of change that applies to this PR:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactor (code change that neither fixes a bug nor adds a feature)
  • Documentation (changes to documentation)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Chore (maintenance tasks, build process, etc.)

Checklist

  • I have performed a self-review of my own code.
  • I have updated the documentation accordingly.
  • My changes generate no new warnings.

Screenshots/Video

image

Update the /git:commit command to automatically execute the git commit command after generating a conventional commit message. This improves efficiency by eliminating the need for manual command execution.

- Update description and task to reflect automatic execution
- Add strict constraints against double quotes in subject and body to ensure shell safety
- Remove the manual command execution output block
Update the README to clarify that the extension avoids both backticks and 'double quotes'. This documentation change aligns with the recent logic updates intended to prevent shell command truncation and potential execution errors in the CLI.
@samucodesh samucodesh self-assigned this May 17, 2026
@samucodesh samucodesh added bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request labels May 17, 2026
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the git commit command to automatically execute commits and introduces stricter safety constraints by prohibiting double quotes in commit messages. Feedback suggests restoring the closing tag to maintain XML structure and re-including the instruction for a blank line between the subject and body to ensure compliance with the Conventional Commits specification.

Comment thread commands/git/commit.toml
Comment thread commands/git/commit.toml
Ensure that commit messages generated by the tool follow the
Conventional Commits specification by explicitly instructing the model
to separate the subject and body with a blank line.

- Explicitly require blank line separation in body formatting
- Fix template syntax by adding a missing closing tag
@samucodesh samucodesh merged commit 97ec0df into main May 17, 2026
@samucodesh samucodesh deleted the fix/double-quotes-truncation-auto-exec branch May 17, 2026 21:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Commit message truncation due to unescaped double quotes and missing auto-execution

1 participant