Skip to content

Instantly share code, notes, and snippets.

@AnnikaCodes
Forked from scheibo/commits.sh
Last active June 9, 2021 03:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save AnnikaCodes/49ea9f34e860e78b1a4b004164d4c3c9 to your computer and use it in GitHub Desktop.
Save AnnikaCodes/49ea9f34e860e78b1a4b004164d4c3c9 to your computer and use it in GitHub Desktop.
#!/bin/bash
set -e
SERVER=$1
CLIENT=$2
SINCE="2019-08-01"
BEFORE="$(date "+%Y-%m-%d")"
TMP=$(mktemp)
trap "rm -f $TMP" 0 2 3 15
sync() {
git checkout master &>/dev/null
git fetch upstream &>/dev/null
git merge upstream/master &>/dev/null
git push origin master &>/dev/null
}
cd $SERVER && sync
git --no-pager log --pretty="%ad|(https://github.com/smogon/pokemon-showdown/commit/%H) - %s thanks to|%an" --since="$SINCE" --before="$BEFORE" --date=iso8601 > $TMP
cd $CLIENT && sync
git --no-pager log --pretty="%ad|(https://github.com/smogon/pokemon-showdown-client/commit/%H) - %s thanks to|%an" --since="$SINCE" --before="$BEFORE" --date=iso8601 >> $TMP
sort $TMP | ruby <(cat <<HERE
NAMES = {
'Jacob McLemore' => 'McLemore',
'Guangcong Luo' => 'Zarel',
'whales' => 'jumbowhales',
'Marty-D' => 'Marty',
'TheJetOU' => 'jetou',
'Konrad Borowski' => 'xfix',
'Ben Davies' => 'Morfent',
'LegoFigure11' => 'Lego',
}
def toSmogonUsername(name)
"**@#{NAMES[name] || name}**"
end
ARGF.each_line do |line|
split = line.split('|').map(&:strip)
cmd = "date -d '#{split[0]}' +'%B %e'"
date = %x(#{cmd}).chomp
puts " - [#{date}]#{split[1]} #{toSmogonUsername(split[2])}"
end
HERE
)
echo "---"
echo "### Features"
echo
echo "### Bug Fixes"
echo
echo "### Staff"
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment