Analyze forks network to find hidden gems
Analyze forks network to find interesting forks, commits, file changes.
gitinspector
and git_stats
. Use the tools in this repository as they have been modified to work across all branchesTips
below on how to search across the forks network using Git commands
git clone https://github.com/hbt/git-forks-analysis
cd git-forks-analysis
docker-compose pull
To generate HTML visualization of forks
cd bin
./analyze-forks username repository
# retrieve all direct forks for https://github.com/hbt/mouseless
./analyze-forks hbt mouseless
# retrieve all forks recursively (the whole network) https://github.com/frost-nzcr4/find_forks -- purposefully chose a small repo to avoid running this by mistake
./analyze-forks-deep frost-nzcr4 find_forks
Calling the gitinspector
directly via CLI
./bin/gitinspector /out/mouseless
./bin/gitinspector --grading=true /out/mouseless
./bin/gitinspector --grading=true --format=html /out/mouseless
cd out/mouseless
git log --all background_scripts/extension-reloader.js
# include diffs
git log -p --all background_scripts/extension-reloader.js
# look for contributions to a specific function across all forks
git log --all -p -L ":getCenters":lib/model/PersonInfo.php --ignore-all-space --ignore-space-change --ignore-space-at-eol --ignore-blank-lines
# also accepts line numbers range
git log --all -p -L 13,20:lib/model/PersonInfo.php --ignore-all-space --ignore-space-change --ignore-space-at-eol --ignore-blank-lines
#modify ~/.gitattributes to add language support
#*.php diff=php
#*.js diff=node
#normalize the repo in case of ^M
#Note: this might corrupt some file formats (e.g binary, images etc.)
#https://superuser.com/questions/293941/rewrite-git-history-to-replace-all-crlf-to-lf
#**Note: perform all operations on tmpfs. Much faster**
#normalize the whole repo and its history
# specific file (much faster) -- few minutes
git filter-branch --tree-filter 'git ls-files lib/model/PersonInfo.php -z | xargs -0 fromdos' -- --all
#whole repo but takes longer
git filter-branch --tree-filter 'git ls-files -z | xargs -0 fromdos' -- --all
#Alternative if language is not properly supported is to use pickaxe
git log --all -p -S"function createHints" content_scripts/hints.js
# for some languages, --function-context works well
git log --all -p -ScreateHints --function-context content_scripts/hints.js
git log -p --all --not master --no-merges
git log --all --pretty=format: --name-only --not master --no-merges | sort | uniq -c | sort -rg | head -10