Initial commit: Git OpenTimestamp hooks skill
This commit is contained in:
commit
eec64d16c6
13 changed files with 1145 additions and 0 deletions
41
scripts/setup-gitignore.sh
Executable file
41
scripts/setup-gitignore.sh
Executable file
|
|
@ -0,0 +1,41 @@
|
|||
#!/bin/bash
|
||||
# setup-gitignore.sh - Create/update .gitignore for OpenTimestamp proofs
|
||||
# Usage: setup-gitignore.sh [repository-path]
|
||||
|
||||
set -e
|
||||
|
||||
REPO_PATH="${1:-.}"
|
||||
|
||||
cd "$REPO_PATH"
|
||||
|
||||
# Verify we're in a git repository
|
||||
if ! git rev-parse --git-dir > /dev/null 2>&1; then
|
||||
echo "Error: not a git repository" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
GITIGNORE=".gitignore"
|
||||
|
||||
# Create .gitignore if it doesn't exist
|
||||
if [ ! -f "$GITIGNORE" ]; then
|
||||
echo "# OpenTimestamp proofs cache (exclude from version control)" > "$GITIGNORE"
|
||||
echo ".ots/.attestation-cache" >> "$GITIGNORE"
|
||||
echo ""
|
||||
echo "Created $GITIGNORE with OpenTimestamp cache exclusion"
|
||||
else
|
||||
# Check if already has the cache exclusion
|
||||
if grep -q ".ots/.attestation-cache" "$GITIGNORE"; then
|
||||
echo "$GITIGNORE already excludes .ots/.attestation-cache"
|
||||
else
|
||||
echo "" >> "$GITIGNORE"
|
||||
echo "# OpenTimestamp proofs cache (exclude from version control)" >> "$GITIGNORE"
|
||||
echo ".ots/.attestation-cache" >> "$GITIGNORE"
|
||||
echo "Added .ots/.attestation-cache to $GITIGNORE"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo ""
|
||||
echo "Next steps:"
|
||||
echo "1. Review and commit your .gitignore"
|
||||
echo "2. Add .ots/ directory to track proofs: git add .ots/"
|
||||
echo "3. Commit proofs: git commit -m 'Add OpenTimestamp proofs'"
|
||||
Loading…
Add table
Add a link
Reference in a new issue