cursor icon indicating copy to clipboard operation
cursor copied to clipboard

[Bug / FR] : AI Review : "Diff with main" : allow selecting other branch to compare to (master, dev, prod...)

Open MarArMar opened this issue 1 year ago • 13 comments

I don't even have a main branch sometimes

MarArMar avatar Feb 24 '24 15:02 MarArMar

Indeed. Would be particularly useful for reviewing PRs. Currently I have to checkout PR, do a git reset <base commit> and then the "run on working diff"... not super practical

ldorigo avatar Mar 05 '24 08:03 ldorigo

Maybe I need some handholding here but I can't even figure out how to use this thing:

  1. I created a main branch.
  2. Checked out the branch I want to compare it to.
  3. Refreshed git context
  4. Pressed "Review Diff with Main Branch" Screenshot 2024-09-13 at 11 09 01 PM

and nada. Where do I tell Cursor which my main branch is?

AryanJ-NYC avatar Sep 14 '24 03:09 AryanJ-NYC

Same, to review a pull request, I need to check diffs against "dev" branch, not main

antopolskiy avatar Nov 20 '24 11:11 antopolskiy

🙏 Please!

nandastone avatar Dec 03 '24 00:12 nandastone

This would be nice.

mattstam avatar Dec 06 '24 18:12 mattstam

This would be so helpful

jim-at-jibba avatar Feb 04 '25 13:02 jim-at-jibba

👍

RuiSMagalhaes avatar Feb 20 '25 15:02 RuiSMagalhaes

Any updates on this? Still very interested in seeing it addressed.

xantorres avatar Apr 07 '25 18:04 xantorres

What does @Git even do in Cursor? The description on their website seems very vague. Can I tell the Agent to run diffs against any branch I select and then have the Agent compare the current state of the codebase with the selected remote branch?

chukZ avatar Apr 24 '25 00:04 chukZ

This seems broken atm. Even for a PR against main this does not work at all for me at the moment.

Repro case:

  1. Check out a feature branch and make some changes
  2. Go to Cursor Chat and type @branch Please review the attached diff against the main branch and tell me what I can improve
  3. See that Cursor's Agent doesn't actually seem to see the diff. Regardless of which model I try, it always starts by trying to manually get a diff via varieties of git diff -name-status main etc

fwiw the typical response I get is something like "I'll help review the diff, but I notice that no actual diff content was provided in the message. To properly review the changes between the current working branch and main branch, I'll need to see the actual diff content."

I'm on Cursor 0.5 on macOS 15.5

chapati23 avatar May 20 '25 13:05 chapati23

This is essential, comparison against main is fairly useless for most of my use cases. I generally need to compare against dev or a feature branch. So being able to select a branch is a big +1

marktsavage avatar May 30 '25 16:05 marktsavage

Hmm. A bit weird that such a tiny feature has been lingering for almost a year. Is there something else holding this feature back? I cant use the review feature if I cant do it against "dev". There must be so many user that cant use this feature.

Is there perhaps some kind of workaround that people are using?

bobmoff avatar Oct 30 '25 14:10 bobmoff

I definitely think this should be a configurable option.

Often the main branch especially for those not doing continuous integration into production/staging from main is done on a dev branch or a release branch - especially so for those still following gitflow practices and weekly releases which is still very popular.

The "Agent review against main" or "diff with main" is often useless in these scenarios.

jcampuza avatar Oct 30 '25 20:10 jcampuza