Last active
September 21, 2018 12:39
-
-
Save seize-the-dave/9a361e44171a80b745d82917361bf203 to your computer and use it in GitHub Desktop.
Prints out each merge in the tree, combines it with the age of the last commit on each branch, and reverse sorts it.
This file contains 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
#!/bin/bash | |
export prefix="origin/release" | |
export curr="$prefix/2.21" | |
export time="091900002018" | |
for repo in $(echo */); do | |
pushd $repo > /dev/null | |
if [ $(git branch -r | grep -c $curr) -ne 0 ]; then | |
export curr_line=$(($(git branch -r | grep "$prefix/[012]" | sort -r | grep -n $curr | cut -f1 -d':') + 1)) | |
export prev=$(git branch -r | grep "$prefix/[012]" | sort -r | head -n $curr_line | tail -n 1 | cut -f3 -d' ') | |
for commit in $(git log $prev..$curr --pretty=format:"%ct %d" | tail -n +1 | grep '(' | uniq -is 10 | cut -f1 -d' '); do | |
echo "(" $(date -j $time +%s) - $commit ")" / 86400 | bc; | |
done | |
fi | |
popd > /dev/null | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment