I'm trying to figure out at which point a line in a file was introduced and in which commits it was changed.
I can view the history of those lines (line 10 in the file example.txt):
git log -L 10,11:example.txt
However, for each log entry it includes a 'diff' or a 'patch' (I'm not really sure of the difference yet) as if I'd run:
git log -p
This makes the output more difficult to read - I just want to view a list of commit messages and their ids for commits that changed the line(s) I'm interested in.
For example, ordinarily git logs can be simplified by using the --pretty formats, enabling us to read through a clean list of commit messages to find the info we're interested in. For example, I use the --oneline option frequently:
git log --oneline
That however shows the full log - we want to filter this to only show commits that changed lines of interest. Something like the following would be great but the pretty oneline format doesn't seem to work in combination with the -L flag:
git log --oneline -L 10,11:example.txt
I've tried various combinations of options and arguments from the git log documentation but haven't found anything that works.
Does anyone else face this issue or have any ideas of what could work?
Thanks for reading this far