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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gitpush-tool
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: A CLI tool to simplify Git push operations with intelligent defaults and options.
5
5
  Home-page: https://github.com/inevitablegs/gitpush
6
6
  Author: Ganesh Sonawane
@@ -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
- sys.exit(0)
200
-
201
- print("ℹ️ No operation specified. Use --new-repo to create a repository or --help for options")
202
- sys.exit(1)
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,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: gitpush-tool
3
- Version: 0.2.3
3
+ Version: 0.2.4
4
4
  Summary: A CLI tool to simplify Git push operations with intelligent defaults and options.
5
5
  Home-page: https://github.com/inevitablegs/gitpush
6
6
  Author: Ganesh Sonawane
@@ -3,7 +3,7 @@ from pathlib import Path
3
3
 
4
4
  setup(
5
5
  name="gitpush-tool",
6
- version="0.2.3",
6
+ version="0.2.4",
7
7
  packages=find_packages(),
8
8
  install_requires=[
9
9
  'requests>=2.25.0',
@@ -1 +0,0 @@
1
- __version__ = "0.2.3"
File without changes
File without changes
File without changes
File without changes