3

I need to list the signatures of all the methods that were changed (updated, deleted or added) in a commit.

For example, the methods that were changed in this commit are:

  • br.ufrn.ase.Classe1.metodoB(int b)U
  • br.ufrn.ase.Classe1.getV()D
  • br.ufrn.ase.Classe1.metodoadicionado()A
  • br.ufrn.ase.Classe2.metodoQualquer(int i)A
  • br.ufrn.ase.Classe2.outro(int j)A

How can I produce such a list? Is there some tool that will do the job if I pass the blob content to it?

I'm developing in Java, but the tool doesn't need to be in Java, I can save it in a file and pass along to the lib.

jub0bs
  • 60,866
  • 25
  • 183
  • 186

1 Answers1

0

I managed to do this by using the output of git blame, of the commit in question and his parent, to pick up the line numbers that have been modified and then I made a parse using ASTParse (jdt) to calculate which are the boundary lines of each method. Finally I just do a search passing the number of the lines that have changed within the range of each method and I have the methods changed in a specific commit.