0

In Magit it is easy to see what difference a local file has compared to its checked-in version (HEAD).

However once I received changes from others (via magit-pull), I would like to see what changes they contributed. How can I see these changes?

What I have tried:

  • Once I received a change, it shows up as a commit in the main magit: <name> buffer.
  • I then move the cursor to this commit and hit return.
  • In a new window this commit opens. It has a section " files changed" with the filenames of all changed files.
  • I move the cursor to, for example, the file utils., which is one of the files I am interested in seeing the differences this commit contributed, but I cannot "expand" the differences via pressing "Tab". (Plus, hitting "Enter" just takes me (as normal) to the file buffer of that filename.)

How can I see the changes the commit made to this file?

More details

Here some screenshots.

The relevant portion of the magit: <name> buffer looks like this:

magit buffer

I move the cursor to the commit line "3e1a51d origin/master Merge branch...". In that line I press Enter and get to the magit-revision buffer:

magit-revison

Here I move to the "WebContent/quick_guide.jsp" line and want to see the changes of the external commit. How can I see them? (Neither pressing j or Enter gives my the diff.)

It is to note that I can use j to see the changes on files in commits I've done myself.

8
  • The commits obtained via magit-pull are not different from the commits you commit, the file changes should all be viewable in the way you tried. I think there is a problem somewhere, I suggest sharing a screenshot of the magit-revision: <name> buffer after pressing enter. Commented Apr 19 at 5:18
  • "In a new window this commit opens" -- underneath the list you've mentioned, that buffer contains all of the diffs for all of the files in that commit. This should be extremely obvious, and yet you make no mention of it, so are you saying you do not see any diffs? Assuming they are present as is normal, you might prefer first using M-1 to collapse all of the file sections before expanding the file(s) of interest.
    – phils
    Commented Apr 19 at 8:05
  • @TianshuWang I have added screenshots to the question.
    – halloleo
    Commented Apr 22 at 5:00
  • @phils Yes, indeed, I don't see any diffs, only the files which allegedly have changed. I have added screenshots to clarify the question.
    – halloleo
    Commented Apr 22 at 5:01
  • You haven't configured some non-standard diff tool for git, have you? (You need Git to be feeding Magit standard diffs.) Failing that, do git diff and git diff --cached in a shell present the appropriate standard diffs?
    – phils
    Commented Apr 22 at 5:29

1 Answer 1

0

In the list of changed files, press j on the file you want to jump to. It invokes magit-jump-to-diffstat-or-diff which does exactly what you need.

2
  • When I press j I get the error "No diffstat in this buffer".
    – halloleo
    Commented Apr 22 at 4:43
  • I have added screenshots to clarify the question.
    – halloleo
    Commented Apr 22 at 5:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.