From 35d797f8d812377e7ad017835537dfd2d7ad9b96 Mon Sep 17 00:00:00 2001 From: AJ Isaacs Date: Mon, 23 Feb 2026 12:02:12 -0500 Subject: [PATCH] chore: remove check_uncommitted.py (replaced by git-status-check.sh) Co-Authored-By: Claude Opus 4.6 --- check_uncommitted.py | 96 -------------------------------------------- 1 file changed, 96 deletions(-) delete mode 100644 check_uncommitted.py diff --git a/check_uncommitted.py b/check_uncommitted.py deleted file mode 100644 index 9b987b0..0000000 --- a/check_uncommitted.py +++ /dev/null @@ -1,96 +0,0 @@ -#!/usr/bin/env python3 -import os -import subprocess -from pathlib import Path - -def check_git_status(repo_path): - """Check if a git repository has uncommitted changes.""" - try: - # Check if directory is a git repo - result = subprocess.run( - ['git', 'rev-parse', '--git-dir'], - cwd=repo_path, - capture_output=True, - text=True, - timeout=5 - ) - - if result.returncode != 0: - return None, "Not a git repository" - - # Check for uncommitted changes - status_result = subprocess.run( - ['git', 'status', '--porcelain'], - cwd=repo_path, - capture_output=True, - text=True, - timeout=5 - ) - - if status_result.returncode != 0: - return None, "Error checking status" - - changes = status_result.stdout.strip() - if changes: - # Parse changed files - lines = changes.split('\n') - files = [line[2:].lstrip() if len(line) > 2 else line for line in lines] - return True, (f"{len(lines)} uncommitted change(s)", files) - else: - return False, ("Clean (no uncommitted changes)", []) - - except subprocess.TimeoutExpired: - return None, "Timeout" - except Exception as e: - return None, f"Error: {str(e)}" - -def main(): - current_dir = Path.cwd() - print(f"Checking projects in: {current_dir}\n") - print("=" * 70) - - # Get all subdirectories - subdirs = [d for d in current_dir.iterdir() if d.is_dir() and not d.name.startswith('.')] - - if not subdirs: - print("No subdirectories found.") - return - - projects_with_changes = [] - clean_projects = [] - non_git_dirs = [] - - for subdir in sorted(subdirs): - result = check_git_status(subdir) - - if result[0] is None: - # Not a git repo or error - has_changes, message = result - non_git_dirs.append((subdir.name, message)) - elif result[0]: - # Has changes - has_changes, (message, files) = result - projects_with_changes.append((subdir.name, message, files)) - print(f"⚠️ {subdir.name}: {message}") - for file in files: - print(f" {file}") - else: - # Clean - has_changes, (message, files) = result - clean_projects.append(subdir.name) - print(f"✓ {subdir.name}: {message}") - - # Summary - print("\n" + "=" * 70) - print("SUMMARY:") - print(f" Projects with uncommitted changes: {len(projects_with_changes)}") - print(f" Clean projects: {len(clean_projects)}") - print(f" Non-git directories: {len(non_git_dirs)}") - - if projects_with_changes: - print("\nProjects needing attention:") - for name, msg, files in projects_with_changes: - print(f" - {name}") - -if __name__ == "__main__": - main()