3 ms·
Here is how you can do this via the commandline for one or more lines: git log -L 40,50:app/models/user.rb
by jaredsohn 2y ago
Here is how you can do this via the commandline for one or more lines:
git log -L 40,50:app/models/user.rb
- sureIy 2y agoI think that will lose track of what you're really after if the function changes enough, or is moved to a different part of the file, or just moved out. Without tools that understand the code (e.g. AI) git alone can't keep track of changes the way humans do.
- jaredsohn 2y agoYeah, you're right. I did a little investigation before posting that and it seemed to handle some movement within the file but after looking at it more closely I see it is not fully robust (even within the same file it misses some earlier changes). This page provides some other techniques: https://tekin.co.uk/2020/11/patterns-for-searching-git-revision-histories https://tekin.co.uk/2020/11/patterns-for-searching-git-revis... but I think they have their own limitations.