I'm trying to figure out the best way to track the ways the lines in a given text file change from commit to commit, in hopes that I can give them unique IDs (which is a whole other hullaballoo for another time)...
Ideally, I'm looking for some sort of data equal to the visual representation in the change log view -- where I can easily see, ok:
- line 1 -> line 1
- line 2 -> line 2
- _____ -> line 3 NEW
- line 3 -> _______REMOVED
- line 4 -> _______REMOVED
- line 5 -> becomes line 4
etc etc
The change log visually contains what I'm looking for:
My knowledge of git & sourcecontrol is functional but this is definitely pulling me into the deep end and I haven't found anyone looking for this exact same thing (which makes me worry I might be taking the wrong approach but...)
What I've tried so far is git diff (--stat, --numstat) but have only found the amount of lines added and removed, as per this question about finding the # of lines changed with diff Somehow that led me to leaning about patch files, and seeing if I can pull the info out of there, which might be do-able if i write a thing to process and calculate the line changes (which might be what I end up having to do...)
Is there is a command line that goes to this level of change log detail? I can conceptualize how I could calculate this by iterating through each patch line, checking if an addition or subtraction has been made, and applying that to the count of the line, but first i thought i'd make sure it isn't doable with command.
thanks in advance!