Help
cancel
Showing results for 
Search instead for 
Did you mean: 
Ground Controller Lvl 2
Message 1 of 4

[Feature request] Show previous git blame of a pull request

Hello!

 

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! :)

 

3 Replies
Moderator
Message 2 of 4

Re: [Feature request] Show previous git blame of a pull request

Hi @Jimvy ,

 

Thanks for this feedback! We're always working to improve GitHub and the GitHub Community Forum, and we consider every suggestion we receive. I've logged your feature request in our internal feature request list. Though I can't guarantee anything or share a timeline for this, I can tell you that it's been shared with the appropriate teams for consideration.

 

Cheers!

Highlighted
Community Manager
Message 3 of 4

Re: [Feature request] Show previous git blame of a pull request

Thanks for taking the time to write this request, please know we are taking a look.
Thanks for being here, sharing, and keeping our community awesome!
Best,
AndreaG

Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!

Community Manager
Message 4 of 4

Re: [Feature request] Show previous git blame of a pull request

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.

 

If I'm understanding you correctly, I think there's an easier way to do what you're asking already. I'm going to use an atom/atom pull request as an example:

 

  1. Go to the pull request
  2. Click the Files changed tab
  3. Pick the file you want out of the list (`src/text-editor.js` in this case)
  4. Click the ellipsis menu and select View file
  5. Click the Blame button

 

Since you may already be in the Files changed view when reviewing a pull request, this is mostly a matter of scrolling to the file you want, followed by three clicks, and a couple page loads. To get to the blame view of the file prior to the fix you're interested in, it's a matter of picking the appropriate line in the file and selecting the "View blame prior to this change" button:

 

Screen Shot 2019-06-07 at 9.04.21 AM.png

 

If the section of the file you're interested in was changed repeatedly in the same pull request, you could select an earlier commit in the pull request to start from and do the same thing. This allows you to control exactly where you're starting your search from since you probably have more understanding of the code base and the changes happening than any automated algorithm we could come up with.

 

We're still passing along the request, I just wanted to suggest a couple extra options 😀