feedback icon indicating copy to clipboard operation
feedback copied to clipboard

[Bug] AI Commit Message includes "unstaged" changes, ignoring the staging selection.

Open seniorit opened this issue 1 month ago • 0 comments

AI Commit Message includes "unstaged" changes, ignoring the staging selection.

Change Type

  • [x] Bug fix
  • [ ] New feature
  • [ ] Improvement / Refactor
  • [ ] Documentation

Context / Affected Module

Gravity Editor (Beta) - Generate commit message functionality (Beta)

📝 Problem Description

The AI-generated commit message tool is not respecting the state of files in the staging area.

The AI-generated message is not based solely on the diff of files added with git add, but appears to take into account all files modified or added to the local repository (including unstaged or untracked changes). This generates a commit message that is semantically incorrect and does not correspond to the actual content of the commit being made.

👣 Steps to Reproduce

Make sure you have a local repository with changes.

Make one set of changes (Change A - e.g., image storage files).

Make another set of changes (Change B - e.g., permission management files, unrelated to A).

Add only the files from Change A to the "staged" area (git add ...).

Keep the files from Change B in the "unstaged" area.

Click the "Generate commit message (Beta)" button in the interface.

Behavior (Current)

The AI-generated commit message contains references to the files from Change B (unstaged files), resulting in an incorrect or misleading description of the staged commit.

Example Seen on Screen:

Staged Changes (Correct): Files under app/Files/DataImages (Image implementation classes and interfaces).

AI Message (Incorrect): feat: Implement image storage and enhance profile permission management with new services and enums.

Analysis: The message includes "enhance profile permission management," a feature not currently present in the staged files.

Behavior (Expected): The AI-generated commit message should be a concise and accurate summary that only describes the differences between the files in the staging area. Unstaged changes should be completely ignored to ensure the accuracy of the Git history.

🖼️ Visual Evidence of the Indicated Bug

Image Image

seniorit avatar Nov 22 '25 14:11 seniorit