Skip to content

Instantly share code, notes, and snippets.

@Caio99BR
Created October 22, 2016 16:11
Show Gist options
  • Save Caio99BR/070e08d326f82ac417cae03af86e62fd to your computer and use it in GitHub Desktop.
Save Caio99BR/070e08d326f82ac417cae03af86e62fd to your computer and use it in GitHub Desktop.
Fixed make_changelog
#!/bin/bash
hg log --template '{author|person} - {desc|firstline} - {date|date}\n' > /tmp/commit_summary
if [[ -d .hg || -d .git ]]; then
a=0
while read line; do
a=$(($a + 1))
done < /tmp/commit_summary
i=0
while read line; do
summary[$i]=$line
i=$(($i + 1))
done < /tmp/commit_summary
(cat << EOF) > OLD_DETAILED_CHANGELOG
-----------------------------------------------------------------------------
Copyright 2009-2010, Ifcaro & jimmikaelkael
Licenced under Academic Free License version 3.0
Review Open PS2 Loader README & LICENSE files for further details.
-----------------------------------------------------------------------------
Open PS2 Loader detailed ChangeLog:
EOF
b=$a
for ((j=0; j<$i; j++)); do
echo "rev$a - ${summary[$j]}" >> OLD_DETAILED_CHANGELOG
a=$(($a - 1))
done
rm -fr /tmp/commit_summary
echo "Found $b changesets/commits... DETAILED_CHANGELOG file created."
else
echo "No .hg/.git folder found, exiting..."
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment