gplan 0.0.4 → 0.0.5
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.
- data/bin/gplan +14 -6
- metadata +1 -1
data/bin/gplan
CHANGED
@@ -63,22 +63,30 @@ def print
|
|
63
63
|
end
|
64
64
|
|
65
65
|
def setup_repository
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
66
|
+
if ARGV[0] # allow you to pass in a SHA or remote/branch to target against. This can be useful when generating release notes after a deployment
|
67
|
+
@target = ARGV[0]
|
68
|
+
else
|
69
|
+
conf_file =Dir.pwd+"/.gplan"
|
70
|
+
if File.exists?(conf_file)
|
71
|
+
File.open(conf_file, "r") do |f|
|
72
|
+
#target should be repository/branch
|
73
|
+
@target = f.each_line.first.chomp
|
74
|
+
end
|
71
75
|
end
|
72
76
|
end
|
73
77
|
# Set the default branch if one is not set
|
74
78
|
@target = "production/master" unless @target
|
75
79
|
@repo = @target.split("/").first
|
80
|
+
begin
|
81
|
+
`git fetch #{@repo}`
|
82
|
+
rescue
|
83
|
+
puts "unable to fetch #{@repo}, checking git log anyways..."
|
84
|
+
end
|
76
85
|
end
|
77
86
|
|
78
87
|
# MAIN
|
79
88
|
|
80
89
|
setup_repository
|
81
|
-
`git fetch #{@repo}`
|
82
90
|
list= `git log #{@target}..`
|
83
91
|
|
84
92
|
pb_story_ids = list.scan(PB_STORY_REGEX).flatten.uniq
|