Add "Diff of Staging Area" to @git command

Currently, the @git command provides two useful options:

  1. Diff with Main Branch
  2. Diff of Working State

These are great for quickly viewing differences between the current file and the main branch or the working state.

However, I think it would be incredibly beneficial to also include an option to view the diff of the Git staging area (eg. git diff --cached / git diff --staged). This would be particularly useful when asking the AI assistant to generate commit messages based on the staged changes, or just as a way to point Cursor to the diff of certain files.

By having access to the diff of the staging area, the AI can provide more accurate and contextual commit messages, taking into account only the changes that are currently staged for committing.

7 Likes

I have the exact same use case. Cursor is really handy in generating commits especially when combined with rules for ai. I would love to have an additional @Staged command since right now I am unstaging, using the diff context and then staging my changes again.

2 Likes

I would also love to see this implemented, for a very important reason: the working tree does not include new, untracked files. Therefore, there is no way (AFAIK) to ask Cursor to conduct a code review of a diff that includes new files.

The intuitive approach is to add everything to staging and ask Cursor to review the diff in staging.

3 Likes

Missing this feature almost everyday. Would love to see it implemented! :blush:

Also being able to diff the current branch against another branch than main, for example against dev would be great!

3 Likes

This would be incredibly helpful as it’s common to stage as we get to stable changes and don’t want to loose them.

I wonder if cursor teams have any plans to support this in the near future.

There is some detailed discussion of this in the git-commit feature request thread. IMHO this would be more useful than feature focussed on generating commit messages as there is quite a bit more that can be done with it.

See @gokcin’s comment on this thread and mine too.

2 Likes