IMPORTANT: This is the centralized reference document for all Git workflow practices in the EntityDB project. All developers must follow these guidelines.
This document outlines the Git best practices for the EntityDB project, focusing on state tracking, tagging, and commit message standardization to ensure clear communication across teams. It is referenced from all other documentation as the single source of truth for Git workflow practices.
Git describe is our primary tool for tracking implementation state, providing a clear indicator of where we are relative to tagged milestones.
# Get the current implementation state
git describe --tags
# Include uncommitted changes in state
git describe --tags --dirtyA typical output looks like:
v1.0.0-security-15-g7f3a2c1
This tells us:
v1.0.0-security: The most recent tag15: Number of commits since that tagg7f3a2c1: 'g' prefix followed by commit hash
Always include the current implementation state in documentation:
Current Implementation State: `v1.0.0-security-15-g7f3a2c1`
Last Updated: 2025-05-12All major documentation should begin with this state indicator to ensure readers understand which version the document describes.
Tags serve as milestone markers in the EntityDB project, establishing reference points for state tracking.
v<major>.<minor>.<patch>-<component>
Examples:
v1.0.0-core: Initial core implementationv1.0.1-security: Security components integrationv1.1.0-entity-api: Entity API enhancements
Always use annotated tags with descriptive messages:
git tag -a v1.0.0-security -m "Complete security implementation with bcrypt password hashing, audit logging, and RBAC"Create new tags for:
- Completion of major components
- Significant architecture changes
- Production-ready states
- After critical fixes
Remember to push tags to the remote repository:
git push origin --tagsConsistent commit messages are essential for clear communication and history tracking.
<type>(<scope>): <subject>
<body>
<footer>
feat: New featurefix: Bug fixdocs: Documentation onlystyle: Formatting (no code change)refactor: Code change that neither fixes a bug nor adds a featureperf: Performance improvementtest: Test addition or correctionchore: Build process or auxiliary tool changessecurity: Security enhancements
Indicate the component affected:
entity: Entity systemsecurity: Security componentsapi: API endpointsrbac: Role-based access controlaudit: Audit loggingvalidation: Input validationrelationship: Entity relationships
- Brief description (max 50 chars)
- Use imperative mood ("add" not "added")
- No period at end
- Start with lowercase
- Explain WHY the change was made
- Separated from subject by blank line
- Wrap at 72 characters per line
- Reference issues/tickets:
Fixes #123 - Breaking changes:
BREAKING CHANGE: API response format changed - Component tracking:
Component: Security/AuditLogging - Progress indicators:
Progress: 85%
feat(security): implement bcrypt password hashing
Replace plaintext password storage with secure bcrypt hashing to
enhance authentication security. All new passwords are automatically
hashed, and existing plaintext passwords are upgraded on first
verification.
Fixes #45
Component: Security/PasswordManagement
Progress: 100%
EntityDB development follows a strict clean tabletop policy:
- Work directly in the main codebase, not in copies
- Move obsolete code to the
/trashdirectory instead of deleting it - Avoid temporary files with extensions like .bak or .old
- Maintain one source of truth at all times
The /trash directory serves as a repository for code that is no longer used but may have reference value:
-
When to use the trash directory:
- When replacing an implementation with a better one
- When removing features that are no longer needed
- When code is obsolete but may have reference value
- When restructuring the codebase
-
How to move code to trash:
- Maintain the original directory structure where possible
- Add clear comments about when and why the code was moved to trash
- Add a descriptive commit message explaining what was moved and why
-
Never execute code from trash:
- Code in the trash directory is for reference only
- Never import or execute code from the trash directory in production
- Code in trash may contain bugs, security issues, or incompatibilities
EntityDB uses trunk-based development with the following guidelines:
- The main branch is always stable and buildable
- Feature branches should be short-lived (1-2 days maximum)
- Merge to main frequently (at least daily)
- Branch names should follow:
<type>/<description>(e.g.,security/bcrypt-implementation)
Combine Git describe and commit metadata to track implementation progress:
Generate reports between tags to track progress:
git log v1.0.0-security..v1.1.0-security --pretty=format:"%h - %s (%an)" > milestone_report.mdView progress for specific components:
git log --grep="security" --pretty=format:"- %s (%h)" -n 10Use Git's graph capabilities for visual state tracking:
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commitMaintain an implementation status document that's updated with each significant commit:
# EntityDB Implementation Status
Current State: v1.0.0-security-15-g7f3a2c1
Last Updated: 2025-05-12
## Recent Changes
- security(audit): implement JSON log formatting (a1b2c3d)
- fix(validation): correct entity type pattern (e5f6g7h)
- docs(security): add security architecture guide (i9j0k1l)
## Component Status
### Security Components
- Input Validation: COMPLETE
- Audit Logging: COMPLETE
- Password Security: COMPLETE
- RBAC: COMPLETE
- Security Middleware: COMPLETE
### Next Steps
1. Enhance password policy enforcement
2. Add two-factor authentication support
3. Implement advanced audit queryingInstall the following pre-commit hook to automatically update state in documentation:
#!/bin/sh
# Pre-commit hook to update implementation state in docs
STATE=$(git describe --tags --dirty 2>/dev/null || echo "initial-development")
DATE=$(date +"%Y-%m-%d")
for doc in docs/implementation_status.md docs/entitydb_state_summary.md; do
if [ -f "$doc" ]; then
sed -i "s/^Current State:.*/Current State: $STATE/" "$doc"
sed -i "s/^Last Updated:.*/Last Updated: $DATE/" "$doc"
git add "$doc"
fi
done- Start your day by pulling latest changes
- Check current state:
git describe --tags - Create a branch for your work if needed
- Commit frequently with standardized messages
- Update implementation status document for significant changes
- Push changes at least daily
- Create tags for completed milestones
By following these practices, we ensure that the state of the EntityDB implementation is always clear and well-documented, facilitating collaboration across teams and providing a reliable history of development progress.
Last Updated: 2025-05-12