We're using a git-flow style workflow, and we want to find out which pull request included changes to a given line of code.
Suppose we have the following history:
c---e---g
/ \
-a---b---d---f---h--- master
My pull request was merged in h
with commit message "Merge pull request #123".
If I do a git blame on the lines of code added in the pull request, it shows me e
, rather than h
.
12345678 (Wilfred Hughes 2015-02-02 15:22:40 +0000 402) # Some old code
e (Wilfred Hughes 2015-02-12 15:22:40 +0000 402) # Added in the PR, line 1
e (Wilfred Hughes 2015-02-12 15:22:40 +0000 403) # Added in the PR, line 2
56789012 (Wilfred Hughes 2015-02-26 17:24:18 +0000 404) # More old code
How can I find the merge commit for a given line of code in git?
(Note this is different from this related question as I'm starting with lines of code, not commits).