Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions misc/make-lucky.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash
# Generate a commit with a lucky number
# Usage: Just execute this script
# ./misc/make-lucky.sh
set -eu

pattern=777

git commit --allow-empty -m 'lucky commit'
# retry commit until it contains the pattern
commit_hash=$(git rev-parse HEAD)
while [[ "$commit_hash" != *"$pattern"* ]];
do
message="lucky commit (seed: $RANDOM)"
git commit --allow-empty --amend -m "$message" &>/dev/null
commit_hash=$(git rev-parse HEAD)
done