tools to study source code using git history [closed]
Are there any recommended tools to study the source code of a git repository? My aim is to understand how has the code evolved with the incremental addition of new features to the code tha开发者_如何学运维t is in github.
I can click on "history" in github, but I was hoping to find some other git-related tool that would allow me to dig into the code in a bit more history-structured way.
Cheers
Just some idea's:
Firstly clone the repo you want to study, then use something like the following:
git log --pretty=%H
This will list the hash of each commit, then you can use the hash to get the diff between the the hash and the previous commit:
git diff HASH
By putting these into a script like this:
for HASH in `git log --pretty=%H`
do
git diff ${HASH} > ${HASH}.diff
done
You can study what change was made at each point. Using various git log -1 --pretty=FORMATSTRING HASHOFCOMMIT"
you can get also sorts of information out of a commit. You can also use commands like git blame filename
to see the commit and author of each line of a file.
As per Jed's comments, don't forget gitk (works on both Unix and Windows).
精彩评论