git-auto-pro 2.0.0__tar.gz → 2.5.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.
Files changed (72) hide show
  1. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/.editorconfig +0 -0
  2. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/.gitattributes +0 -0
  3. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/.gitignore +0 -0
  4. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/.pre-commit-config.yaml +0 -0
  5. git_auto_pro-2.5.0/CHANGELOG.md +132 -0
  6. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/CONTRIBUTING.md +0 -0
  7. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/LICENSE +0 -0
  8. git_auto_pro-2.5.0/Makefile +117 -0
  9. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/PKG-INFO +26 -5
  10. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/README.md +25 -4
  11. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/SETUP_GUIDE.md +0 -0
  12. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/docs/api.md +0 -0
  13. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/docs/examples.md +0 -0
  14. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/docs/troubleshooting.md +0 -0
  15. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/docs/usage.md +0 -0
  16. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/examples/advanced_usage.py +0 -0
  17. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/examples/basic_usage.py +0 -0
  18. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/git_auto_pro/__init__.py +1 -1
  19. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/git_auto_pro/backup.py +14 -9
  20. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/git_auto_pro/cli.py +0 -0
  21. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/git_auto_pro/commands/__init__.py +0 -0
  22. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/git_auto_pro/commands/doctor.py +0 -0
  23. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/git_auto_pro/commands/release.py +0 -0
  24. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/git_auto_pro/commands/safe_flow.py +0 -0
  25. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/git_auto_pro/config.py +0 -0
  26. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/git_auto_pro/git_commands.py +0 -0
  27. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/git_auto_pro/github.py +133 -50
  28. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/git_auto_pro/github_issues.py +94 -115
  29. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/git_auto_pro/github_pr/__init__.py +0 -0
  30. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/git_auto_pro/github_pr/pr_manager.py +116 -92
  31. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/git_auto_pro/gitignore_manager.py +0 -0
  32. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/git_auto_pro/scaffolding/__init__.py +0 -0
  33. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/git_auto_pro/scaffolding/github_templates.py +0 -0
  34. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/git_auto_pro/scaffolding/gitignore.py +0 -0
  35. git_auto_pro-2.5.0/git_auto_pro/scaffolding/hooks.py +138 -0
  36. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/git_auto_pro/scaffolding/license.py +0 -0
  37. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/git_auto_pro/scaffolding/project.py +17 -5
  38. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/git_auto_pro/scaffolding/readme.py +0 -0
  39. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/git_auto_pro/scaffolding/templates.py +0 -0
  40. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/git_auto_pro/scaffolding/workflows.py +0 -0
  41. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/git_auto_pro.egg-info/PKG-INFO +26 -5
  42. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/git_auto_pro.egg-info/SOURCES.txt +4 -0
  43. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/pyproject.toml +1 -1
  44. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/requirements-dev.txt +0 -0
  45. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/requirements.txt +0 -0
  46. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/scripts/build.sh +0 -0
  47. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/scripts/install.sh +0 -0
  48. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/scripts/test.sh +0 -0
  49. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/setup.py +1 -1
  50. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/tests/__init__.py +0 -0
  51. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/tests/conftest.py +0 -0
  52. git_auto_pro-2.5.0/tests/test_backup.py +38 -0
  53. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/tests/test_cli.py +0 -0
  54. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/tests/test_config.py +0 -0
  55. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/tests/test_doctor.py +0 -0
  56. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/tests/test_git_commands.py +0 -0
  57. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/tests/test_github.py +0 -0
  58. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/tests/test_github_issues.py +0 -0
  59. git_auto_pro-2.5.0/tests/test_github_remote.py +53 -0
  60. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/tests/test_gitignore_manager.py +0 -0
  61. git_auto_pro-2.5.0/tests/test_hooks.py +67 -0
  62. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/tests/test_release.py +0 -0
  63. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/tests/test_safe_flow.py +0 -0
  64. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/tests/test_scaffolding.py +0 -0
  65. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/tests/test_undo.py +0 -0
  66. git_auto_pro-2.0.0/CHANGELOG.md +0 -150
  67. git_auto_pro-2.0.0/git_auto_pro/scaffolding/hooks.py +0 -331
  68. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/git_auto_pro.egg-info/dependency_links.txt +0 -0
  69. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/git_auto_pro.egg-info/entry_points.txt +0 -0
  70. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/git_auto_pro.egg-info/requires.txt +0 -0
  71. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/git_auto_pro.egg-info/top_level.txt +0 -0
  72. {git_auto_pro-2.0.0 → git_auto_pro-2.5.0}/setup.cfg +0 -0
File without changes
File without changes
@@ -0,0 +1,132 @@
1
+ # Changelog
2
+
3
+ All notable changes to this 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
+ ## [2.5.0] - 2026-07-26
9
+
10
+ ### 🔴 Critical Fixes
11
+ - **Repository owner now detected from the remote URL** — `issue`, `pr`, `prs`, `merge-pr`, `review-pr`, `collab`, and `protect` previously assumed the repository belonged to the authenticated user (`repos/<you>/<repo>`), so they 404'd on organization, fork, or collaborator repos. The owner is now parsed from the `origin` remote (HTTPS, scp-style SSH `git@github.com:owner/repo`, `ssh://`, and `git://` forms). `--repo owner/name` is supported on all of these commands; a bare `--repo name` keeps the legacy behavior (paired with your login).
12
+ - **`git-auto new` respects `default_branch`** — project creation no longer hardcodes `main`; it reads the configured default branch and aligns the local branch (`git branch -M`) before pushing, so it no longer fails when git's initial branch is `master`.
13
+ - **Backups now preserve history** — `backup` archives the entire `.git` directory (including `objects/`). Previously only `.git/{config,HEAD,refs,hooks}` were archived, leaving refs pointing at missing objects, so a restored repo had no history. `restore` now uses the `filter="data"` extraction guard on Python 3.12+.
14
+ - **Generated git hooks are POSIX-`sh` safe** — `pre-commit`/`pre-push` hooks used the bash-only `&>` redirect, which `/bin/sh` (dash on Ubuntu/Debian) parses as `&` (background) + `> /dev/null`. This made the `command -v <tool>` guard always pass, so the hook ran the (missing) tool and failed, blocking commits on systems without ruff/black/pytest installed. Replaced with the POSIX `> /dev/null 2>&1` form.
15
+ - **PR reviewers/labels report the real outcome** — `pr` no longer prints `✓ Reviewers requested` / `✓ Labels added` when the API rejected the request (e.g. 422). The sub-requests now call `raise_for_status()` and report the actual HTTP status on failure.
16
+ - **`close_issue` / `update_issue` network handling** — both now catch `ConnectionError`/`Timeout` (previously only `HTTPError` was caught, so a transient network error crashed with a raw traceback). All requests have `timeout=10`. The closing comment is now best-effort — a network error on the comment no longer aborts the actual close.
17
+ - **Accurate `merge-pr` diagnostics** — 405 now reports "not mergeable (pending/failed checks, missing reviews, draft, or branch protection)" and 409 reports "merge conflicts or head branch changed". The previous messages were swapped.
18
+
19
+ ### 🛠️ Changed
20
+ - **Modernized GitHub auth** — switched from the legacy `Authorization: token <PAT>` scheme and `application/vnd.github.v3+json` media type to `Authorization: Bearer <PAT>`, `application/vnd.github+json`, and the `X-GitHub-Api-Version: 2022-11-28` header. Removed the deprecated `mercy-preview` (topics) and `luke-cage-preview` (branch protection) preview media types.
21
+ - **Removed dead code** — deleted an accidental ~190-line duplicate of the `github_templates` module that had been pasted into `scaffolding/hooks.py` (it was never imported; `cli.py` uses the real `github_templates.py`). `hooks.py` shrank from 331 to 138 lines.
22
+ - **Reduced redundant API calls** — GitHub operations no longer make a separate `GET /user` round-trip solely to build repo URLs when the owner is detected from the remote.
23
+
24
+ ### 🧪 Testing
25
+ - 89 tests total (up from 70)
26
+ - 3 new test files: `test_github_remote.py` (remote URL parsing + owner resolution), `test_hooks.py` (POSIX-`sh` portability incl. live `dash` execution), `test_backup.py` (backup/restore round-trip proving history survives)
27
+ - Zero regressions on the existing suite
28
+
29
+ ---
30
+
31
+ ## [2.0.0] - 2026-03-10
32
+
33
+ ### 🔴 Critical Fixes
34
+ - **Default Branch Config Bug** — `push` and `init` now read `default_branch` from `~/.git-auto-config.json` instead of hardcoding `main`/`master`
35
+ - **Empty Commit Guard** — Prevents empty commits with Rich warning; handles `BadName` exception for brand new repos with no HEAD
36
+ - **Push Conflict Detection** — Detects rejected pushes due to diverged history, suggests `git-auto pull --rebase`
37
+ - **Offline / API Graceful Handling** — All GitHub API calls wrapped with `ConnectionError`/`Timeout` handling; no raw tracebacks
38
+
39
+ ### 🟡 New Features
40
+ - **Safe Commit Flow** (`--safe` flag on `push`/`commit`)
41
+ - Commits to `test/<branch>` automatically
42
+ - Handles branch name collisions via `test/<branch>-{timestamp}` fallback
43
+ - Auto-creates Pull Request with diff summary and review checklist
44
+ - Configurable via `safe_mode`, `test_branch_prefix`, `auto_create_pr` settings
45
+ - **`git-auto undo`** — Undo last commit (soft/hard/force-push)
46
+ - `--hard` with confirmation prompt
47
+ - `--push` for soft reset + force push
48
+ - `--yes` flag bypasses confirmation (CI-safe)
49
+ - **`git-auto release`** — Full release management
50
+ - Reads version from `pyproject.toml` (canonical source)
51
+ - Bumps patch/minor/major, syncs `__init__.py` + `setup.py`
52
+ - Auto-generates changelog from conventional commits
53
+ - Creates Git tag + GitHub release (with `--draft` option)
54
+
55
+ ### 🟢 New Features
56
+ - **`git-auto doctor`** — System diagnostics
57
+ - Checks: Git version, Python version, token validity, remote config, branch consistency, untracked files, safe mode
58
+ - **`git-auto pr`** — Standalone PR management
59
+ - `git-auto pr "title"` — Create PR from current branch
60
+ - `git-auto prs` — List pull requests
61
+ - `git-auto merge-pr 42` — Merge PR (with `--squash`/`--rebase`)
62
+ - `git-auto review-pr 42` — Open PR in browser
63
+
64
+ ### New Modules
65
+ | Module | Purpose |
66
+ |--------|---------|
67
+ | `commands/safe_flow.py` | Safe commit flow |
68
+ | `commands/release.py` | Release management |
69
+ | `commands/doctor.py` | System diagnostics |
70
+ | `github_pr/pr_manager.py` | PR CRUD via GitHub API |
71
+
72
+ ### New Config Options
73
+ - `safe_mode` — Enable safe commit flow by default (default: `false`)
74
+ - `test_branch_prefix` — Prefix for safe branches (default: `test`)
75
+ - `auto_create_pr` — Auto-create PR on safe push (default: `true`)
76
+ - `pr_base_branch` — Base branch for PRs (default: `main`)
77
+
78
+ ### Testing
79
+ - 83 tests total (up from 42)
80
+ - 5 new test files: `test_undo.py`, `test_pr_manager.py`, `test_doctor.py`, `test_release.py`, `test_safe_flow.py`
81
+ - Zero regressions on existing test suite
82
+
83
+ ---
84
+
85
+ ## [1.1.0] - 2026-01-04
86
+
87
+ ### Added
88
+ - **Interactive .gitignore Manager** 🎉
89
+ - `git-auto ignore-manager` command
90
+ - Browse all project files with ignore status
91
+ - Select files to ignore with checkbox interface
92
+ - Add patterns by type (folder, extension, file, custom)
93
+ - Common presets (Python, Node.js, IDEs, Build artifacts, Logs)
94
+ - Remove patterns from .gitignore
95
+ - Clean already-tracked files from git
96
+ - Preview changes before saving
97
+ - Show current .gitignore patterns
98
+
99
+ ### Enhanced
100
+ - Better file management workflow
101
+ - More user-friendly .gitignore creation
102
+ - Visual feedback for ignore status
103
+
104
+ ---
105
+
106
+ ## [1.0.0] - 2026-01-03
107
+
108
+ ### Added
109
+ - GitHub authentication with secure keyring storage
110
+ - Repository creation and management
111
+ - Complete Git command automation
112
+ - Project scaffolding with multiple templates
113
+ - Interactive README, LICENSE, and .gitignore generators
114
+ - CI/CD workflow generation (GitHub Actions, GitLab CI)
115
+ - Git hooks management (pre-commit, pre-push, commit-msg)
116
+ - GitHub issue and PR template generation
117
+ - Collaboration features (add collaborators, branch protection)
118
+ - Repository backup and restore functionality
119
+ - Configuration system with persistent storage
120
+ - Repository statistics and analytics
121
+ - Support for Python 3.8+
122
+ - 30+ CLI commands
123
+ - Beautiful terminal output with Rich library
124
+
125
+ ---
126
+
127
+ ## [0.1.0] - Development
128
+
129
+ ### Added
130
+ - Initial project structure
131
+ - Basic CLI framework
132
+ - Core functionality implementation
File without changes
@@ -0,0 +1,117 @@
1
+ # Git-Auto Pro — development tasks.
2
+ #
3
+ # Common usage:
4
+ # make install # create venv and install the package (editable, with dev extras)
5
+ # make test # run the test suite
6
+ # make clean # remove build artifacts and caches
7
+ # make help # list all targets
8
+ #
9
+ # Override the Python interpreter / venv location if needed:
10
+ # make install PYTHON=python3.11 VENV=.venv
11
+
12
+ PYTHON ?= python3
13
+ VENV ?= venv
14
+ VENV_BIN := $(VENV)/bin
15
+ VENV_PYTHON := $(VENV_BIN)/python
16
+ VENV_PIP := $(VENV_BIN)/pip
17
+
18
+ # Source/test directories for linting/formatting/type-checking.
19
+ PKG := git_auto_pro tests
20
+
21
+ .PHONY: help install install-no-venv clean clean-venv clean-all \
22
+ test test-cov lint format typecheck build publish-test publish \
23
+ precommit check
24
+
25
+ help: ## Show this help message
26
+ @echo "Git-Auto Pro — available targets:"
27
+ @echo ""
28
+ @awk 'BEGIN {FS = ":.*##"} \
29
+ /^[a-zA-Z_-]+:.*##/ { printf " \033[36m%-16s\033[0m %s\n", $$1, $$2 }' \
30
+ $(MAKEFILE_LIST)
31
+ @echo ""
32
+ @echo "Override defaults: make install PYTHON=python3.11 VENV=.venv"
33
+
34
+ # ────────────────────────────── install ──────────────────────────────
35
+
36
+ install: $(VENV_BIN)/activate ## Create the virtualenv and install the package (editable, with dev extras)
37
+
38
+ $(VENV_BIN)/activate:
39
+ @echo ">> Creating virtualenv at $(VENV)/"
40
+ $(PYTHON) -m venv $(VENV)
41
+ $(VENV_PYTHON) -m pip install --upgrade pip
42
+ @echo ">> Installing git-auto-pro (editable, with dev extras)"
43
+ $(VENV_PIP) install -e ".[dev]"
44
+ @echo ""
45
+ @echo "✅ Installed. Activate with: source $(VENV_BIN)/activate"
46
+ @echo " Then run: git-auto --help"
47
+
48
+ install-no-venv: ## Install (editable, with dev extras) into the current environment
49
+ @echo ">> Installing git-auto-pro into the current environment"
50
+ $(PYTHON) -m pip install --upgrade pip
51
+ $(PYTHON) -m pip install -e ".[dev]"
52
+
53
+ # ────────────────────────────── clean ────────────────────────────────
54
+
55
+ CLEAN_PATHS := dist build *.egg-info htmlcov cover .coverage .coverage.* \
56
+ .pytest_cache .mypy_cache .ruff_cache .tox .nox
57
+
58
+ clean: ## Remove build artifacts, coverage, and tool caches
59
+ @echo ">> Removing build artifacts and caches"
60
+ rm -rf $(CLEAN_PATHS)
61
+ @find . -type d -name __pycache__ -not -path './$(VENV)/*' -exec rm -rf {} + 2>/dev/null || true
62
+
63
+ clean-venv: ## Remove the virtualenv
64
+ @echo ">> Removing virtualenv at $(VENV)/"
65
+ rm -rf $(VENV)
66
+
67
+ clean-all: clean clean-venv ## Remove everything: artifacts/caches and the virtualenv
68
+
69
+ # ────────────────────────────── quality ──────────────────────────────
70
+
71
+ test: ## Run the test suite
72
+ @echo ">> Running tests"
73
+ pytest
74
+
75
+ test-cov: ## Run the test suite with coverage (HTML + terminal)
76
+ @echo ">> Running tests with coverage"
77
+ pytest --cov=git_auto_pro --cov-report=html --cov-report=term
78
+ @echo "Coverage report: htmlcov/index.html"
79
+
80
+ lint: ## Check formatting (black) and lint (ruff) without modifying files
81
+ @echo ">> Linting"
82
+ black --check $(PKG)
83
+ ruff check $(PKG)
84
+
85
+ format: ## Format with black and auto-fix with ruff
86
+ @echo ">> Formatting"
87
+ black $(PKG)
88
+ ruff check $(PKG) --fix
89
+
90
+ typecheck: ## Type-check with mypy
91
+ @echo ">> Type checking"
92
+ mypy git_auto_pro/
93
+
94
+ check: lint typecheck test ## Run lint + typecheck + tests (pre-PR gate)
95
+
96
+ # ────────────────────────────── build / publish ──────────────────────
97
+
98
+ build: clean ## Build sdist and wheel into dist/
99
+ @echo ">> Building package"
100
+ $(PYTHON) -m build
101
+ @echo "Distribution files in dist/:"
102
+ @ls -1 dist/
103
+
104
+ publish-test: build ## Build and upload to TestPyPI (verify before real release)
105
+ @echo ">> Uploading to TestPyPI"
106
+ $(PYTHON) -m twine upload --repository testpypi dist/*
107
+ @echo "Verify with: pip install --index-url https://test.pypi.org/simple/ git-auto-pro"
108
+
109
+ publish: build ## Build and upload to PyPI
110
+ @echo ">> Uploading to PyPI"
111
+ $(PYTHON) -m twine upload dist/*
112
+
113
+ # ────────────────────────────── pre-commit ───────────────────────────
114
+
115
+ precommit: ## Install the pre-commit hooks locally
116
+ @echo ">> Installing pre-commit hooks"
117
+ pre-commit install
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: git-auto-pro
3
- Version: 2.0.0
3
+ Version: 2.5.0
4
4
  Summary: Complete Git + GitHub automation CLI tool with interactive file management
5
5
  Home-page: https://github.com/HimanshuSingh-966/git-auto-pro
6
6
  Author: Himanshu Singh
@@ -52,6 +52,18 @@ Git-Auto Pro is a powerful command-line tool that automates your entire developm
52
52
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
53
53
  [![PyPI](https://img.shields.io/badge/pypi-git--auto--pro-orange.svg)](https://pypi.org/project/git-auto-pro/)
54
54
 
55
+ ## 🆕 What's New in 2.5.0
56
+
57
+ - **Org/fork repo support** — GitHub commands (`issue`, `pr`, `prs`, `merge-pr`, `review-pr`, `collab`, `protect`) now detect the repository **owner** from your `origin` remote instead of assuming it's your own. They work on organization, fork, and collaborator repos. Pass `--repo owner/name` to target any repo explicitly.
58
+ - **`git-auto new` honors `default_branch`** — no longer hardcodes `main`; aligns the local branch to your configured default before pushing.
59
+ - **Real backups** — `git-auto backup` now archives the full `.git` (including `objects/`), so `git-auto restore` actually brings back your history.
60
+ - **Portable generated hooks** — `pre-commit`/`pre-push` hooks are now POSIX-`sh` safe and no longer break on `dash` (`/bin/sh` on Ubuntu/Debian) when ruff/black/pytest aren't installed.
61
+ - **Honest PR feedback** — `git-auto pr` no longer claims "✓ Reviewers requested" when the API rejected the request; it reports the real HTTP status.
62
+ - **Tougher network handling** — `issue close`/`update` and all PR ops now handle connection errors and timeouts gracefully instead of dumping a traceback.
63
+ - **Modern GitHub auth** — `Bearer` tokens, current API media type, and version header; deprecated preview headers removed.
64
+
65
+ See the [CHANGELOG](CHANGELOG.md) for the full list.
66
+
55
67
  ## ✨ Features
56
68
 
57
69
  ### 🔐 GitHub Authentication
@@ -247,7 +259,6 @@ git-auto push --force # Force push
247
259
  git-auto push --safe "message" # Safe commit flow (test branch + PR)
248
260
  git-auto pull # Pull (merge strategy)
249
261
  git-auto pull --rebase # Pull with rebase
250
- git-auto pull --rebase # Pull with rebase
251
262
  git-auto pull --no-rebase # Pull with merge (default)
252
263
  git-auto pull --ff-only # Only fast-forward
253
264
  git-auto pull -b main --rebase # Pull specific branch with rebase
@@ -370,18 +381,25 @@ git-auto issue update 42 --title "New title" # Update issue
370
381
  git-auto issue update 42 --state closed # Change state
371
382
  ```
372
383
 
384
+ > **Note:** Add `--repo owner/name` to target any repository you have access to.
385
+ > Without it, the owner is detected from your `origin` remote (works for org/fork repos).
386
+
373
387
  ### Collaboration
374
388
  ```bash
375
389
  # Add collaborators
376
- git-auto collab username # Add to current repo
377
- git-auto collab username --repo myrepo # Add to specific repo
390
+ git-auto collab username # Add to current repo (owner auto-detected)
391
+ git-auto collab username --repo owner/name # Target any repo you have access to
378
392
  git-auto collab username --permission admin # With permission level
379
393
 
380
394
  # Branch protection
381
395
  git-auto protect main # Protect main branch
382
- git-auto protect develop --repo myrepo # Protect specific branch
396
+ git-auto protect develop --repo owner/name # Protect a branch in a specific repo
383
397
  ```
384
398
 
399
+ > **Note:** The owner is detected from your `origin` remote, so these work for
400
+ > organization, fork, and collaborator repos — not just repos you own. Use
401
+ > `--repo owner/name` to override.
402
+
385
403
  ### Backup & Restore
386
404
  ```bash
387
405
  git-auto backup # Create backup
@@ -440,6 +458,9 @@ git-auto merge-pr 42 --squash # Squash merge
440
458
  git-auto review-pr 42 # Open PR in browser
441
459
  ```
442
460
 
461
+ > **Note:** PR commands detect the owner from your `origin` remote, so they work
462
+ > for organization and fork repos. Pass `--repo owner/name` to override.
463
+
443
464
  ## 🎯 Use Cases
444
465
 
445
466
  ### Starting a New Python Project
@@ -8,6 +8,18 @@ Git-Auto Pro is a powerful command-line tool that automates your entire developm
8
8
  [![License](https://img.shields.io/badge/license-MIT-green.svg)](LICENSE)
9
9
  [![PyPI](https://img.shields.io/badge/pypi-git--auto--pro-orange.svg)](https://pypi.org/project/git-auto-pro/)
10
10
 
11
+ ## 🆕 What's New in 2.5.0
12
+
13
+ - **Org/fork repo support** — GitHub commands (`issue`, `pr`, `prs`, `merge-pr`, `review-pr`, `collab`, `protect`) now detect the repository **owner** from your `origin` remote instead of assuming it's your own. They work on organization, fork, and collaborator repos. Pass `--repo owner/name` to target any repo explicitly.
14
+ - **`git-auto new` honors `default_branch`** — no longer hardcodes `main`; aligns the local branch to your configured default before pushing.
15
+ - **Real backups** — `git-auto backup` now archives the full `.git` (including `objects/`), so `git-auto restore` actually brings back your history.
16
+ - **Portable generated hooks** — `pre-commit`/`pre-push` hooks are now POSIX-`sh` safe and no longer break on `dash` (`/bin/sh` on Ubuntu/Debian) when ruff/black/pytest aren't installed.
17
+ - **Honest PR feedback** — `git-auto pr` no longer claims "✓ Reviewers requested" when the API rejected the request; it reports the real HTTP status.
18
+ - **Tougher network handling** — `issue close`/`update` and all PR ops now handle connection errors and timeouts gracefully instead of dumping a traceback.
19
+ - **Modern GitHub auth** — `Bearer` tokens, current API media type, and version header; deprecated preview headers removed.
20
+
21
+ See the [CHANGELOG](CHANGELOG.md) for the full list.
22
+
11
23
  ## ✨ Features
12
24
 
13
25
  ### 🔐 GitHub Authentication
@@ -203,7 +215,6 @@ git-auto push --force # Force push
203
215
  git-auto push --safe "message" # Safe commit flow (test branch + PR)
204
216
  git-auto pull # Pull (merge strategy)
205
217
  git-auto pull --rebase # Pull with rebase
206
- git-auto pull --rebase # Pull with rebase
207
218
  git-auto pull --no-rebase # Pull with merge (default)
208
219
  git-auto pull --ff-only # Only fast-forward
209
220
  git-auto pull -b main --rebase # Pull specific branch with rebase
@@ -326,18 +337,25 @@ git-auto issue update 42 --title "New title" # Update issue
326
337
  git-auto issue update 42 --state closed # Change state
327
338
  ```
328
339
 
340
+ > **Note:** Add `--repo owner/name` to target any repository you have access to.
341
+ > Without it, the owner is detected from your `origin` remote (works for org/fork repos).
342
+
329
343
  ### Collaboration
330
344
  ```bash
331
345
  # Add collaborators
332
- git-auto collab username # Add to current repo
333
- git-auto collab username --repo myrepo # Add to specific repo
346
+ git-auto collab username # Add to current repo (owner auto-detected)
347
+ git-auto collab username --repo owner/name # Target any repo you have access to
334
348
  git-auto collab username --permission admin # With permission level
335
349
 
336
350
  # Branch protection
337
351
  git-auto protect main # Protect main branch
338
- git-auto protect develop --repo myrepo # Protect specific branch
352
+ git-auto protect develop --repo owner/name # Protect a branch in a specific repo
339
353
  ```
340
354
 
355
+ > **Note:** The owner is detected from your `origin` remote, so these work for
356
+ > organization, fork, and collaborator repos — not just repos you own. Use
357
+ > `--repo owner/name` to override.
358
+
341
359
  ### Backup & Restore
342
360
  ```bash
343
361
  git-auto backup # Create backup
@@ -396,6 +414,9 @@ git-auto merge-pr 42 --squash # Squash merge
396
414
  git-auto review-pr 42 # Open PR in browser
397
415
  ```
398
416
 
417
+ > **Note:** PR commands detect the owner from your `origin` remote, so they work
418
+ > for organization and fork repos. Pass `--repo owner/name` to override.
419
+
399
420
  ## 🎯 Use Cases
400
421
 
401
422
  ### Starting a New Python Project
File without changes
File without changes
@@ -1,5 +1,5 @@
1
1
  """Git-Auto Pro - Complete Git + GitHub automation CLI tool."""
2
2
 
3
- __version__ = "2.0.0"
3
+ __version__ = "2.5.0"
4
4
  __author__ = "Himanshu Singh"
5
5
  __email__ = "choudharyhimanshusingh966@gmail.com"
@@ -1,6 +1,7 @@
1
1
  """Repository backup and restore module."""
2
2
 
3
3
  import shutil
4
+ import sys
4
5
  import tarfile
5
6
  from pathlib import Path
6
7
  from datetime import datetime
@@ -36,15 +37,15 @@ def create_backup(output: Optional[str] = None) -> None:
36
37
  for item in Path.cwd().iterdir():
37
38
  if item.name != ".git":
38
39
  tar.add(item, arcname=item.name)
39
-
40
40
 
41
+ # Archive the entire .git directory so commit history
42
+ # (objects/ + packed refs) is preserved. Archiving only
43
+ # config/HEAD/refs leaves refs pointing at objects that
44
+ # aren't in the backup, making a restore useless.
41
45
  git_dir = Path(".git")
42
46
  if git_dir.exists():
43
- for item in ["config", "HEAD", "refs", "hooks"]:
44
- git_item = git_dir / item
45
- if git_item.exists():
46
- tar.add(git_item, arcname=f".git/{item}")
47
-
47
+ tar.add(git_dir, arcname=".git")
48
+
48
49
  progress.update(task, description="Backup complete!")
49
50
 
50
51
  backup_size = Path(output).stat().st_size / (1024 * 1024) # MB
@@ -75,10 +76,14 @@ def restore_backup(backup_path: str) -> None:
75
76
  ) as progress:
76
77
  task = progress.add_task("Extracting backup...", total=None)
77
78
 
78
- # Extract tar archive
79
+ # Extract tar archive. Use the data filter on Python 3.12+ to
80
+ # guard against path-traversal / unexpected link types in archives.
79
81
  with tarfile.open(backup_path, "r:gz") as tar:
80
- tar.extractall(restore_dir)
81
-
82
+ extract_kwargs = {}
83
+ if sys.version_info >= (3, 12):
84
+ extract_kwargs["filter"] = "data"
85
+ tar.extractall(restore_dir, **extract_kwargs)
86
+
82
87
  progress.update(task, description="Restore complete!")
83
88
 
84
89
  console.print(f"[green]✓ Backup restored to: {restore_dir}[/green]")