git-uncommitted-scanner 0.1.3__tar.gz → 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- git_uncommitted_scanner-0.2.0/AGENTS.md +85 -0
- git_uncommitted_scanner-0.2.0/CHANGELOG.md +115 -0
- {git_uncommitted_scanner-0.1.3 → git_uncommitted_scanner-0.2.0}/LICENSE +21 -21
- git_uncommitted_scanner-0.2.0/MANIFEST.in +7 -0
- git_uncommitted_scanner-0.2.0/PKG-INFO +249 -0
- git_uncommitted_scanner-0.2.0/git_scanner/__init__.py +4 -0
- git_uncommitted_scanner-0.2.0/git_scanner/__main__.py +4 -0
- git_uncommitted_scanner-0.2.0/git_scanner/main.py +730 -0
- git_uncommitted_scanner-0.2.0/git_uncommitted_scanner.egg-info/PKG-INFO +249 -0
- {git_uncommitted_scanner-0.1.3 → git_uncommitted_scanner-0.2.0}/git_uncommitted_scanner.egg-info/SOURCES.txt +5 -1
- {git_uncommitted_scanner-0.1.3 → git_uncommitted_scanner-0.2.0}/pyproject.toml +31 -31
- git_uncommitted_scanner-0.2.0/readme.md +232 -0
- {git_uncommitted_scanner-0.1.3 → git_uncommitted_scanner-0.2.0}/setup.cfg +4 -4
- git_uncommitted_scanner-0.1.3/PKG-INFO +0 -88
- git_uncommitted_scanner-0.1.3/README.md +0 -71
- git_uncommitted_scanner-0.1.3/git_scanner/__init__.py +0 -0
- git_uncommitted_scanner-0.1.3/git_scanner/main.py +0 -211
- git_uncommitted_scanner-0.1.3/git_uncommitted_scanner.egg-info/PKG-INFO +0 -88
- {git_uncommitted_scanner-0.1.3 → git_uncommitted_scanner-0.2.0}/git_uncommitted_scanner.egg-info/dependency_links.txt +0 -0
- {git_uncommitted_scanner-0.1.3 → git_uncommitted_scanner-0.2.0}/git_uncommitted_scanner.egg-info/entry_points.txt +0 -0
- {git_uncommitted_scanner-0.1.3 → git_uncommitted_scanner-0.2.0}/git_uncommitted_scanner.egg-info/requires.txt +0 -0
- {git_uncommitted_scanner-0.1.3 → git_uncommitted_scanner-0.2.0}/git_uncommitted_scanner.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
# 🤖 AGENTS.md – Project Guidelines & Rules for Autonomous AI Agents
|
|
2
|
+
|
|
3
|
+
Welcome to **git-uncommitted-scanner**. This document defines the mandatory guidelines, architectural standards, quality controls, and PR rules that **all AI agents** (including GitScanner Bolt ⚡, GitScanner Evo 🚀, GitScanner Palette 🎨, and standard coding assistants) MUST follow when contributing to this codebase.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## 1. Project Overview & Technology Stack
|
|
8
|
+
|
|
9
|
+
**`git-uncommitted-scanner`** is a high-speed, cross-platform CLI & TUI utility that scans directories recursively to detect Git repositories with pending uncommitted changes.
|
|
10
|
+
|
|
11
|
+
- **Primary Language**: Python >= 3.9
|
|
12
|
+
- **CLI Engine**: `Typer`
|
|
13
|
+
- **Console Output & Styling**: `Rich`
|
|
14
|
+
- **Interactive TUI**: `Textual`
|
|
15
|
+
- **Subprocess & OS Logic**: Standard library `subprocess`, `pathlib.Path`
|
|
16
|
+
- **Build Backend**: `setuptools` (PEP 621, pinned `<75.0` in `pyproject.toml`)
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## 2. Core Code Standards
|
|
21
|
+
|
|
22
|
+
1. **Strict Single Entry Point**: All application logic, CLI routing, and TUI widgets MUST reside strictly under `git_scanner/main.py`. AI agents **MUST NOT** split the codebase into separate sub-modules (e.g., `git_scanner/tui.py`, `utils.py`, `core.py`) or introduce circular cross-file imports under the pretext of "lazy loading" or "modularization".
|
|
23
|
+
2. **Cross-Platform Compatibility**: Every file operation and terminal invocation must work seamlessly across Windows, macOS, and Linux.
|
|
24
|
+
3. **No Unnecessary Dependencies**: Prefer standard library solutions or existing dependencies (`typer`, `rich`, `textual`). Do not add external packages without explicit approval.
|
|
25
|
+
4. **Zero Regressions & Feature Preservation**: Never delete, degrade, or revert existing features (e.g., CSV & JSON export formats, DataTable auto-focus, keybindings, configuration file loaders, CLI options) during optimization or refactoring passes. Agents **MUST** pull and branch strictly from the latest `origin/Dev2Auto` HEAD to prevent rolling back recent features.
|
|
26
|
+
|
|
27
|
+
---
|
|
28
|
+
|
|
29
|
+
## 3. Strict "No Fake Progress" Policy
|
|
30
|
+
|
|
31
|
+
- **Zero-Change Execution**: If an agent run uncovers no practical, high-value performance, feature, or UX improvement, the agent **MUST NOT** modify any files or submit commits/PRs.
|
|
32
|
+
- **No Pure Aesthetic Churn**: Never refactor code simply to change formatting, variable names, line spacing, or syntax style unless it delivers measurable, practical utility.
|
|
33
|
+
- **No Harmful Micro-Optimizations**: Never fragment the codebase or sacrifice architectural integrity for negligible micro-benchmarks (such as moving classes into separate files to shave 20ms import latency). If lazy loading is ever appropriate, perform it locally within the relevant function inside `git_scanner/main.py`.
|
|
34
|
+
- **Empirical Verification**: All changes must be verified locally by running `scanrepos` or test commands.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## 4. Performance Guidelines (GitScanner Bolt ⚡)
|
|
39
|
+
|
|
40
|
+
- Keep imports clean within `git_scanner/main.py` without violating the single entry point rule.
|
|
41
|
+
- Keep directory walking efficient (`Path.rglob` or `os.scandir`) and minimize `git status` subprocess execution overhead.
|
|
42
|
+
- Ensure `Textual` worker threads run heavy directory scans in the background without blocking the UI main thread.
|
|
43
|
+
|
|
44
|
+
---
|
|
45
|
+
|
|
46
|
+
## 5. Feature & Product Evolution Guidelines (GitScanner Evo 🚀)
|
|
47
|
+
|
|
48
|
+
- Focus on practical, working CLI and TUI enhancements (e.g. branch info, uncommitted file counts, exclusion filters, JSON export, config files).
|
|
49
|
+
- No stub implementations, fake UI elements, TODO placeholders, or broken workflows.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
## 6. UX & Design Guidelines (GitScanner Palette 🎨)
|
|
54
|
+
|
|
55
|
+
- Maintain high visual contrast and modern terminal styling using `Rich` tables and `Textual` components.
|
|
56
|
+
- Ensure keyboard shortcuts are clean, intuitive, and properly documented in the TUI footer.
|
|
57
|
+
- Provide clear error feedback if external terminal execution fails.
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## 7. Artifact & Cleanup Rules
|
|
62
|
+
|
|
63
|
+
- Never commit build artifacts (`dist/`, `build/`, `*.egg-info/`, `__pycache__/`).
|
|
64
|
+
- Never commit scratch files, `.patch`, `.log`, or `.tmp` files.
|
|
65
|
+
- Keep `.gitscanner/` logs focused on long-term learnings.
|
|
66
|
+
|
|
67
|
+
---
|
|
68
|
+
|
|
69
|
+
# 8. PR & Code Generation Rules
|
|
70
|
+
|
|
71
|
+
When creating a Pull Request or submitting code changes, you MUST structure the PR description with the following sections:
|
|
72
|
+
|
|
73
|
+
1. **Executive Summary**: 2-3 sentences max explaining WHAT was changed and WHY.
|
|
74
|
+
|
|
75
|
+
2. **Impact & Safety Matrix**:
|
|
76
|
+
|
|
77
|
+
| File Changed / Removed | Action | Technical Reason | Post-Removal/Update Impact | Risk Level |
|
|
78
|
+
| :--- | :--- | :--- | :--- | :--- |
|
|
79
|
+
| `path/to/file` | Modified/Deleted | Why it was changed | What improves or changes | 🟢 Low / 🟡 Med / 🔴 High |
|
|
80
|
+
|
|
81
|
+
3. **Verification**: State tests run or how you verified this won't break existing IPC/UI threads.
|
|
82
|
+
|
|
83
|
+
4. **Clean Artifacts**: NEVER commit `.patch`, `.log`, or `.tmp` files.
|
|
84
|
+
|
|
85
|
+
5. **Update documentations**: always update any Documentation, when ever new feature is added or any functionality changes.
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
# 📜 Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to the `git-uncommitted-scanner` project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [0.2.0] - 2026-09-19
|
|
9
|
+
|
|
10
|
+
> **Major Milestone Release**: Aggregating all architectural overhauls, high-speed concurrency engines, interactive TUI enhancements, and script automation workflows developed in the `Dev2Auto` pipeline since `v0.1.3`.
|
|
11
|
+
|
|
12
|
+
### 🚀 Added
|
|
13
|
+
- **Script Automation & Quiet Mode (`--quiet` / `-q`)**: Added `--quiet` flag to suppress all Rich headers, animated spinners, and formatted tables, outputting only raw, newline-delimited repository paths for clean piping into tools like `xargs`.
|
|
14
|
+
- **Untracked File Exclusion (`--exclude-untracked` / `-u`)**: Added filtering option to ignore repositories with only untracked files (`modified == 0 and untracked > 0`), reducing noise from temporary scratch files.
|
|
15
|
+
- **Direct Module Execution (`python -m git_scanner`)**: Added `git_scanner/__main__.py` to allow running the utility even if Python's user Scripts directory is not configured on the system `PATH`.
|
|
16
|
+
- **Version Query Flag (`--version` / `-v`)**: Added fast `--version` display to check the installed release without running scans.
|
|
17
|
+
- **Upstream Synchronization Metrics**: Branch status now displays ahead/behind commit indicators (`[↑X ↓Y]`) by parsing `git status --porcelain -b`.
|
|
18
|
+
- **Dual Export Capabilities**: Dynamic export supporting both JSON (`.json`) and CSV (`.csv`) output formats via `--export <path>`.
|
|
19
|
+
- **Last Commit Age Metric**: Added relative last commit timestamp (`git log -1 --format=%cr`) to CLI output, interactive TUI table, and structured exports.
|
|
20
|
+
- **Persistent Configuration Support**: Automatic configuration parsing from `~/.gitscannerrc`, `.gitscannerrc`, and `pyproject.toml` (`[tool.gitscanner]`) to define default `exclude` directories and `max_depth`.
|
|
21
|
+
- **Path & Depth Filters**: Added `--max-depth` (`-d`) recursion constraints and `--exclude` (`-e`) directory blacklisting across both CLI and TUI modes.
|
|
22
|
+
- **Git Submodule Detection**: Detects `.git` files (submodules/worktrees) alongside `.git` directories.
|
|
23
|
+
|
|
24
|
+
### ⚡ Changed & Performance
|
|
25
|
+
- **Generative Traversal Pipelining**: Removed blocking `list()` wrapping from `find_git_repos` calls in both CLI and TUI modes, allowing worker threads to begin checking repository git status concurrently while disk traversal is in progress.
|
|
26
|
+
- **Parallel Subprocess Execution**: Integrated `ThreadPoolExecutor` (up to 32 concurrent workers) in both CLI and TUI worker threads, delivering 2x–4x scan speedups on multi-repository projects.
|
|
27
|
+
- **Batched TUI Updates**: Wrapped row additions inside `table.batch_update()` within `_render_table_rows`, preventing per-row UI reflows and eliminating UI stutter on large workspaces.
|
|
28
|
+
- **`os.scandir` Traversal Engine**: Replaced `os.walk` with iterative DFS using `os.scandir`, cutting directory scanning latency by ~41% and pruning heavy directories (`node_modules`, `.venv`, `build`, `dist`, `.tox`, etc.) without entering `.git` directories.
|
|
29
|
+
- **Unified Status Parsing**: Merged branch name, upstream sync, modified count, and untracked count retrieval into a single `git status --porcelain -b` call, cutting git execution overhead in half.
|
|
30
|
+
|
|
31
|
+
### 🎨 User Experience
|
|
32
|
+
- **Interactive Column Sorting**: Click any column header (ID, Path, Branch, Modified, Untracked, Last Commit) in the TUI to toggle ascending (▲) and descending (▼) sort order with instant feedback.
|
|
33
|
+
- **Chronological Timestamp Sorting**: Refactored Last Commit sorting in the TUI to sort by exact Unix epoch timestamps instead of string comparison, accurately ordering minutes vs weeks.
|
|
34
|
+
- **Live Search & Filter Overlay**: Press <kbd>/</kbd> or <kbd>s</kbd> to toggle real-time repository filtering by path or branch name; press <kbd>Escape</kbd> to close and return focus to the table.
|
|
35
|
+
- **Auto-Focus on Load**: DataTable automatically gains focus upon scan completion for instant keyboard arrow-key navigation.
|
|
36
|
+
- **OS-Aware Terminal Launcher**: Extended `open_external_terminal()` with detection for Windows Terminal (`wt`), PowerShell 7 (`pwsh`), macOS `iTerm2`, and modern Linux terminals (`alacritty`, `kitty`, `konsole`, `xfce4-terminal`, etc.).
|
|
37
|
+
- **Dynamic Path Truncation**: Responsive path truncation ensures full repository paths adapt to terminal screen dimensions without clipping UI columns.
|
|
38
|
+
|
|
39
|
+
### 🐛 Fixed & Reliability
|
|
40
|
+
- **Windows Codepage & Encoding Crash Prevention**: Reconfigured UTF-8 output streams to prevent legacy Windows `cmd.exe` codepage encoding crashes.
|
|
41
|
+
- **Export Separation**: Decoupled `display_branch` (with `[↑X ↓Y]` ANSI formatting) from `branch` (raw string), ensuring clean JSON and CSV exports.
|
|
42
|
+
- **Worker Cancellation Safety**: Background directory scanning in `GitScannerTUI` checks `worker.is_cancelled` at every yield step to allow clean and instant cancellation.
|
|
43
|
+
|
|
44
|
+
### 📚 Documentation
|
|
45
|
+
- **Comprehensive Installation & Troubleshooting Guide**: Added step-by-step guides for `pipx`, `uv`, and `pip`, including 1-line PowerShell and bash commands to resolve missing PATH / command not found errors on Windows, macOS, and Linux.
|
|
46
|
+
|
|
47
|
+
---
|
|
48
|
+
|
|
49
|
+
## [0.1.6] - 2026-08-18
|
|
50
|
+
|
|
51
|
+
### 🚀 Features (Evo 🚀)
|
|
52
|
+
- **Last Commit Age Metric**: Added relative last commit timestamp (`git log -1 --format=%cr`) to CLI output, interactive TUI table, and JSON export to help developers instantly prioritize stale vs recently touched dirty repos.
|
|
53
|
+
- **Enhanced Terminal Launcher**: Extended `open_external_terminal()` with `shutil.which` detection supporting Windows Terminal (`wt`), PowerShell 7 (`pwsh`), macOS `iTerm2`, and modern Linux terminals (`alacritty`, `kitty`, `konsole`, `xfce4-terminal`, etc.).
|
|
54
|
+
|
|
55
|
+
### 🎨 User Experience (Palette 🎨)
|
|
56
|
+
- **Search Escape & Keybinding Ergonomics**: Added <kbd>Escape</kbd> key handler to instantly cancel/dismiss search and return table focus. Supported both <kbd>/</kbd> and <kbd>s</kbd> search shortcuts.
|
|
57
|
+
- **Chronological Timestamp Sorting**: Refactored Last Commit sorting in the TUI to sort by exact Unix epoch timestamps instead of string comparison, ensuring proper chronological order (e.g. distinguishing minutes from weeks accurately).
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## [0.1.5] - 2026-08-15
|
|
62
|
+
|
|
63
|
+
### ⚡ Performance (Bolt ⚡)
|
|
64
|
+
- **Parallel Git Status Execution**: Integrated `ThreadPoolExecutor` in both CLI and TUI worker threads, executing `git status` subprocesses in parallel (2x–4x scan speedup on multi-repository projects).
|
|
65
|
+
|
|
66
|
+
### 🚀 Features (Evo 🚀)
|
|
67
|
+
- **Configuration File Support**: Added automatic configuration parsing from `~/.gitscannerrc`, `.gitscannerrc`, and `pyproject.toml` (`[tool.gitscanner]`) to define default `exclude` folders and `max_depth`.
|
|
68
|
+
|
|
69
|
+
### 🎨 User Experience (Palette 🎨)
|
|
70
|
+
- **Interactive Column Sorting**: Implemented `@on(DataTable.HeaderSelected)` to allow clicking any column header (ID, Path, Branch, Modified, Untracked) in the TUI to toggle ascending (▲) and descending (▼) sort order with instant feedback.
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
## [0.1.4] - 2026-08-12
|
|
75
|
+
|
|
76
|
+
### ⚡ Performance (Bolt ⚡)
|
|
77
|
+
- **Single Subprocess Status Parsing**: Refactored status check to use `git status --porcelain -b`. Retrieves branch name, modified file count, and untracked file count in a single subprocess call, cutting git execution overhead by 50%.
|
|
78
|
+
- **`os.scandir` Traversal Pruning**: High-speed directory scanner automatically skips heavy folders (`node_modules`, `.venv`, `build`, `dist`, `.tox`, etc.) without entering `.git` directories.
|
|
79
|
+
|
|
80
|
+
### 🚀 Features (Evo 🚀)
|
|
81
|
+
- **Advanced Path Filtering**: Added `--max-depth` (`-d`) to limit search depth and `--exclude` (`-e`) for custom folder exclusions across CLI and TUI modes.
|
|
82
|
+
- **Git Submodule Support**: Added detection for `.git` files (submodules) alongside `.git` directories.
|
|
83
|
+
- **JSON Data Export**: Added `--export <path.json>` flag to save scan results to structured JSON format.
|
|
84
|
+
|
|
85
|
+
### 🎨 User Experience (Palette 🎨)
|
|
86
|
+
- **TUI Ergonomics**: Added <kbd>Enter</kbd> key and double-click row selection (`@on(DataTable.RowSelected)`) to launch native terminals directly from the TUI.
|
|
87
|
+
- **Visual Feedback**: Added non-intrusive toast notifications when spawning terminals and automatic path truncation for long workspace directories.
|
|
88
|
+
- **Cross-Platform Fixes**: Reconfigured UTF-8 console output to prevent legacy Windows `cmd.exe` codepage encoding crashes.
|
|
89
|
+
|
|
90
|
+
---
|
|
91
|
+
|
|
92
|
+
## [0.1.3] - 2026-08-07
|
|
93
|
+
|
|
94
|
+
### 🚀 Added
|
|
95
|
+
- **AI Agent Operating Rules & Guidelines**: Created [`AGENTS.md`](AGENTS.md) defining strict contribution standards, performance policies, empirical verification rules, and mandatory PR structures (Executive Summary, Impact & Safety Matrix, Verification).
|
|
96
|
+
- **Scheduled Agent Prompt Suite**: Tailored three dedicated autonomous agent personas for the project:
|
|
97
|
+
- ⚡ **GitScanner Bolt**: Performance, directory scan, and thread optimizer ([`prompt-bolt.md`](prompt-bolt.md)).
|
|
98
|
+
- 🚀 **GitScanner Evo**: Feature evolution, CLI options, and cross-platform capability engineer ([`prompt-evo.md`](prompt-evo.md)).
|
|
99
|
+
- 🎨 **GitScanner Palette**: Textual TUI & CLI UX evolution engineer ([`prompt-pallete.md`](prompt-pallete.md)).
|
|
100
|
+
- **Automated PR Review Integration**: Created [`.coderabbit.yaml`](.coderabbit.yaml) for assertive CodeRabbit AI code reviews.
|
|
101
|
+
- **Dedicated Agent Branching**: Established the `Dev2Auto` branch as the target branch for automated agent PRs and feature submissions.
|
|
102
|
+
|
|
103
|
+
### ⚡ Changed
|
|
104
|
+
- **Packaging & CI/CD Docs**: Updated package setup references and GitHub Actions PyPI deployment documentation for automated OIDC publishing on GitHub releases.
|
|
105
|
+
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
## [0.1.0] - Initial Release
|
|
109
|
+
|
|
110
|
+
### 🚀 Added
|
|
111
|
+
- Asynchronous deep directory scanner using Python standard `subprocess` and `pathlib.Path`.
|
|
112
|
+
- Standard CLI table output powered by `Typer` and `Rich`.
|
|
113
|
+
- Interactive Neon-Cyan Terminal User Interface (TUI) powered by `Textual`.
|
|
114
|
+
- Cross-platform native terminal spawning (`cmd`, `osascript`, `gnome-terminal`, `konsole`, `alacritty`, `xterm`).
|
|
115
|
+
- Registered global CLI command `scanrepos`.
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) [year] [fullname]
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) [year] [fullname]
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: git-uncommitted-scanner
|
|
3
|
+
Version: 0.2.0
|
|
4
|
+
Summary: A lightweight CLI to scan for uncommitted Git repositories.
|
|
5
|
+
License: MIT
|
|
6
|
+
Project-URL: Homepage, https://github.com/RootDeveloperDS/git-uncommitted-scanner
|
|
7
|
+
Project-URL: Repository, https://github.com/RootDeveloperDS/git-uncommitted-scanner
|
|
8
|
+
Project-URL: Bug Tracker, https://github.com/RootDeveloperDS/git-uncommitted-scanner/issues
|
|
9
|
+
Classifier: Programming Language :: Python :: 3
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.9
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Requires-Dist: typer>=0.9.0
|
|
15
|
+
Requires-Dist: rich>=13.0.0
|
|
16
|
+
Requires-Dist: textual>=0.50.0
|
|
17
|
+
|
|
18
|
+
# 🔍 Git Uncommitted Scanner (`scanrepos`)
|
|
19
|
+
|
|
20
|
+

