gitgud 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/README.md +2 -2
- data/bin/gitgud +15 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 109ebe21ee938f51c85b52d74a0fc44417a76ba7ad6bc557af5ad8e1395a3300
|
4
|
+
data.tar.gz: bcd248280d58900dc2d8c9eaecdc4c52c9d7ffe7315e549a38eac685012762ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84dfbd403a1b6dd9877f688afd8681e8c4ef48e30e3374b94b221ec8bd20a6bb06d7567877673c4988da0051ab125d3f336b733bfac9f4f27acf7b1ff78abd8e
|
7
|
+
data.tar.gz: 715907ac22ababcc6ee1053e8b8bb599b19a53098b7fefdb12376cbaeaf0aa81e7b1bc272e99ad67fbe5491b6e13f67c45dbb9847332c00100b3dde9dd7117b1
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
|
-
# gitgud ![gitgud badge](https://img.shields.io/badge/gitgud%3F-good-brightgreen)
|
1
|
+
# gitgud ![gitgud badge](https://img.shields.io/badge/gitgud%3F-good-brightgreen) [![Gem Version](https://badge.fury.io/rb/gitgud.svg)](https://badge.fury.io/rb/gitgud)
|
2
2
|
|
3
3
|
When things go wrong, you need to `gitgud`. `gitgud` acts just like `git`, but gives you superpowers when trying to `git push`. It will attempt to `git push` until it succeeds.
|
4
4
|
|
5
|
-
![
|
5
|
+
![success after multiple retries](https://user-images.githubusercontent.com/4406751/75736774-1c884d80-5ccc-11ea-9e2c-5436937d38ed.gif)
|
6
6
|
|
7
7
|
|
8
8
|
## `gitgud` is the new `git`
|
data/bin/gitgud
CHANGED
@@ -1,14 +1,26 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
2
|
|
3
3
|
require 'cli/ui'
|
4
|
+
require 'open3'
|
4
5
|
|
5
6
|
def try_to_push_this_thing(spinner)
|
6
7
|
counter = 1
|
7
|
-
while
|
8
|
+
while counter <= 20
|
8
9
|
spinner.update_title(spinner_title(counter))
|
9
10
|
counter += 1
|
11
|
+
|
12
|
+
output, status = Open3.capture2e('git', 'push', *ARGV)
|
13
|
+
|
14
|
+
if status.success?
|
15
|
+
return spinner.update_title("Successfully git pushed")
|
16
|
+
elsif !output.match?(/remote: Internal Server Error\sEverything up-to-date/)
|
17
|
+
spinner.update_title("Encountered error while git pushing\n#{output}")
|
18
|
+
return :task_failed
|
19
|
+
end
|
10
20
|
end
|
11
|
-
|
21
|
+
|
22
|
+
spinner.update_title("Unsuccessful after 20 attemps")
|
23
|
+
:task_failed
|
12
24
|
end
|
13
25
|
|
14
26
|
def spinner_title(attempt_number = 1)
|
@@ -21,7 +33,7 @@ end
|
|
21
33
|
|
22
34
|
def plz_push_my_thing_on_git_thx_k_bye
|
23
35
|
CLI::UI::StdoutRouter.enable
|
24
|
-
spin_group = CLI::UI::SpinGroup.new
|
36
|
+
spin_group = CLI::UI::SpinGroup.new(auto_debrief: false)
|
25
37
|
spin_group.add(spinner_title) { |spinner| try_to_push_this_thing(spinner) }
|
26
38
|
spin_group.wait
|
27
39
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitgud
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Leger
|
@@ -56,7 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
56
56
|
- !ruby/object:Gem::Version
|
57
57
|
version: '0'
|
58
58
|
requirements: []
|
59
|
-
rubygems_version: 3.
|
59
|
+
rubygems_version: 3.1.2
|
60
60
|
signing_key:
|
61
61
|
specification_version: 4
|
62
62
|
summary: When things go wrong, you need to gitgud
|