#!/bin/bash
# Script to squash all history into a single, clean, DCO-compliant commit
set -e # Exit on any error
echo "๐ Creating single clean commit with all changes"
echo "==============================================="
# Check if we're in a git repository
if ! git rev-parse --git-dir > /dev/null 2>&1; then
echo "โ Error: Not in a git repository"
exit 1
fi
echo "๐ Current status:"
echo "Current commits:"
git log --oneline --no-merges | head -5
echo ""
echo "Uncommitted changes:"
git status --short
echo ""
echo "๐ Creating backup branch..."
git add -A # Stage everything first for backup
git stash push -u -m "backup-before-squash-$(date +%Y%m%d-%H%M%S)"
echo ""
echo "๐๏ธ Resetting to create clean history..."
# Option 1: Reset to before any commits (creates completely new history)
git update-ref -d HEAD
git add -A
echo ""
echo "๐ Creating single comprehensive commit..."
git commit -s -m "Initial implementation of Flight Control MCP Server
This MCP (Model Context Protocol) server provides AI assistants with read-only
access to Flight Control resources and remote command execution capabilities.
Features:
- Query devices, fleets, events, enrollment requests, repositories, resource syncs
- Remote console command execution on devices via flightctl CLI
- OIDC/OAuth2 authentication with automatic token refresh
- SSL certificate handling (custom CA, skip verification, system CA)
- Comprehensive logging with rotation
- Production-ready error handling and validation
- Full test suite with unit, integration, and live testing
- Containerized deployment support
Technical components:
- main.py: MCP server with tool definitions
- resource_queries.py: Flight Control API client with authentication
- cli.py: CLI management and console command execution
- Comprehensive testing framework with 95%+ coverage
- Complete open source project setup with DCO compliance
Documentation:
- README.md: Setup and usage instructions
- TESTING.md: Comprehensive testing guide
- CONTRIBUTING.md: Contributor guidelines with DCO requirements
- CI-TESTING.md: CI/CD testing strategy
- GitHub templates for issues and pull requests
License: Apache 2.0
DCO: All contributions require Developer Certificate of Origin sign-off"
echo ""
echo "โ
Success! Created single clean commit."
echo ""
echo "๐ New git history:"
git log --oneline --no-merges
echo ""
echo "๐ Verifying DCO compliance:"
git log --pretty=format:"%B" | grep "Signed-off-by:"
echo ""
echo "๐ค Next steps:"
echo "1. Review the commit: git show --stat"
echo "2. Force push to origin: git push --force-with-lease origin main"
echo "3. Or if new repo: git push origin main"
echo ""
echo "๐งน Cleanup: git stash list # to see backup stashes"
echo "๐ Restore if needed: git stash pop # to restore the backup"