0

How to find the exact commit id for deleted line of code under specific subroutine or function(As I have similar line of code in the same file under another functions). I have tried out with below command: git log -c -S"deleted line of code" -L "/^def functionName {/,/^}$/":file/path/filename.ext but somehow it is giving me results only for log range (-L) for subroutine. Though i can go through the results and able to find commit id in which the line of code was deleted manually, but i want to integrate the logic in a python script so need to find the exact data only through command. Kindly help. Thanks in advance.

  • https://stackoverflow.com/q/4404444/2303202 – max630 Jul 17 '17 at 11:11
  • when there are refactorings involved this is not trivial to automatize, some manual is still needed – max630 Jul 17 '17 at 11:13
  • @max630 Thanks for sharing a link as above.. i have already gone through that one before but seems not working for me as in my case same line of code is present in many subroutines so i have to limit the log output for same. Yes agree manually we can find it easily but i need to automate this scenario. – Prachi Nayak Jul 20 '17 at 04:59

0 Answers0