-
-
Save wsdookadr/df17e07f7a84d25d7fe2d12525d76b41 to your computer and use it in GitHub Desktop.
find file changes in all forks of a github repo
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
curl -i https://api.github.com/repos/scrooloose/nerdtree/forks |grep -e "git_url" |awk '{gsub(/,/,"");split($2,a,"/"); system("mkdir "a[4]"; cd "a[4]"; git clone " $2);}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DIRS=$(find * -type d -name '*nerdtree' -maxdepth 1 -print) | |
FILECHANGE="plugin/NERD_tree.vim" | |
for d in $DIRS | |
do | |
cd $d | |
git fetch | |
BRANCHES=$(git branch -a) | |
OBS=$(git branch -r |egrep -v '(HEAD)') | |
for ob in $OBS | |
do | |
git checkout -t $ob 2>/dev/null | |
bonly=$(echo $ob |awk {'split($0,a,"/"); print a[2]'}) | |
git checkout $bonly &>/dev/null | |
git pull &>/dev/null | |
out=$(git log --pretty=format:"%H %ad" $FILECHANGING |head -n1 | xargs -I{} echo `pwd`"("$ob"): "{}) | |
echo $out | |
done | |
cd ../.. | |
done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#1 mkdir $working_dir; echo "modify fetch-repos.sh for your source repo"; cd $working_dir; bash fetch-repos.sh; | |
#2 echo "modify find-file-changes.sh to use the file you need"; cd $working_dir; bash find-file-changes.sh > all-branch-changes.txt | |
#3 cat all-branch-changes.txt |sort -k4M,7 | |
This will output a list of fork:branche:commit for a specific file sorted by date of commit; | |
Note: this is kind of brittle and could break depending on the input data (ie the names of things in the repositories). | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment