1

I need to get

  1. the changed files names
  2. for every added line, its line number

E.g. given this commit, I want to get compat/unsetenv.c and 5,6,7.

I was trying to use

git show <commit-id>

and do some dirty string matching on it. I can get away with a

| grep +++

for the file name, but I found no way of making git show the line number next to the + sign, as in the GitHub web interface.

Is there any other way to find the (added) line numbers?

Bart
  • 17,070
  • 5
  • 61
  • 80
laurids
  • 931
  • 9
  • 24

0 Answers0