mirror of
https://github.com/m1ngsama/TNT.git
synced 2025-12-24 10:51:41 +00:00
31 lines
857 B
Bash
Executable file
31 lines
857 B
Bash
Executable file
#!/bin/bash
|
|
set -e
|
|
|
|
# Export all commit info
|
|
git log --pretty=format:'%H|%ai|%s' --reverse > commits.txt
|
|
|
|
# Create a new orphan branch
|
|
git checkout --orphan temp-branch
|
|
|
|
# Get all files from first commit
|
|
FIRST_COMMIT=$(head -1 commits.txt | cut -d'|' -f1)
|
|
git checkout $FIRST_COMMIT -- .
|
|
|
|
# Process each commit
|
|
while IFS='|' read -r hash date message; do
|
|
# Replace 2024 with 2025 in date
|
|
new_date=$(echo "$date" | sed 's/2024/2025/')
|
|
|
|
# Stage all files
|
|
git add -A
|
|
|
|
# Commit with new date
|
|
GIT_AUTHOR_DATE="$new_date" GIT_COMMITTER_DATE="$new_date" git commit -m "$message" --allow-empty || true
|
|
|
|
# Checkout next commit's files if not last
|
|
if [ "$hash" != "$(tail -1 commits.txt | cut -d'|' -f1)" ]; then
|
|
git checkout $hash -- . 2>/dev/null || true
|
|
fi
|
|
done < commits.txt
|
|
|
|
echo "Done processing commits"
|