Using git cli I would execute
git diff SHA#1 SHA#2
How does one do the equivalent in magit?
Emacs Stack Exchange is a question and answer site for those using, extending or developing Emacs. It only takes a minute to sign up.
Sign up to join this communityUse the diff range command with the ..
syntax:
dr SHA#1..SHA#2
Refer to the git diff man page:
git diff [--options] <commit> <commit> [--] [<path>...]
This is to view the changes between two arbitrary <commit>.
git diff [--options] <commit>..<commit> [--] [<path>...]
This is synonymous to the previous form. If <commit> on one side is omitted,
it will have the same effect as using HEAD instead.
git diff [--options] <commit>...<commit> [--] [<path>...]
This form is to view the changes on the branch containing and up to the second
<commit>, starting at a common ancestor of both <commit>. "git diff A...B" is
equivalent to "git diff $(git-merge-base A B) B". You can omit any one of
<commit>, which has the same effect as using HEAD instead.
Note that you can type both commits with completion (but you have to type the ..
before completion for the second kicks in).
If both commits are near each other in some Magit buffer, then it might be convenient to mark them using the region and then pressing d d. With such an active region "diff dwim" assumes that you want to compare the commits at the edge of the region.
d r works always. It might just be a bit annoying to type or copy-paste hashes.
y
when in the logging screen. Useful for big code bases that use version tagging. Allows me to diff between versions. So yes, using this alternate method can be very useful.