gitpush-tool 0.4.1__tar.gz → 0.4.3__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 (26) hide show
  1. {gitpush_tool-0.4.1 → gitpush_tool-0.4.3}/LONG_DESCRIPTION.md +144 -142
  2. {gitpush_tool-0.4.1/gitpush_tool.egg-info → gitpush_tool-0.4.3}/PKG-INFO +3 -1
  3. {gitpush_tool-0.4.1 → gitpush_tool-0.4.3}/README.md +234 -182
  4. {gitpush_tool-0.4.1 → gitpush_tool-0.4.3}/gitpush/__doc__.py +7 -2
  5. gitpush_tool-0.4.3/gitpush/__init__.py +1 -0
  6. {gitpush_tool-0.4.1 → gitpush_tool-0.4.3}/gitpush/cli.py +852 -816
  7. gitpush_tool-0.4.3/gitpush/sync.py +524 -0
  8. gitpush_tool-0.4.3/gitpush/undo.py +359 -0
  9. {gitpush_tool-0.4.1 → gitpush_tool-0.4.3/gitpush_tool.egg-info}/PKG-INFO +3 -1
  10. {gitpush_tool-0.4.1 → gitpush_tool-0.4.3}/gitpush_tool.egg-info/SOURCES.txt +5 -1
  11. {gitpush_tool-0.4.1 → gitpush_tool-0.4.3}/gitpush_tool.egg-info/entry_points.txt +2 -0
  12. {gitpush_tool-0.4.1 → gitpush_tool-0.4.3}/setup.py +4 -2
  13. gitpush_tool-0.4.3/tests/test_sync.py +153 -0
  14. gitpush_tool-0.4.3/tests/test_undo.py +80 -0
  15. gitpush_tool-0.4.1/gitpush/__init__.py +0 -1
  16. {gitpush_tool-0.4.1 → gitpush_tool-0.4.3}/LICENSE +0 -0
  17. {gitpush_tool-0.4.1 → gitpush_tool-0.4.3}/MANIFEST.in +0 -0
  18. {gitpush_tool-0.4.1 → gitpush_tool-0.4.3}/gitpush/safety.py +0 -0
  19. {gitpush_tool-0.4.1 → gitpush_tool-0.4.3}/gitpush/status.py +0 -0
  20. {gitpush_tool-0.4.1 → gitpush_tool-0.4.3}/gitpush_tool.egg-info/dependency_links.txt +0 -0
  21. {gitpush_tool-0.4.1 → gitpush_tool-0.4.3}/gitpush_tool.egg-info/top_level.txt +0 -0
  22. {gitpush_tool-0.4.1 → gitpush_tool-0.4.3}/pyproject.toml +0 -0
  23. {gitpush_tool-0.4.1 → gitpush_tool-0.4.3}/setup.cfg +0 -0
  24. {gitpush_tool-0.4.1 → gitpush_tool-0.4.3}/tests/test_cli.py +0 -0
  25. {gitpush_tool-0.4.1 → gitpush_tool-0.4.3}/tests/test_safety.py +0 -0
  26. {gitpush_tool-0.4.1 → gitpush_tool-0.4.3}/tests/test_status.py +0 -0
@@ -1,142 +1,144 @@
1
- # GitPush Tool 🚀
2
-
3
- [![PyPI version](https://img.shields.io/pypi/v/gitpush-tool.svg)](https://pypi.org/project/gitpush-tool/)
4
- [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/inevitablegs/gitpush/blob/main/LICENSE)
5
-
6
- A supercharged Git CLI and safety tool that simplifies repository creation and pushing with intelligent defaults, rich pre-push diffstat inspection (`+++---` lines), and active safeguards against dangerous Git commands.
7
-
8
- ---
9
-
10
- ## ✨ Features
11
-
12
- - **Decision-Support Status Dashboard (`gitpush status`):** Actionable repository overview showing worktree breakdown, commit sync, intelligent next-step recommendations, and a 0-100 Repo Health score.
13
- - **Pre-Push Safety & Diffstat Preview:** See changed files, line additions/deletions (`+X, -Y`), ahead/behind status, and pending commits before pushing.
14
- - **Dangerous Git Operation Guard:** Analyzes and protects against risky actions (`reset --hard`, force pushes, deleting unmerged branches, dirty `git clean`, detached HEADs).
15
- - **Protected Branch Safeguard:** Automatically detects and alerts when pushing or force-pushing to `main`, `master`, `prod`, `release`, or `dev`.
16
- - **One-Command GitHub Repo Creation:** Initialize Git, create a remote GitHub repo, and push in a single step via GitHub CLI (`gh`).
17
- - **Safe Force Pushing:** Uses `--force-with-lease` by default to avoid overwriting teammate commits.
18
- - **Dry-Run Mode:** Preview your push inspection without modifying anything.
19
- - **Non-Interactive & CI Friendly:** Skip prompts with `-y` or `--yes`.
20
-
21
- ---
22
-
23
- ## 📊 Decision-Support Status Dashboard (`gitpush status`)
24
-
25
- ```text
26
- Repository: my-project
27
- Branch: feature/payment
28
- Tracking: origin/feature/payment
29
-
30
- WORKTREE
31
- ────────────────────────
32
- Modified 4
33
- Added 2
34
- Deleted 1
35
- Untracked 3
36
- Line Changes +142, -18
37
-
38
- COMMITS
39
- ────────────────────────
40
- Ahead 3
41
- Behind 1
42
-
43
- PUSH / STATUS
44
- ────────────────────────
45
- Remote has 1 commit(s) you don't have locally.
46
-
47
- Recommended:
48
- git pull --rebase
49
- gitpush "Commit message"
50
-
51
- Health:
52
- 82/100 [████████░░] Good (Minor Action Needed)
53
- ```
54
-
55
- ---
56
-
57
- ## 🛡️ Pre-Push Warning & Inspection
58
-
59
- Whenever you run `gitpush`, you get an instant, clear breakdown of your repository state:
60
-
61
- ```text
62
- ═══════════════════════════════════════════════════════════════
63
- 🚀 GITPUSH PRE-PUSH INSPECTION & SUMMARY
64
- ═══════════════════════════════════════════════════════════════
65
-
66
- Repository: my-project (/Users/username/Projects/my-project)
67
- Target Branch: main ⚠️ [PROTECTED BRANCH] ──> origin/main
68
- Sync Status: Ahead: 2 commit(s), Behind: 0 commit(s)
69
- Action: Commit: 'Add user authentication flow'
70
-
71
- Warnings:
72
- ⚠️ Pushing directly to protected branch 'main'.
73
-
74
- Changed Files (3 file(s), +84 / -12):
75
- M src/auth.py (+65, -8)
76
- M README.md (+19, -4)
77
- ?? config/auth.json (+12 lines, untracked)
78
-
79
- Pending Commits to Push (2):
80
- • 8f3d1a2 Initial auth scaffold
81
- 4e9c7b1 Implement JWT token verification
82
- ═══════════════════════════════════════════════════════════════
83
-
84
- Continue? [y/N]:
85
- ```
86
-
87
- ---
88
-
89
- ## 🛑 Dangerous Command Guard
90
-
91
- Use `gitpush guard <command>` (or `gitpush-guard <command>`) before executing risky Git operations:
92
-
93
- ```text
94
- Command: [WARNING ⚠️]
95
- git reset --hard HEAD~5
96
-
97
- Changes that may be lost:
98
- 5 commit(s)
99
- 12 modified/staged file(s)
100
-
101
- Risks & Warnings:
102
- ⚠️ All uncommitted changes in tracked files will be permanently discarded.
103
- ⚠️ 12 uncommitted modified/staged file(s) will be lost immediately.
104
- ⚠️ 5 commit(s) will be unlinked from current branch HEAD.
105
-
106
- Repository:
107
- my-project
108
-
109
- Continue? [y/N]:
110
- ```
111
-
112
- ### What Guard Detects:
113
- - **`reset --hard`**: Identifies uncommitted files and commits that will be orphaned.
114
- - **`force push`**: Detects remote overwrite risks and protected branch overrides.
115
- - **`deleting branches`**: Identifies unmerged commits that would be lost.
116
- - **`cleaning untracked files`**: Warns of files/directories `git clean -fd` will permanently delete.
117
- - **`checkout / restore`**: Flags uncommitted modifications about to be discarded.
118
- - **`rebasing with uncommitted work`**: Warns of dirty working trees before rebase conflicts occur.
119
- - **`pushing to protected branches`**: Direct pushes to `main`, `master`, `prod`, `dev`, etc.
120
- - **`detached HEAD situations`**: Warns when working or committing on detached HEADs.
121
-
122
- ---
123
-
124
- ## 🛠️ Usage & Commands
125
-
126
- | Command | Description |
127
- |---|---|
128
- | `gitpush "Commit message"` | Stages all changes, previews diffs, commits, and pushes. |
129
- | `gitpush` | Pushes staged/unpushed changes with safety preview. |
130
- | `gitpush -y` | Pushes immediately without confirmation prompt. |
131
- | `gitpush --dry-run` | Shows the pre-push inspection and exits without changes. |
132
- | `gitpush --force` | Safe force push using `--force-with-lease`. |
133
- | `gitpush --tags` | Pushes all local tags. |
134
- | `gitpush guard <git command>` | Inspects and guards any dangerous Git command. |
135
- | `gitpush --init` | Initializes Git repo and creates default `.gitignore`. |
136
- | `gitpush --new-repo <name>` | Creates a new GitHub repo and pushes in one step. |
137
-
138
- ---
139
-
140
- ## 📄 License
141
-
142
- MIT License. See [LICENSE](https://github.com/inevitablegs/gitpush/blob/main/LICENSE) for details.
1
+ # GitPush Tool 🚀
2
+
3
+ [![PyPI version](https://img.shields.io/pypi/v/gitpush-tool.svg)](https://pypi.org/project/gitpush-tool/)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/inevitablegs/gitpush/blob/main/LICENSE)
5
+
6
+ A supercharged Git CLI and safety tool that simplifies repository creation and pushing with intelligent defaults, rich pre-push diffstat inspection (`+++---` lines), and active safeguards against dangerous Git commands.
7
+
8
+ ---
9
+
10
+ ## ✨ Features
11
+
12
+ - **Smart Sync Engine (`gitpush sync`):** Intelligent single-command replacement for `git pull → git add → git commit → git push`. Automatically detects repository state (clean, dirty, ahead, behind, diverged) and safely synchronizes with remote.
13
+ - **Decision-Support Status Dashboard (`gitpush status`):** Actionable repository overview showing worktree breakdown, commit sync, intelligent next-step recommendations, and a 0-100 Repo Health score.
14
+ - **Interactive Undo Engine (`gitpush undo`):** Reversible and safe rollback for commits and pushes with detailed previews.
15
+ - **Pre-Push Safety & Diffstat Preview:** See changed files, line additions/deletions (`+X, -Y`), ahead/behind status, and pending commits before pushing.
16
+ - **Dangerous Git Operation Guard:** Analyzes and protects against risky actions (`reset --hard`, force pushes, deleting unmerged branches, dirty `git clean`, detached HEADs).
17
+ - **Protected Branch Safeguard:** Automatically detects and alerts when pushing or force-pushing to `main`, `master`, `prod`, `release`, or `dev`.
18
+ - **One-Command GitHub Repo Creation:** Initialize Git, create a remote GitHub repo, and push in a single step via GitHub CLI (`gh`).
19
+ - **Safe Force Pushing:** Uses `--force-with-lease` by default to avoid overwriting teammate commits.
20
+ - **Dry-Run Mode:** Preview your push inspection without modifying anything.
21
+ - **Non-Interactive & CI Friendly:** Skip prompts with `-y` or `--yes`.
22
+
23
+ ---
24
+
25
+ ## 📊 Decision-Support Status Dashboard (`gitpush status`)
26
+
27
+ ```text
28
+ Repository: my-project
29
+ Branch: feature/payment
30
+ Tracking: origin/feature/payment
31
+
32
+ WORKTREE
33
+ ────────────────────────
34
+ Modified 4
35
+ Added 2
36
+ Deleted 1
37
+ Untracked 3
38
+ Line Changes +142, -18
39
+
40
+ COMMITS
41
+ ────────────────────────
42
+ Ahead 3
43
+ Behind 1
44
+
45
+ PUSH / STATUS
46
+ ────────────────────────
47
+ ⚠ Remote has 1 commit(s) you don't have locally.
48
+
49
+ Recommended:
50
+ git pull --rebase
51
+ gitpush "Commit message"
52
+
53
+ Health:
54
+ 82/100 [████████░░] Good (Minor Action Needed)
55
+ ```
56
+
57
+ ---
58
+
59
+ ## 🛡️ Pre-Push Warning & Inspection
60
+
61
+ Whenever you run `gitpush`, you get an instant, clear breakdown of your repository state:
62
+
63
+ ```text
64
+ ═══════════════════════════════════════════════════════════════
65
+ 🚀 GITPUSH PRE-PUSH INSPECTION & SUMMARY
66
+ ═══════════════════════════════════════════════════════════════
67
+
68
+ Repository: my-project (/Users/username/Projects/my-project)
69
+ Target Branch: main ⚠️ [PROTECTED BRANCH] ──> origin/main
70
+ Sync Status: Ahead: 2 commit(s), Behind: 0 commit(s)
71
+ Action: Commit: 'Add user authentication flow'
72
+
73
+ Warnings:
74
+ ⚠️ Pushing directly to protected branch 'main'.
75
+
76
+ Changed Files (3 file(s), +84 / -12):
77
+ M src/auth.py (+65, -8)
78
+ M README.md (+19, -4)
79
+ ?? config/auth.json (+12 lines, untracked)
80
+
81
+ Pending Commits to Push (2):
82
+ • 8f3d1a2 Initial auth scaffold
83
+ • 4e9c7b1 Implement JWT token verification
84
+ ═══════════════════════════════════════════════════════════════
85
+
86
+ Continue? [y/N]:
87
+ ```
88
+
89
+ ---
90
+
91
+ ## 🛑 Dangerous Command Guard
92
+
93
+ Use `gitpush guard <command>` (or `gitpush-guard <command>`) before executing risky Git operations:
94
+
95
+ ```text
96
+ Command: [WARNING ⚠️]
97
+ git reset --hard HEAD~5
98
+
99
+ Changes that may be lost:
100
+ 5 commit(s)
101
+ 12 modified/staged file(s)
102
+
103
+ Risks & Warnings:
104
+ ⚠️ All uncommitted changes in tracked files will be permanently discarded.
105
+ ⚠️ 12 uncommitted modified/staged file(s) will be lost immediately.
106
+ ⚠️ 5 commit(s) will be unlinked from current branch HEAD.
107
+
108
+ Repository:
109
+ my-project
110
+
111
+ Continue? [y/N]:
112
+ ```
113
+
114
+ ### What Guard Detects:
115
+ - **`reset --hard`**: Identifies uncommitted files and commits that will be orphaned.
116
+ - **`force push`**: Detects remote overwrite risks and protected branch overrides.
117
+ - **`deleting branches`**: Identifies unmerged commits that would be lost.
118
+ - **`cleaning untracked files`**: Warns of files/directories `git clean -fd` will permanently delete.
119
+ - **`checkout / restore`**: Flags uncommitted modifications about to be discarded.
120
+ - **`rebasing with uncommitted work`**: Warns of dirty working trees before rebase conflicts occur.
121
+ - **`pushing to protected branches`**: Direct pushes to `main`, `master`, `prod`, `dev`, etc.
122
+ - **`detached HEAD situations`**: Warns when working or committing on detached HEADs.
123
+
124
+ ---
125
+
126
+ ## 🛠️ Usage & Commands
127
+
128
+ | Command | Description |
129
+ |---|---|
130
+ | `gitpush "Commit message"` | Stages all changes, previews diffs, commits, and pushes. |
131
+ | `gitpush` | Pushes staged/unpushed changes with safety preview. |
132
+ | `gitpush -y` | Pushes immediately without confirmation prompt. |
133
+ | `gitpush --dry-run` | Shows the pre-push inspection and exits without changes. |
134
+ | `gitpush --force` | Safe force push using `--force-with-lease`. |
135
+ | `gitpush --tags` | Pushes all local tags. |
136
+ | `gitpush guard <git command>` | Inspects and guards any dangerous Git command. |
137
+ | `gitpush --init` | Initializes Git repo and creates default `.gitignore`. |
138
+ | `gitpush --new-repo <name>` | Creates a new GitHub repo and pushes in one step. |
139
+
140
+ ---
141
+
142
+ ## 📄 License
143
+
144
+ MIT License. See [LICENSE](https://github.com/inevitablegs/gitpush/blob/main/LICENSE) for details.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gitpush-tool
3
- Version: 0.4.1
3
+ Version: 0.4.3
4
4
  Summary: Supercharged Git push tool with automatic GitHub repo creation and pushing
5
5
  Home-page: https://github.com/inevitablegs/gitpush
6
6
  Author: Ganesh Sonawane
@@ -38,7 +38,9 @@ A supercharged Git CLI and safety tool that simplifies repository creation and p
38
38
 
39
39
  ## ✨ Features
40
40
 
41
+ - **Smart Sync Engine (`gitpush sync`):** Intelligent single-command replacement for `git pull → git add → git commit → git push`. Automatically detects repository state (clean, dirty, ahead, behind, diverged) and safely synchronizes with remote.
41
42
  - **Decision-Support Status Dashboard (`gitpush status`):** Actionable repository overview showing worktree breakdown, commit sync, intelligent next-step recommendations, and a 0-100 Repo Health score.
43
+ - **Interactive Undo Engine (`gitpush undo`):** Reversible and safe rollback for commits and pushes with detailed previews.
42
44
  - **Pre-Push Safety & Diffstat Preview:** See changed files, line additions/deletions (`+X, -Y`), ahead/behind status, and pending commits before pushing.
43
45
  - **Dangerous Git Operation Guard:** Analyzes and protects against risky actions (`reset --hard`, force pushes, deleting unmerged branches, dirty `git clean`, detached HEADs).
44
46
  - **Protected Branch Safeguard:** Automatically detects and alerts when pushing or force-pushing to `main`, `master`, `prod`, `release`, or `dev`.