I´d like to display the change log of a line in a file. The problem is that the command git log {commitHash} -p -1 -L 17,+1:{filePath} gives me the history of what is line 17 after the {commitHash}. What I want is the changelog of what used to be Line 17.
I´ve looked at the file and saw that after the commit Line 17 is now Line 20-22. So I tried git log {commitHash} -p -1 -L 20,+3:{filePath} :
commit {commitHash}
Author: {author}
Date: {date}
{commitMessage}
diff --git a/{filePath} b/{filePath}
--- a/{filePath}
+++ b/{filePath}
@@ -17,1 +20,3 @@
- <button type="button" class="btn btn-info" tooltip="someTooltip" placement="bottom" disabled>
+ <button type="button" class="btn btn-info"
+ tooltip="someTooltip"
+ placement="bottom" disabled>
What I want is basicly a command where I provide Line 17,+1 but get the result of the git log {commitHash} -p -1 -L 20,+3:{filePath} command.
Related Question: Retrieve the commit log for a specific line in a file?