Some commands are only available if point is inside a diff.
magit-diff-visit-file and related commands visit the appropriate
version of the file that the diff at point is about. Likewise
magit-diff-visit-worktree-file and related commands visit the worktree
version of the file that the diff at point is about. See Visiting Files and Blobs from a Diff for more information and the key bindings.
This command shows a log for the definition at point.
The function specified by this option is used by
magit-log-trace-definition to determine the function at point. For
major-modes that have special needs, you could set the local value
using the mode’s hook.
From a hunk, this command edits the respective commit and visits the file.
First it visits the file being modified by the hunk at the correct
magit-diff-visit-file. This actually visits a blob.
When point is on a diff header, not within an individual hunk, then
this visits the blob the first hunk is about.
Then it invokes
magit-edit-line-commit, which uses an interactive
rebase to make the commit editable, or if that is not possible
because the commit is not reachable from
HEAD by checking out that
commit directly. This also causes the actual worktree file to be
Neither the blob nor the file buffer are killed when finishing
the rebase. If that is undesirable, then it might be better to
magit-rebase-edit-command instead of this command.
This command jumps to the diffstat or diff. When point is on a file inside the diffstat section, then jump to the respective diff section. Otherwise, jump to the diffstat section or a child thereof.
The next two commands are not specific to Magit-Diff mode (or and Magit buffer for that matter), but it might be worth pointing out that they are available here too.
This command scrolls text upward.
This command scrolls text downward.