Skip to main content
Glama

DollhouseMCP

by DollhouseMCP
pre-commitโ€ข7.97 kB
#!/bin/bash # GitFlow Guardian - Pre-commit Hook # Prevents direct commits to protected branches and enforces GitFlow # Get the directory where this hook is located HOOK_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # Load configuration if it exists CONFIG_FILE="$HOOK_DIR/config" if [ -f "$CONFIG_FILE" ]; then source "$CONFIG_FILE" else # Default configuration if config file doesn't exist PROTECTED_BRANCHES=("main" "master" "develop") ALLOWED_PREFIXES=("feature" "fix" "bugfix" "hotfix" "release" "support" "docs" "test" "chore" "refactor") MIN_NAME_LENGTH=1 USE_COLORS=true ENABLE_COMMIT_PROTECTION=true fi # Exit early if protection is disabled if [ "$ENABLE_COMMIT_PROTECTION" != "true" ]; then exit 0 fi # Colors for output (only if enabled) if [ "$USE_COLORS" = "true" ]; then RED='\033[0;31m' YELLOW='\033[1;33m' GREEN='\033[0;32m' BLUE='\033[0;34m' NC='\033[0m' # No Color else RED='' YELLOW='' GREEN='' BLUE='' NC='' fi # Get current branch name BRANCH=$(git symbolic-ref --short HEAD 2>/dev/null) # Check if we're on a protected branch IS_PROTECTED=false for protected_branch in "${PROTECTED_BRANCHES[@]}"; do if [[ "$BRANCH" == "$protected_branch" ]]; then IS_PROTECTED=true break fi done if [ "$IS_PROTECTED" = "true" ]; then echo -e "${RED}โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—${NC}" echo -e "${RED}โ•‘ ๐Ÿšจ GITFLOW VIOLATION DETECTED ๐Ÿšจ โ•‘${NC}" echo -e "${RED}โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ${NC}" echo -e "${RED}โ•‘ โ•‘${NC}" echo -e "${RED}โ•‘ You are attempting to commit directly to: ${YELLOW}$BRANCH${RED} โ•‘${NC}" echo -e "${RED}โ•‘ โ•‘${NC}" echo -e "${RED}โ•‘ This violates GitFlow best practices! โ•‘${NC}" echo -e "${RED}โ•‘ โ•‘${NC}" echo -e "${RED}โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ${NC}" echo -e "${RED}โ•‘ โ•‘${NC}" echo -e "${RED}โ•‘ ${YELLOW}What you should do instead:${RED} โ•‘${NC}" echo -e "${RED}โ•‘ โ•‘${NC}" echo -e "${RED}โ•‘ 1. Create a feature branch: โ•‘${NC}" echo -e "${RED}โ•‘ ${GREEN}git checkout -b feature/your-feature-name${RED} โ•‘${NC}" echo -e "${RED}โ•‘ โ•‘${NC}" echo -e "${RED}โ•‘ 2. Or a fix branch: โ•‘${NC}" echo -e "${RED}โ•‘ ${GREEN}git checkout -b fix/your-fix-description${RED} โ•‘${NC}" echo -e "${RED}โ•‘ โ•‘${NC}" echo -e "${RED}โ•‘ 3. Commit your changes there โ•‘${NC}" echo -e "${RED}โ•‘ โ•‘${NC}" echo -e "${RED}โ•‘ 4. Push and create a Pull Request โ•‘${NC}" echo -e "${RED}โ•‘ โ•‘${NC}" echo -e "${RED}โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ${NC}" echo -e "${RED}โ•‘ โ•‘${NC}" echo -e "${RED}โ•‘ ${YELLOW}If you REALLY need to commit here (emergency only):${RED} โ•‘${NC}" echo -e "${RED}โ•‘ โ•‘${NC}" echo -e "${RED}โ•‘ Use --no-verify flag: โ•‘${NC}" echo -e "${RED}โ•‘ ${BLUE}git commit --no-verify -m \"Emergency: reason\"${RED} โ•‘${NC}" echo -e "${RED}โ•‘ โ•‘${NC}" echo -e "${RED}โ•‘ โš ๏ธ This should be rare and documented! โ•‘${NC}" echo -e "${RED}โ•‘ โ•‘${NC}" echo -e "${RED}โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•${NC}" echo "" echo -e "${YELLOW}Commit aborted. Please use a feature branch.${NC}" exit 1 fi # Build regex pattern from allowed prefixes PREFIX_PATTERN=$(IFS='|'; echo "${ALLOWED_PREFIXES[*]}") # Check if branch follows GitFlow naming convention if [[ ! "$BRANCH" =~ ^($PREFIX_PATTERN)/.{$MIN_NAME_LENGTH,} ]]; then echo -e "${YELLOW}โ•”โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•—${NC}" echo -e "${YELLOW}โ•‘ โš ๏ธ GITFLOW WARNING โš ๏ธ โ•‘${NC}" echo -e "${YELLOW}โ• โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•ฃ${NC}" echo -e "${YELLOW}โ•‘ โ•‘${NC}" echo -e "${YELLOW}โ•‘ Current branch: ${BLUE}$BRANCH${YELLOW} โ•‘${NC}" echo -e "${YELLOW}โ•‘ โ•‘${NC}" echo -e "${YELLOW}โ•‘ This branch doesn't follow GitFlow naming conventions. โ•‘${NC}" echo -e "${YELLOW}โ•‘ โ•‘${NC}" echo -e "${YELLOW}โ•‘ Recommended prefixes: โ•‘${NC}" echo -e "${YELLOW}โ•‘ โ€ข feature/ - New features โ•‘${NC}" echo -e "${YELLOW}โ•‘ โ€ข fix/ - Bug fixes โ•‘${NC}" echo -e "${YELLOW}โ•‘ โ€ข hotfix/ - Urgent production fixes โ•‘${NC}" echo -e "${YELLOW}โ•‘ โ€ข release/ - Release preparation โ•‘${NC}" echo -e "${YELLOW}โ•‘ โ€ข docs/ - Documentation only โ•‘${NC}" echo -e "${YELLOW}โ•‘ โ€ข test/ - Test additions/fixes โ•‘${NC}" echo -e "${YELLOW}โ•‘ โ€ข chore/ - Maintenance tasks โ•‘${NC}" echo -e "${YELLOW}โ•‘ โ•‘${NC}" echo -e "${YELLOW}โ•šโ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•โ•${NC}" echo "" echo -e "${GREEN}Proceeding with commit (non-standard branch name)...${NC}" fi # If we get here, the commit is allowed echo -e "${GREEN}โœ… GitFlow check passed. Branch '$BRANCH' is valid for direct commits.${NC}"

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/DollhouseMCP/DollhouseMCP'

If you have feedback or need assistance with the MCP directory API, please join our Discord server