This repository has migrated from manual tracking files to a fully automated git-based pattern labeling system. This document explains the changes and migration process.
- Used
.new-patterns-tracker.txtand.updated-patterns-tracker.txtfiles - Required manual maintenance and updates
- Pattern labels were managed through tracking files
- Prone to inconsistencies and manual errors
- Uses git commit history as the source of truth
- Fully automated with no manual maintenance required
- Pattern labels are determined by actual creation and modification dates
- Consistent and accurate labeling based on git history
scripts/git_pattern_dates.py- Core git-based dating enginescripts/deploy_git_based.py- Simplified deployment scriptMIGRATION-TO-GIT-LABELS.md- This migration documentation
scripts/build_readme.py- Updated to use git-based detectionoverrides/main.html- Inline badge styling for NEW/UPDATED labelsMakefile- Updated targets for git-based systemPATTERN-LABELING.md- Complete rewrite for git-based system
.new-patterns-tracker.txt- No longer needed (git history used instead).updated-patterns-tracker.txt- No longer needed (git history used instead)scripts/update_pattern_labels.py- Replaced by git-based detectionscripts/deploy_with_labels.py- Replaced bydeploy_git_based.pyscripts/reset_pattern_labels.py- No longer needed (automatic expiration)
- Patterns created within the last 7 days
- Based on first git commit that added the file
- Automatically expire after 7 days
- Patterns created > 7 days ago but modified within last 14 days
- Based on last git commit that modified the file
- Automatically expire after 14 days
- NEW takes precedence over UPDATED
make show_labelsmake debug_pattern
# Enter pattern name when promptedmake deploy_auto- Zero Maintenance: No manual tracking files to update
- Accurate: Git history is the definitive source of truth
- Automatic: Labels appear and expire automatically based on actual dates
- Consistent: No human error in labeling
- Intuitive: Time-based logic is easy to understand
- Handles Edge Cases: Rebasing, squashing, multiple commits all work correctly
Nothing changes for contributors! The new system automatically:
- Detects when you add new patterns (NEW label for 7 days)
- Detects when you modify existing patterns (UPDATED label for 14 days)
- Handles all labeling based on your git commits
Just commit your work as usual - the labeling happens automatically.
To adjust timeframes, edit scripts/git_pattern_dates.py:
NEW_PATTERN_DAYS = 7 # NEW badge duration
UPDATED_PATTERN_DAYS = 14 # UPDATED badge durationIf for any reason you need to rollback to the manual system:
- Restore the old tracking files from git history
- Revert changes to
scripts/build_readme.py - Restore the old deployment scripts
However, the git-based system is more reliable and requires no maintenance, so rollback should not be necessary.
For issues with the new git-based system:
- Check
PATTERN-LABELING.mdfor complete documentation - Use
make show_labelsto debug current state - Use
python3 scripts/git_pattern_dates.py pattern-nameto debug specific patterns
The git-based system is designed to be robust and self-maintaining.