i'd like to know a algorithm which detect recent changes in the specified file as I'm learning git core architecture.
you know git log -n1 -- <file>
show the commit which has recent change in the specified file. it's very simple to know the latest change. I casually want to implement it by self.
i uses libgit2 to walk each commits. and i've taken some days but I can't understand it. git commit model using DAG like structure it's hardly to seek that for me.
[for example]
o---o---o---o---o---M--[HEAD]
`-o------M-o-o'
`-C-o-'
o means: a commit
M means: merge commit
C means: rechange change in the specified file
whats the best way to detect recent change in the specified file?