Created
January 14, 2025 10:07
-
-
Save amkisko/04b252b0b2438977e54ff124219cc89c to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env bash | |
if [ $# -ne 1 ]; then | |
echo "Usage: $0 YYYY-MM-DD" | |
exit 1 | |
fi | |
TARGET_DATE=$1 | |
if ! [[ $TARGET_DATE =~ ^[0-9]{4}-[0-9]{2}-[0-9]{2}$ ]]; then | |
echo "Error: Date must be in format YYYY-MM-DD" | |
exit 1 | |
fi | |
START_DATE="${TARGET_DATE}T00:00:00" | |
END_DATE="${TARGET_DATE}T23:59:59" | |
echo "Searching for commits on ${TARGET_DATE} in $(pwd) repositories...\n" | |
find . -type d -name ".git" | while read -r gitdir; do | |
repo_dir="$(dirname "$gitdir")" | |
cd "$repo_dir" || continue | |
commits=$(git log --all --format="%H %ai %s" --after="${START_DATE}" --before="${END_DATE}") | |
if [ -n "$commits" ]; then | |
echo "Found in $repo_dir" | |
echo "$commits" | |
fi | |
cd - > /dev/null | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment