14

Is there a way to bring up a big list of the differences between specific commits across two branches?

I tried the method described in this answer but it came back empty, I assume because the revisions are on different branches.

I'll happily use another method if magit isn't right.

As clarification, this is the result I get from running d r from magit-status on the range 368513582b027bfde77cb2e9e43eace1b6f5336c..53ebfb70079bb5bc411fd0f8853673c2c5eb0589 which are across two branches (master and WW-pilot) and the branches are very different.

empty diff

Matt Ellen
  • 355
  • 1
  • 4
  • 12
  • 1
    The linked answer is exactly the solution you want. Just use the two commit refs in question as START and END (or you can use the branch names, if you want to compare the heads of two branches). You'll need to describe the problem in more detail if that isn't working. (You can do this on the command line as well with `git diff START..END` but that's no different to doing it in Magit.) – phils Feb 28 '19 at 21:29
  • I've described as best I can. I put in the two refs and the window comes up saying empty. I'll add a screenshot in a bit. – Matt Ellen Feb 28 '19 at 21:34
  • I would assume that there are indeed no differences between the two refs that you gave it. Unless you have the "limit to files" filter enabled? Do you get a different response from the command line? – phils Feb 28 '19 at 21:36
  • I would be worried if there were no differences as they are very different branches (for example, completely different login methods). I will try a different diff method on a single file from the revisions to see what's up. – Matt Ellen Feb 28 '19 at 22:01
  • Does using git diff on the command line show differences? – InHarmsWay Mar 02 '19 at 14:16
  • `Git diff` doesn't work for me as it can't find kdiff. – Matt Ellen Mar 02 '19 at 17:41
  • Do you have `GIT_EXTERNAL_DIFF` set to `kdiff`? Or maybe in `git config diff.external`? Or it could be coming from .gitattributes. Maybe try `git diff --no-ext-diff`. – scott Mar 22 '19 at 09:58
  • You might also be interested in [git-range-diff](https://git-scm.com/docs/git-range-diff): “Compare two commit ranges (e.g. two versions of a branch)”. (Requires a relatively recent version of git(1).) – Guildenstern Apr 15 '19 at 16:05

2 Answers2

14

I think that the command you're looking for is magit-diff-range. Being on some branch, hit M-x and magit-diff-range. Then, when prompted, enter the name of the other branch and you will get a buffer with diffs.

2

Git diff doesn't work for me as it can't find kdiff.

I don't know why git diff would need kdiff (whatever that is), but if git diff does not work on the command line, the various magit-diff-* commands also won't work because they get the diff by running git diff too.

It appears to me that you have misconfigured Git. You can probably fix that by running git config --unset diff.external and/or git config --global --unset diff.external.

tarsius
  • 25,298
  • 4
  • 69
  • 109