|
|
21
|
+

|
|
22
|
+

|
|
23
|
+

|
|
24
|
+
[](https://badge.fury.io/py/git-uncommitted-scanner)
|
|
25
|
+

|
|
26
|
+
|
|
27
|
+
**A high-speed, cross-platform CLI & TUI utility that recursively deep-scans your filesystem to instantly locate Git repositories with pending uncommitted changes.**
|
|
28
|
+
|
|
29
|
+
---
|
|
30
|
+
|
|
31
|
+
## ⚡ Why `git-uncommitted-scanner`?
|
|
32
|
+
|
|
33
|
+
Tired of discovering forgotten, uncommitted code changes in scattered workspace folders months later? `git-uncommitted-scanner` recursively hunts down pending changes across your entire filesystem with asynchronous speed, presenting them in either a clean CLI table or a high-tech interactive Terminal User Interface (TUI).
|
|
34
|
+
|
|
35
|
+
<p align="center">
|
|
36
|
+
<img src="docs/images/interactive_scan.png" alt="Git Uncommitted Scanner - Interactive Neon-Cyan TUI" width="850">
|
|
37
|
+
</p>
|
|
38
|
+
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
## 📦 Installation
|
|
42
|
+
|
|
43
|
+
Choose the installation method that fits your environment:
|
|
44
|
+
|
|
45
|
+
### Method 1: Recommended for CLI tools (`pipx` / `uv`)
|
|
46
|
+
`pipx` and `uv` automatically isolate dependencies and ensure binary executable scripts are added to your system `PATH`:
|
|
47
|
+
|
|
48
|
+
```bash
|
|
49
|
+
# Using pipx (Recommended - automatically configures PATH)
|
|
50
|
+
pipx install git-uncommitted-scanner
|
|
51
|
+
pipx ensurepath
|
|
52
|
+
|
|
53
|
+
# Or using uv
|
|
54
|
+
uv tool install git-uncommitted-scanner
|
|
55
|
+
|
|
56
|
+
# Or run instantly without installing:
|
|
57
|
+
uvx git-uncommitted-scanner
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### Method 2: Standard `pip`
|
|
61
|
+
```bash
|
|
62
|
+
pip install git-uncommitted-scanner
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
> [!TIP]
|
|
66
|
+
> **Can't find the `scanrepos` command after installing?**
|
|
67
|
+
> You can **always** run the scanner directly through Python without modifying your PATH:
|
|
68
|
+
> ```bash
|
|
69
|
+
> python -m git_scanner
|
|
70
|
+
> ```
|
|
71
|
+
> See the [Troubleshooting & PATH Fix](#-troubleshooting--faq) section below to permanently add `scanrepos` to your terminal.
|
|
72
|
+
|
|
73
|
+
---
|
|
74
|
+
|
|
75
|
+
## 🚀 Usage
|
|
76
|
+
|
|
77
|
+
You can run the scanner using either `scanrepos` or `python -m git_scanner`:
|
|
78
|
+
|
|
79
|
+
### 1. Standard CLI Mode
|
|
80
|
+
Run a rapid background scan that outputs a styled `Rich` table listing all uncommitted repositories along with branch names, modified file counts, untracked counts, and last commit age.
|
|
81
|
+
|
|
82
|
+
```bash
|
|
83
|
+
# Scan the current directory
|
|
84
|
+
scanrepos
|
|
85
|
+
|
|
86
|
+
# Scan a specific directory path
|
|
87
|
+
scanrepos /path/to/your/projects
|
|
88
|
+
|
|
89
|
+
# Limit search depth to 3 levels
|
|
90
|
+
scanrepos /path/to/projects -d 3
|
|
91
|
+
|
|
92
|
+
# Exclude specific folders (e.g. node_modules, build, vendor)
|
|
93
|
+
scanrepos /path/to/projects -e "vendor,build"
|
|
94
|
+
|
|
95
|
+
# Ignore repositories with only untracked files (clean worktrees)
|
|
96
|
+
scanrepos -u
|
|
97
|
+
|
|
98
|
+
# Scripting / Automation: Output ONLY raw paths (ideal for xargs, pipelines, CI/CD)
|
|
99
|
+
scanrepos -q
|
|
100
|
+
|
|
101
|
+
# Check installed version
|
|
102
|
+
scanrepos --version
|
|
103
|
+
|
|
104
|
+
# View all CLI options and flags
|
|
105
|
+
scanrepos --help
|
|
106
|
+
|
|
107
|
+
# Export results to JSON or CSV (format auto-detected by extension)
|
|
108
|
+
scanrepos /path/to/projects --export scan_results.json
|
|
109
|
+
scanrepos /path/to/projects --export scan_results.csv
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
<p align="center">
|
|
113
|
+
<img src="docs/images/scanning.png" alt="Git Uncommitted Scanner - Standard CLI Scanning Output" width="850">
|
|
114
|
+
</p>
|
|
115
|
+
|
|
116
|
+
<details>
|
|
117
|
+
<summary><b>📖 Click to preview full CLI Options & Flags (<code>scanrepos --help</code>)</b></summary>
|
|
118
|
+
<br>
|
|
119
|
+
<p align="center">
|
|
120
|
+
<img src="docs/images/scan_help.png" alt="Git Uncommitted Scanner - CLI Help Menu" width="850">
|
|
121
|
+
</p>
|
|
122
|
+
</details>
|
|
123
|
+
|
|
124
|
+
### 2. Interactive TUI Mode (`-i`)
|
|
125
|
+
Launch the Neon-Cyan Terminal User Interface. Navigate repositories with keyboard arrows, double-click or press <kbd>Enter</kbd> to spawn a native shell terminal directly inside the highlighted workspace.
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
# Launch TUI in the current directory
|
|
129
|
+
scanrepos -i
|
|
130
|
+
|
|
131
|
+
# Launch TUI with custom path, depth limits, and exclusions
|
|
132
|
+
scanrepos -i /path/to/your/projects -e "vendor,temp" -d 4
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
#### TUI Keyboard & Mouse Controls:
|
|
136
|
+
* **Column Header Click**: Click any column header to sort ascending (▲) / descending (▼) by ID, Path, Branch, Modified, Untracked, or Last Commit.
|
|
137
|
+
* <kbd>/</kbd> or <kbd>s</kbd> : Toggle live search/filter bar to filter repositories by name or branch in real time.
|
|
138
|
+
* <kbd>Escape</kbd> : Close/dismiss search bar and restore focus to the repository table.
|
|
139
|
+
* <kbd>Enter</kbd> / Double-Click / <kbd>o</kbd> : Spawn native OS terminal (`wt`, `pwsh`, `cmd`, `iTerm2`, `Terminal.app`, `gnome-terminal`, `alacritty`, `kitty`, etc.) in the selected repository.
|
|
140
|
+
* <kbd>r</kbd> : Trigger an asynchronous re-scan of the target folder.
|
|
141
|
+
* <kbd>q</kbd> : Quit the application.
|
|
142
|
+
|
|
143
|
+
---
|
|
144
|
+
|
|
145
|
+
### 3. Configuration File Support (`.gitscannerrc` / `pyproject.toml`)
|
|
146
|
+
You can define persistent default exclusions and search depth in `~/.gitscannerrc`, `.gitscannerrc`, or `pyproject.toml`:
|
|
147
|
+
|
|
148
|
+
```ini
|
|
149
|
+
# .gitscannerrc
|
|
150
|
+
[gitscanner]
|
|
151
|
+
exclude = vendor, temp, test_env, cache
|
|
152
|
+
max_depth = 4
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Or in `pyproject.toml`:
|
|
156
|
+
```toml
|
|
157
|
+
[tool.gitscanner]
|
|
158
|
+
exclude = ["vendor", "temp", "cache"]
|
|
159
|
+
max_depth = 4
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
---
|
|
163
|
+
|
|
164
|
+
## ✨ Key Features
|
|
165
|
+
|
|
166
|
+
* **⚡ Generative Concurrency & Deep Scanning**: Traverses nested folder trees using iterative `os.scandir` DFS pruning and pipelines discoveries straight into a multi-threaded `ThreadPoolExecutor` (up to 32 concurrent workers), overlapping disk I/O with subprocess execution.
|
|
167
|
+
* **🖥️ Interactive Neon-Cyan TUI**: Built with customized `Textual` components, providing smooth keyboard navigation, zebra striping, and automatic table focus on scan completion.
|
|
168
|
+
* **📊 Bi-Directional Interactive Column Sorting**: Click any column header or navigate to toggle ascending (▲) and descending (▼) sort order by ID, Path, Branch, Modified files, Untracked files, or chronological Last Commit timestamp.
|
|
169
|
+
* **🔍 Real-Time Live Search Overlay**: Press <kbd>/</kbd> or <kbd>s</kbd> to filter large project lists by repository path or branch in real time; dismiss with <kbd>Escape</kbd> to return to table navigation.
|
|
170
|
+
* **🌐 Upstream Synchronization Telemetry**: Parses remote tracking branches to display live ahead/behind indicators (`[↑X ↓Y]`), alerting you immediately when local commits need pushing or upstream changes need pulling.
|
|
171
|
+
* **💻 OS-Aware Native Terminal Launcher**: Highlight any uncommitted repository in the TUI and press <kbd>Enter</kbd>, double-click, or press <kbd>o</kbd> to spawn a native shell running `git status` inside that folder (auto-detects Windows Terminal `wt`, PowerShell 7 `pwsh`, `cmd`, macOS `iTerm2`/`Terminal.app`, Linux `gnome-terminal`, `alacritty`, `kitty`, `konsole`, etc.).
|
|
172
|
+
* **🤖 Script Automation & Quiet Mode**: Added `--quiet` (`-q`) mode to suppress all rich spinners and tables, outputting only raw, newline-delimited paths for seamless piping into `xargs`, shell scripts, or CI/CD pipelines.
|
|
173
|
+
* **🎯 Granular Noise Reduction**: Ignore repositories with only untracked files (`-u` / `--exclude-untracked`), exclude custom directory blacklists (`-e`), and limit traversal recursion depth (`-d`).
|
|
174
|
+
* **📄 Dual JSON & CSV Data Export**: Automatically infers and exports scan data to either structured JSON (`.json`) or spreadsheet-friendly CSV (`.csv`) via `--export`.
|
|
175
|
+
* **⚙️ Persistent Configuration**: Define global or project defaults in `~/.gitscannerrc`, `.gitscannerrc`, or `pyproject.toml`.
|
|
176
|
+
* **🌳 Submodule & Worktree Support**: Accurately recognizes both standard `.git` directories and `.git` pointers (submodules and git worktrees).
|
|
177
|
+
* **🛡️ Zero-Config Module Execution**: Built-in `python -m git_scanner` runner ensures the app runs anywhere, even on restricted or shared lab PCs where Python's `Scripts/` folder is not on system `PATH`.
|
|
178
|
+
* **🪶 Zero Dependencies Bloat**: Pure Python standard library logic alongside `typer`, `rich`, and `textual` — no heavy C extensions or bloatware.
|
|
179
|
+
|
|
180
|
+
---
|
|
181
|
+
|
|
182
|
+
## 🛠️ Technology Stack
|
|
183
|
+
|
|
184
|
+
* **Core Engine**: Python `>=3.9`, standard `subprocess`, `pathlib.Path`
|
|
185
|
+
* **CLI Routing**: [`Typer`](https://typer.tiangolo.com/)
|
|
186
|
+
* **Terminal Formatting**: [`Rich`](https://rich.readthedocs.io/)
|
|
187
|
+
* **Interactive TUI**: [`Textual`](https://textual.textualize.io/)
|
|
188
|
+
* **Build System**: `setuptools` (PEP 621 compliant)
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## 🤖 Agent Ecosystem & Developer Guidelines
|
|
193
|
+
|
|
194
|
+
This repository includes a structured multi-agent automation setup for continuous maintenance:
|
|
195
|
+
|
|
196
|
+
* [`AGENTS.md`](AGENTS.md) — Mandatory developer & autonomous agent guidelines, zero-fake-progress rules, and PR formatting standards.
|
|
197
|
+
* [`prompt-bolt.md`](prompt-bolt.md) — **GitScanner Bolt ⚡** (Performance & scan speed optimizer prompt).
|
|
198
|
+
* [`prompt-evo.md`](prompt-evo.md) — **GitScanner Evo 🚀** (Product feature evolution prompt).
|
|
199
|
+
* [`prompt-pallete.md`](prompt-pallete.md) — **GitScanner Palette 🎨** (TUI & CLI UX evolution prompt).
|
|
200
|
+
* [`.coderabbit.yaml`](.coderabbit.yaml) — Assertive automated PR code review rules.
|
|
201
|
+
* **Target PR Branch**: `Dev2Auto`
|
|
202
|
+
|
|
203
|
+
---
|
|
204
|
+
|
|
205
|
+
## 🔧 Troubleshooting & FAQ
|
|
206
|
+
|
|
207
|
+
### `'scanrepos' is not recognized as an internal or external command`
|
|
208
|
+
|
|
209
|
+
This occurs when Python installs command-line scripts to your user directory (common on shared, lab, or school PCs where administrator rights are restricted), but that directory has not yet been added to your system `PATH`.
|
|
210
|
+
|
|
211
|
+
#### Quick Fix 1: Run via Python directly (Works instantly, no setup needed)
|
|
212
|
+
```bash
|
|
213
|
+
python -m git_scanner
|
|
214
|
+
```
|
|
215
|
+
*(or `python -m git_scanner -i` for TUI mode)*
|
|
216
|
+
|
|
217
|
+
#### Quick Fix 2: Reinstall with `pipx` (Recommended)
|
|
218
|
+
`pipx` automatically isolates CLI tools and configures your PATH:
|
|
219
|
+
```bash
|
|
220
|
+
pip install pipx
|
|
221
|
+
pipx ensurepath
|
|
222
|
+
pipx install git-uncommitted-scanner
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
#### Quick Fix 3: Add Python Scripts to your PATH manually
|
|
226
|
+
|
|
227
|
+
* **Windows (PowerShell)**:
|
|
228
|
+
Run this one-liner in PowerShell to permanently add Python Scripts to your user PATH:
|
|
229
|
+
```powershell
|
|
230
|
+
[Environment]::SetEnvironmentVariable("PATH", $env:PATH + ";$((py -c 'import site; print(site.USER_BASE)') + '\Scripts')", "User")
|
|
231
|
+
```
|
|
232
|
+
Then restart your terminal.
|
|
233
|
+
|
|
234
|
+
* **Linux / macOS**:
|
|
235
|
+
Add Python bin to your `~/.bashrc` or `~/.zshrc`:
|
|
236
|
+
```bash
|
|
237
|
+
export PATH="$HOME/.local/bin:$PATH"
|
|
238
|
+
```
|
|
239
|
+
Then reload your shell (`source ~/.bashrc` or `source ~/.zshrc`).
|
|
240
|
+
|
|
241
|
+
---
|
|
242
|
+
|
|
243
|
+
## 📜 Version History & Release Notes
|
|
244
|
+
|
|
245
|
+
For a complete record of all updates, bug fixes, and feature additions across releases, please refer to the **[`CHANGELOG.md`](CHANGELOG.md)**.
|
|
246
|
+
|
|
247
|
+
---
|
|
248
|
+
|
|
249
|
+
Built with ❤️ by [RootDeveloperDS](https://github.com/RootDeveloperDS)
|