adds options

master
nicolas 3 years ago
parent 7820005967
commit 841aa79c02

@ -1,7 +1,5 @@
Script to generate an X amount of commits every day since Y days ago
-------------------------------------------------------------------
Given X and Y > 0
Script to generate commits in the past
--------------------------------------
Instruction manual
------------------
@ -9,9 +7,23 @@ Instruction manual
- mkdir mynew && cp commit_x_days_ago.sh $_ && cd $_
- git init
- echo "commit_x_days_ago.sh" >> .git/info/exclude
- ./commit_x_days_ago.sh Y X
- ./commit_x_days_ago.sh W X Y Z
- git push
Parameter reference
-------------------
W - number of days ago to start committing
X - number of days ago to stop committing
Y - is random? yes->1, no->0
Z - amount of commits if Y = 0 / max amount of random commits if Y = 1
Usage
-----
./commit_x_days_ago.sh 30 15 1 12
Generates a random amount of {1, .., 12} commits everyday between 30 and 15 days ago.
Why would you do this?
----------------------

@ -3,9 +3,16 @@
counter=$1
mkdir temp_files && cd $_
while [ $counter -gt 0 ]
while [ $counter -gt $2 ]
do
for commit_number in `seq $2`
if [ $3 -eq 1 ]
then
max_commits=$(( $RANDOM % $4 + 1 ))
else
max_commits=$4
fi
for commit_number in `seq $max_commits`
do
filename="${counter}_day(s)_ago_${commit_number}.doc"
touch "${filename}"
@ -13,5 +20,7 @@ do
git add .
git commit --date="$counter day/s ago $commit_number" -m "$counter day/s ago $commit_number"
done
counter=$(( $counter - 1 ))
rm *
done

Loading…
Cancel
Save