1

I get a patch using command:

git format-patch -1 --numbered-files --unified=100000 -o tmpdir commit_sha1 --file_name

Now I'm interested in a specific line from a specific file from the patch. I want to see the change history of this line. I could use the git log like this:

git log -L10,10:file_name

But the problem is that the line number in the patch does not match the line number in the original file.

Is there any way to get git log of line from a patch?

Maria
  • 21
  • 3
  • `git log` works with commits. To make `git log` works with a (series of) patches you have to apply the patches to produce commits. – phd Jul 06 '20 at 12:41

1 Answers1

0

I'm not sure I understand what you are looking for.

If you want to see what commits "touched" a line when you know the content of that line, you can use -G :

git log -p -G 'pattern' -- file_name
LeGEC
  • 46,477
  • 5
  • 57
  • 104