Last active
December 10, 2015 21:08
-
-
Save tomasfejfar/4492661 to your computer and use it in GitHub Desktop.
Mux SQL files
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 | |
rm -f ./mux.sql; | |
rm -f ./tmp.list; | |
RES=`echo ""` | |
ITEM=`echo ""` | |
for file in `git ls-files` | |
do | |
HASH=`git rev-list HEAD $file | tail -n 1` | |
DATE=`git show -s --format="%ct" $HASH --` | |
ITEM=$(printf "%s %s\n" $DATE $file >> tmp.list) | |
done | |
for file in $(cat tmp.list | sort | sed s/"[0-9]* "//) | |
do | |
echo $'\n' >> mux.sql; | |
cat $file >> mux.sql; | |
done | |
rm -f ./tmp.list |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment