gitpush-tool 0.2.3__tar.gz → 0.2.4__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.
- {gitpush_tool-0.2.3/gitpush_tool.egg-info → gitpush_tool-0.2.4}/PKG-INFO +1 -1
- gitpush_tool-0.2.4/gitpush_tool/__init__.py +1 -0
- {gitpush_tool-0.2.3 → gitpush_tool-0.2.4}/gitpush_tool/cli.py +42 -8
- {gitpush_tool-0.2.3 → gitpush_tool-0.2.4/gitpush_tool.egg-info}/PKG-INFO +1 -1
- {gitpush_tool-0.2.3 → gitpush_tool-0.2.4}/setup.py +1 -1
- gitpush_tool-0.2.3/gitpush_tool/__init__.py +0 -1
- {gitpush_tool-0.2.3 → gitpush_tool-0.2.4}/LICENSE +0 -0
- {gitpush_tool-0.2.3 → gitpush_tool-0.2.4}/MANIFEST.in +0 -0
- {gitpush_tool-0.2.3 → gitpush_tool-0.2.4}/README.md +0 -0
- {gitpush_tool-0.2.3 → gitpush_tool-0.2.4}/gitpush_tool.egg-info/SOURCES.txt +0 -0
- {gitpush_tool-0.2.3 → gitpush_tool-0.2.4}/gitpush_tool.egg-info/dependency_links.txt +0 -0
- {gitpush_tool-0.2.3 → gitpush_tool-0.2.4}/gitpush_tool.egg-info/entry_points.txt +0 -0
- {gitpush_tool-0.2.3 → gitpush_tool-0.2.4}/gitpush_tool.egg-info/requires.txt +0 -0
- {gitpush_tool-0.2.3 → gitpush_tool-0.2.4}/gitpush_tool.egg-info/top_level.txt +0 -0
- {gitpush_tool-0.2.3 → gitpush_tool-0.2.4}/pyproject.toml +0 -0
- {gitpush_tool-0.2.3 → gitpush_tool-0.2.4}/setup.cfg +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.2.4"
|
|
@@ -145,11 +145,42 @@ def create_with_gh_cli(repo_name, private=False, description="", commit_message=
|
|
|
145
145
|
print(f"❌ Unexpected error: {str(e)}")
|
|
146
146
|
return False
|
|
147
147
|
|
|
148
|
+
def standard_git_push(commit_message, branch, remote, force=False, tags=False):
|
|
149
|
+
"""Handle standard git push operations"""
|
|
150
|
+
try:
|
|
151
|
+
# Stage all changes
|
|
152
|
+
subprocess.run(["git", "add", "."], check=True)
|
|
153
|
+
|
|
154
|
+
# Commit if message provided
|
|
155
|
+
if commit_message:
|
|
156
|
+
print(f"📦 Committing: '{commit_message}'")
|
|
157
|
+
subprocess.run(["git", "commit", "-m", commit_message], check=True)
|
|
158
|
+
else:
|
|
159
|
+
print("ℹ️ No commit message provided - skipping commit")
|
|
160
|
+
|
|
161
|
+
# Build push command
|
|
162
|
+
push_cmd = ["git", "push"]
|
|
163
|
+
if force:
|
|
164
|
+
push_cmd.append("--force-with-lease")
|
|
165
|
+
if tags:
|
|
166
|
+
push_cmd.append("--tags")
|
|
167
|
+
if remote and branch:
|
|
168
|
+
push_cmd.extend([remote, branch])
|
|
169
|
+
|
|
170
|
+
print(f"🚀 Executing: {' '.join(push_cmd)}")
|
|
171
|
+
subprocess.run(push_cmd, check=True)
|
|
172
|
+
print("✅ Successfully pushed changes")
|
|
173
|
+
return True
|
|
174
|
+
except subprocess.CalledProcessError as e:
|
|
175
|
+
print(f"❌ Push failed: {e}")
|
|
176
|
+
return False
|
|
177
|
+
|
|
148
178
|
def run():
|
|
149
179
|
parser = argparse.ArgumentParser(
|
|
150
180
|
description="🚀 Supercharged Git push tool with GitHub repo creation",
|
|
151
181
|
formatter_class=argparse.RawDescriptionHelpFormatter,
|
|
152
182
|
epilog="""Examples:
|
|
183
|
+
Standard push: gitpush_tool "Commit message"
|
|
153
184
|
Create new repo: gitpush_tool "Initial commit" --new-repo project-name
|
|
154
185
|
Private repository: gitpush_tool --new-repo private-project --private
|
|
155
186
|
Force push: gitpush_tool "Fix critical bug" --force
|
|
@@ -190,16 +221,19 @@ def run():
|
|
|
190
221
|
commit_message=commit_msg
|
|
191
222
|
):
|
|
192
223
|
sys.exit(1)
|
|
193
|
-
|
|
194
|
-
sys.exit(0)
|
|
195
|
-
|
|
196
|
-
if args.init:
|
|
224
|
+
elif args.init:
|
|
197
225
|
if initialize_git_repository():
|
|
198
226
|
create_initial_commit(args.commit or "Initial commit")
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
227
|
+
else:
|
|
228
|
+
# Standard git push operation
|
|
229
|
+
if not standard_git_push(
|
|
230
|
+
args.commit,
|
|
231
|
+
args.branch,
|
|
232
|
+
args.remote,
|
|
233
|
+
args.force,
|
|
234
|
+
args.tags
|
|
235
|
+
):
|
|
236
|
+
sys.exit(1)
|
|
203
237
|
|
|
204
238
|
if __name__ == "__main__":
|
|
205
239
|
run()
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.2.3"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|