Repository navigation
Expand file tree
/
Copy pathcommit_script.sh
More file actions
executable file
·95 lines (80 loc) · 2.7 KB
/
Copy pathcommit_script.sh
File metadata and controls
executable file
·95 lines (80 loc) · 2.7 KB
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/bin/bash
# Initialize git repository if not already initialized
git init
# Configure user
git config user.name "MRINALPRAKASHFSD"
git config user.email "[email protected]"
# Setup the remote
git remote add origin https://github.com/MRINALPRAKASHFSD/random-quote-generator.git || git remote set-url origin https://github.com/MRINALPRAKASHFSD/random-quote-generator.git
# We have 24 items to commit (files in src, public, and root)
# Let's define an array of files to add logically over time
FILES=(
"package.json package-lock.json"
"README.md"
"public/index.html public/manifest.json public/robots.txt"
"public/favicon.ico public/logo192.png public/logo512.png"
"src/index.js src/index.css"
"src/App.css"
"src/setupTests.js"
"src/logo.svg"
"src/ParticleBackground.js"
"src/quotes.js"
"src/quoteUtils.js"
"src/SearchBar.js"
"src/AddQuoteModal.js"
"src/FavoriteModal.js"
"src/QuoteCard.js"
"src/App.js"
"src/App.test.js"
"src/reportWebVitals.js"
)
MESSAGES=(
"Initial commit with package configurations"
"Update README.md with humanized text"
"Add public HTML and manifest files"
"Add public assets (icons)"
"Add React entry point and global styles"
"Add App styles"
"Add test setup configuration"
"Add SVG logo asset"
"Implement ParticleBackground component"
"Add static quotes data"
"Add utility functions for quotes"
"Implement SearchBar component"
"Add AddQuoteModal component"
"Add FavoriteModal component"
"Implement QuoteCard component with download feature"
"Add main App component orchestrating state"
"Add unit tests for App"
"Add web vitals reporting"
)
# 3 days ago is 2026-07-22
# We will generate timestamps spanning from July 22 to July 25
START_TS=$(date -j -f "%Y-%m-%d %H:%M:%S" "2026-07-22 10:00:00" "+%s" 2>/dev/null || date -d "2026-07-22 10:00:00" "+%s")
# There are 18 commits, spread them by ~4 hours each
INTERVAL=$((3 * 24 * 3600 / 18))
for i in "${!FILES[@]}"; do
CURRENT_TS=$((START_TS + i * INTERVAL))
# Format timestamp in ISO-8601 for git
if date --version >/dev/null 2>&1; then
# GNU date
DATE_STR=$(date -d "@$CURRENT_TS" -Iseconds)
else
# BSD date (macOS)
DATE_STR=$(date -r "$CURRENT_TS" "+%Y-%m-%dT%H:%M:%S%z")
fi
git add ${FILES[$i]}
export GIT_AUTHOR_DATE="$DATE_STR"
export GIT_COMMITTER_DATE="$DATE_STR"
git commit -m "${MESSAGES[$i]}"
done
# Finally add anything left over just in case
git add .
if ! git diff --cached --quiet; then
export GIT_AUTHOR_DATE=$(date "+%Y-%m-%dT%H:%M:%S%z")
export GIT_COMMITTER_DATE="$GIT_AUTHOR_DATE"
git commit -m "Final polish and bug fixes"
fi
echo "Commits created successfully."
# Try pushing
git push -u origin master || git push -u origin main