git-story-workflow 1.1.0 → 1.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/git-story-workflow.gemspec +4 -4
- data/lib/git/story/app.rb +23 -3
- data/lib/git/story/prepare-commit-msg +38 -15
- data/lib/git/story/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ef8d1e191f13d4e77de20b5fc538031c49bbc464c3ee345636f440552d944ac
|
4
|
+
data.tar.gz: 748a64331b6287988c2361052148ff60d0399dc74db0f09de01f8d180d38f99a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 88608ce799a9ac2ac6ea5b2f13353bb159319838f3bf6f8201efc4ffdbf151904c3afee2040824f326104173895837bb791834eea4459db0c05e950b393228cc
|
7
|
+
data.tar.gz: 557b78253cd6e7fcb48886ab607d914dfa5199ea884a066774a5ddfb270fe70e6a5ddaca31741d2839bb048a4845976d0b74db78201a6b7a9d792645adee2a7c
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1
|
1
|
+
1.4.1
|
data/git-story-workflow.gemspec
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
|
-
# stub: git-story-workflow 1.1
|
2
|
+
# stub: git-story-workflow 1.4.1 ruby lib
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = "git-story-workflow".freeze
|
6
|
-
s.version = "1.1
|
6
|
+
s.version = "1.4.1"
|
7
7
|
|
8
8
|
s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
|
9
9
|
s.require_paths = ["lib".freeze]
|
10
10
|
s.authors = ["Florian Frank".freeze]
|
11
|
-
s.date = "
|
11
|
+
s.date = "2021-08-17"
|
12
12
|
s.description = "Gem abstracting a git workflow\u2026".freeze
|
13
13
|
s.email = "flori@ping.de".freeze
|
14
14
|
s.executables = ["git-story".freeze]
|
@@ -17,7 +17,7 @@ Gem::Specification.new do |s|
|
|
17
17
|
s.homepage = "http://flori.github.com/git-story-workflow".freeze
|
18
18
|
s.licenses = ["Apache-2.0".freeze]
|
19
19
|
s.rdoc_options = ["--title".freeze, "Git-story-workflow".freeze, "--main".freeze, "README.md".freeze]
|
20
|
-
s.rubygems_version = "3.
|
20
|
+
s.rubygems_version = "3.2.15".freeze
|
21
21
|
s.summary = "Gem abstracting a git workflow".freeze
|
22
22
|
s.test_files = ["spec/git/story/app_spec.rb".freeze, "spec/spec_helper.rb".freeze]
|
23
23
|
|
data/lib/git/story/app.rb
CHANGED
@@ -286,7 +286,7 @@ class Git::Story::App
|
|
286
286
|
command doc: '[BRANCH] open branch on github'
|
287
287
|
def github(branch = current(check: false))
|
288
288
|
if url = github_url(branch)
|
289
|
-
|
289
|
+
sh "open #{url.inspect}"
|
290
290
|
end
|
291
291
|
nil
|
292
292
|
end
|
@@ -295,11 +295,31 @@ class Git::Story::App
|
|
295
295
|
def pivotal(branch = current(check: true))
|
296
296
|
if story_id = branch&.[](/_(\d+)\z/, 1)&.to_i
|
297
297
|
story_url = fetch_story(story_id)&.url
|
298
|
-
|
298
|
+
sh "open #{story_url}"
|
299
299
|
end
|
300
300
|
nil
|
301
301
|
end
|
302
302
|
|
303
|
+
command doc: 'open project on semaphore'
|
304
|
+
def semaphore
|
305
|
+
sh "open #{complex_config.story.semaphore_project_url}"
|
306
|
+
nil
|
307
|
+
end
|
308
|
+
|
309
|
+
command doc: '[REF] create a hotfix branch from REF'
|
310
|
+
def hotfix(ref = nil)
|
311
|
+
if ref
|
312
|
+
start_point = ref
|
313
|
+
elsif tag = tags.last
|
314
|
+
start_point = tag_name(tag)
|
315
|
+
else
|
316
|
+
fail 'no last deployment tag found'
|
317
|
+
end
|
318
|
+
branch = "hotfix_#{start_point}"
|
319
|
+
sh "git checkout -b #{branch.inspect} #{start_point.inspect}"
|
320
|
+
nil
|
321
|
+
end
|
322
|
+
|
303
323
|
private
|
304
324
|
|
305
325
|
def determine_command
|
@@ -388,7 +408,7 @@ class Git::Story::App
|
|
388
408
|
end
|
389
409
|
loop do
|
390
410
|
r = block.()
|
391
|
-
|
411
|
+
sh 'clear'
|
392
412
|
start = Time.now
|
393
413
|
puts r
|
394
414
|
refresh_at = start + seconds
|
@@ -2,11 +2,14 @@
|
|
2
2
|
# Installed by the git-story gem
|
3
3
|
|
4
4
|
require 'tempfile'
|
5
|
+
require 'complex_config/rude'
|
6
|
+
include ComplexConfig::Provider::Shortcuts
|
5
7
|
|
6
8
|
class CommitMesssageParser
|
7
9
|
def initialize
|
8
10
|
@line_index = 0
|
9
11
|
@story_number_found = false
|
12
|
+
@story_number_done = false
|
10
13
|
@message_data = []
|
11
14
|
end
|
12
15
|
|
@@ -16,10 +19,20 @@ class CommitMesssageParser
|
|
16
19
|
@story_number_found
|
17
20
|
end
|
18
21
|
|
22
|
+
def story_number_done?
|
23
|
+
@story_number_done
|
24
|
+
end
|
25
|
+
|
19
26
|
def parse(template)
|
20
27
|
@message_data = template.readlines
|
21
28
|
@message_data.each do |line|
|
22
|
-
|
29
|
+
if /^\s*\[.*(?:#\d+|TODO|(?<done>DONE)).*\]/i =~ line
|
30
|
+
@story_number_found = true
|
31
|
+
if @story_number_done = !!done
|
32
|
+
@message_data.slice!(@line_index)
|
33
|
+
next
|
34
|
+
end
|
35
|
+
end
|
23
36
|
if line =~ /^\s*#/
|
24
37
|
break
|
25
38
|
else
|
@@ -49,21 +62,31 @@ story_numbers =
|
|
49
62
|
break $1.split(/_/)
|
50
63
|
} || []
|
51
64
|
story_numbers.map!(&:chomp)
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
65
|
+
Tempfile.open('commit') do |output|
|
66
|
+
File.open(ARGV.first) do |template|
|
67
|
+
message_parsed = CommitMesssageParser.new.parse(template)
|
68
|
+
if message_parsed.story_number_found?
|
69
|
+
output.puts message_parsed.total
|
70
|
+
elsif complex_config.story.todo_nudging? && story_numbers.empty? && !message_parsed.story_number_done?
|
71
|
+
output.puts message_parsed.data, "", "[TODO]", "", message_parsed.footer
|
72
|
+
else
|
73
|
+
full_message = [ message_parsed.data, "", ]
|
74
|
+
if prefix = complex_config.story.pivotal_reference_prefix?
|
75
|
+
pivotal_reference = -> number { "%s-%u" % [ prefix, number ] }
|
76
|
+
full_message.concat(
|
77
|
+
story_numbers.each_with_index.map { |story_number, i| "#{i + 1}. " + pivotal_reference.(story_number) }
|
78
|
+
)
|
79
|
+
full_message << ""
|
66
80
|
end
|
81
|
+
full_message <<
|
82
|
+
"[#{story_numbers.map { |story_number| "##{story_number}" } * ' '}]" <<
|
83
|
+
"" <<
|
84
|
+
message_parsed.footer
|
85
|
+
output.puts full_message
|
86
|
+
end
|
87
|
+
output.rewind
|
88
|
+
File.open(ARGV.first, 'w') do |message|
|
89
|
+
message.write output.read
|
67
90
|
end
|
68
91
|
end
|
69
92
|
end
|
data/lib/git/story/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-story-workflow
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1
|
4
|
+
version: 1.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Frank
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-08-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gem_hadar
|
@@ -204,7 +204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
204
204
|
- !ruby/object:Gem::Version
|
205
205
|
version: '0'
|
206
206
|
requirements: []
|
207
|
-
rubygems_version: 3.
|
207
|
+
rubygems_version: 3.2.15
|
208
208
|
signing_key:
|
209
209
|
specification_version: 4
|
210
210
|
summary: Gem abstracting a git workflow
|