Case
Quite often, I look at old code that doesn't look right. It seems that something has been deleted (for example, it has a loop that does nothing for the value, or creates a variable but does not use it), or something is simply hard to understand. In these cases, I really would need to look at the history of this section of the file. Not all files, though, only this section or function.
The perfect solution
A simple command like
git log books.cpp:10
to find the history of line 10 (possibly with the surroundings) of the books.cpp file, maybe too much magic to ask, but do you have any ideas on how to work out this story?
What i tried
I tried using fault, and then I check the commit before the given commit of this line - repeating it until I see enough. But this is a very tiring job.
Did you feel the need for this feature? Do you have a way to achieve this? Share your experience!
git
Joel
source share