I searched for the following functionality but didn’t find an easy way of doing it, so I’m opening this “feature request”.
Sometimes, when reviewing a pull request, one may want to see the previous commits that affected one of the modified file - i.e., do a
git blame on the previous commit of the pull request. For instance, in cas of a bug fix pull request, this may help identify how the bug was introduced, see the surrounding code and modifications, ask the author about it etc.
Right now, on GitHub, this can be viewed by navigating to the file in the master branch (or whatever “parent” branch), and accessing the blame view. This is a lot of clicks for something that might be interesting.
A---B---C---D---E dev \ \ `-F---G---H---J PR
The feature would work by having the possibility to do a blame on the “parent” commit of the pull request. This “parent” commit can be:
the commit from which the pull request originally branched out: A in the above example;
the latest commit of the “parent” branch (the branch in which the author wants to merge its pull request - generally something like master, dev…) that has been merged in this pull request: C in the above example;
the latest commit of the “parent” branch, even if it has never been merged in the pull request: E in the above example.
With a net preference for the second possibility. The only difference with the standard blame view is that it would only be shown on original lines of the file, i.e. the unmodified lines and the old, suppressed lines.
Of course, all of this is doable on Git, or manageable with GitHub by following the correct commit path. But it’s quite a convoluted manipulation.
Thanks in advance for any kind of answer!