-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdecorator
executable file
·77 lines (53 loc) · 1.37 KB
/
decorator
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/bash
#config
AUTHOR_NAME="YOURNAME"
AUTHOR_EMAIL="YOUREMAIL"
echo -e "\n***PART I***\n"
echo "Generating commit dates"
NOW=$(date +%s)
START=$(echo $NOW-31622400|bc)
COUNT=-1
mkdir -p ./rewrite-tmp
> ./rewrite-tmp/arr
while [ "$START" -lt "$NOW" ]
do
RAND=$(echo "144000*$RANDOM/32767"|bc)
START=$(echo "$START+$RAND"|bc)
if [ "$START" -lt "$NOW" ]
then
let COUNT+=1
>>./rewrite-tmp/arr echo $START
fi
done
echo "Generation completed"
echo -e "\n\n***PART II***\n"
echo "Deleting old Git repository in $PWD"
rm -rf .git*
echo 'Deletion completed'
git init
git config user.name $AUTHOR_NAME
git config user.email $AUTHOR_EMAIL
>melon echo ''
git add melon
echo 'Generating commits'
for i in $(seq 0 $COUNT); do
echo -ne $(echo "$i*100/$COUNT" | bc)"%\r"
>>melon echo 'x'
git commit -am 'x' >/dev/null
done
echo '100% completed!'
echo -e "\n\n***PART III***\n"
echo "0" > ./rewrite-tmp/count
echo "Intercepting history"
git filter-branch -f --env-filter '
COUNT=$(cat ../../rewrite-tmp/count)
TIMESTAMP=$(head -1 ../../rewrite-tmp/arr)
sed -i "1d" ../../rewrite-tmp/arr
C1="${TIMESTAMP} +0800"
export GIT_AUTHOR_DATE="$C1"
export GIT_COMMITTER_DATE="$C1"
echo $(echo $COUNT+1|bc) > ../../rewrite-tmp/count
echo "\r\c"
' --tag-name-filter cat -- --branches --tags
echo "Interception completed"
rm -rf ./rewrite-tmp