git-scripts 0.9.1 → 0.9.2
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.
- checksums.yaml +4 -4
- data/README.md +6 -55
- data/bin/feature +0 -12
- data/completion/_feature +1 -1
- data/completion/bash_completion.sh +2 -11
- data/lib/git.rb +1 -15
- data/lib/helpers.rb +1 -47
- data/man/feature-finish-issue.1 +2 -2
- data/man/feature-finish-issue.1.ronn +1 -1
- data/man/feature-finish.1 +2 -2
- data/man/feature-finish.1.ronn +1 -1
- data/man/feature-github-test.1 +1 -1
- data/man/feature-list.1 +2 -2
- data/man/feature-list.1.ronn +1 -1
- data/man/feature-merge.1 +2 -2
- data/man/feature-merge.1.ronn +1 -1
- data/man/feature-prune.1 +1 -1
- data/man/feature-start.1 +2 -2
- data/man/feature-start.1.ronn +1 -1
- data/man/feature-stashes.1 +1 -4
- data/man/feature-stashes.1.ronn +0 -2
- data/man/feature-status.1 +1 -4
- data/man/feature-status.1.ronn +0 -2
- data/man/feature-switch.1 +2 -2
- data/man/feature-switch.1.ronn +1 -1
- data/man/feature-url.1 +2 -2
- data/man/feature-url.1.ronn +1 -1
- data/man/feature.1 +3 -3
- data/man/feature.1.ronn +2 -3
- data/man/index.txt +0 -7
- metadata +4 -23
- data/bin/hotfix +0 -230
- data/completion/_hotfix +0 -28
- data/man/hotfix-finish-issue.1 +0 -22
- data/man/hotfix-finish-issue.1.ronn +0 -26
- data/man/hotfix-finish.1 +0 -22
- data/man/hotfix-finish.1.ronn +0 -25
- data/man/hotfix-list.1 +0 -28
- data/man/hotfix-list.1.ronn +0 -29
- data/man/hotfix-merge.1 +0 -25
- data/man/hotfix-merge.1.ronn +0 -29
- data/man/hotfix-start.1 +0 -22
- data/man/hotfix-start.1.ronn +0 -23
- data/man/hotfix-switch.1 +0 -38
- data/man/hotfix-switch.1.ronn +0 -33
- data/man/hotfix-url.1 +0 -22
- data/man/hotfix-url.1.ronn +0 -23
- data/man/hotfix.1 +0 -52
- data/man/hotfix.1.ronn +0 -41
data/man/feature-stashes.1.ronn
CHANGED
data/man/feature-status.1
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "FEATURE\-STATUS" "1" "
|
4
|
+
.TH "FEATURE\-STATUS" "1" "November 2019" "iFixit" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBfeature\-status\fR \- Determine if the current branch is up\-to\-date with the remote branch\.
|
@@ -12,9 +12,6 @@
|
|
12
12
|
.SH "DESCRIPTION"
|
13
13
|
Determine if the current branch is up\-to\-date with the remote branch\. If there are differences, show a graphical git log between the two branches\.
|
14
14
|
.
|
15
|
-
.P
|
16
|
-
Compatible with hotfix branches\.
|
17
|
-
.
|
18
15
|
.SH "COPYRIGHT"
|
19
16
|
Copyright (c) 2012\-2013 iFixit\.
|
20
17
|
.
|
data/man/feature-status.1.ronn
CHANGED
@@ -10,8 +10,6 @@ feature-status(1) - Determine if the current branch is up-to-date with the remot
|
|
10
10
|
Determine if the current branch is up-to-date with the remote branch. If there
|
11
11
|
are differences, show a graphical git log between the two branches.
|
12
12
|
|
13
|
-
Compatible with hotfix branches.
|
14
|
-
|
15
13
|
## COPYRIGHT
|
16
14
|
|
17
15
|
Copyright (c) 2012-2013 iFixit.
|
data/man/feature-switch.1
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "FEATURE\-SWITCH" "1" "
|
4
|
+
.TH "FEATURE\-SWITCH" "1" "November 2019" "iFixit" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBfeature\-switch\fR \- Switch to another feature branch\.
|
@@ -32,7 +32,7 @@ Pull the branch after switching to insure the local branch is up to date\.
|
|
32
32
|
Copyright (c) 2012\-2013 iFixit\.
|
33
33
|
.
|
34
34
|
.SH "SEE ALSO"
|
35
|
-
feature(1)
|
35
|
+
feature(1)
|
36
36
|
.
|
37
37
|
.SH "WWW"
|
38
38
|
https://github\.com/iFixit/git\-scripts
|
data/man/feature-switch.1.ronn
CHANGED
data/man/feature-url.1
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "FEATURE\-URL" "1" "
|
4
|
+
.TH "FEATURE\-URL" "1" "November 2019" "iFixit" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBfeature\-url\fR \- Grab the pull request url\.
|
@@ -16,7 +16,7 @@ Grab the url of the pull request for the current branch or the one specified\.
|
|
16
16
|
Copyright (c) 2012\-2013 iFixit\.
|
17
17
|
.
|
18
18
|
.SH "SEE ALSO"
|
19
|
-
feature(1)
|
19
|
+
feature(1)
|
20
20
|
.
|
21
21
|
.SH "WWW"
|
22
22
|
https://github\.com/iFixit/git\-scripts
|
data/man/feature-url.1.ronn
CHANGED
data/man/feature.1
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
.\" generated with Ronn/v0.7.3
|
2
2
|
.\" http://github.com/rtomayko/ronn/tree/0.7.3
|
3
3
|
.
|
4
|
-
.TH "FEATURE" "1" "
|
4
|
+
.TH "FEATURE" "1" "November 2019" "iFixit" ""
|
5
5
|
.
|
6
6
|
.SH "NAME"
|
7
7
|
\fBfeature\fR \- Perform actions on a git feature branch\.
|
@@ -10,7 +10,7 @@
|
|
10
10
|
\fBfeature\fR \fIcommand\fR [\fIargs\fR]
|
11
11
|
.
|
12
12
|
.SH "DESCRIPTION"
|
13
|
-
\fBFeature\fR is a helper script for a modified git\-flow model
|
13
|
+
\fBFeature\fR is a helper script for a modified git\-flow model\.
|
14
14
|
.
|
15
15
|
.SH "COMMANDS"
|
16
16
|
.
|
@@ -66,7 +66,7 @@ Test Github authentication\.
|
|
66
66
|
Copyright (c) 2012\-2013 iFixit\.
|
67
67
|
.
|
68
68
|
.SH "SEE ALSO"
|
69
|
-
|
69
|
+
git(1)
|
70
70
|
.
|
71
71
|
.SH "WWW"
|
72
72
|
https://github\.com/iFixit/git\-scripts
|
data/man/feature.1.ronn
CHANGED
@@ -7,8 +7,7 @@ feature(1) - Perform actions on a git feature branch.
|
|
7
7
|
|
8
8
|
## DESCRIPTION
|
9
9
|
|
10
|
-
**Feature** is a helper script for a modified git-flow model
|
11
|
-
`hotfix` are the primary actors.
|
10
|
+
**Feature** is a helper script for a modified git-flow model.
|
12
11
|
|
13
12
|
## COMMANDS
|
14
13
|
|
@@ -43,7 +42,7 @@ Copyright (c) 2012-2013 iFixit.
|
|
43
42
|
|
44
43
|
## SEE ALSO
|
45
44
|
|
46
|
-
|
45
|
+
git(1)
|
47
46
|
|
48
47
|
## WWW
|
49
48
|
|
data/man/index.txt
CHANGED
@@ -9,12 +9,5 @@ feature-status(1) feature-status.1.ronn
|
|
9
9
|
feature-stashes(1) feature-stashes.1.ronn
|
10
10
|
feature-github-test(1) feature-github-test.1.ronn
|
11
11
|
|
12
|
-
hotfix(1) hotfix.1.ronn
|
13
|
-
hotfix-list(1) hotfix-list.1.ronn
|
14
|
-
hotfix-start(1) hotfix-start.1.ronn
|
15
|
-
hotfix-switch(1) hotfix-switch.1.ronn
|
16
|
-
hotfix-finish(1) hotfix-finish.1.ronn
|
17
|
-
hotfix-merge(1) hotfix-merge.1.ronn
|
18
|
-
|
19
12
|
git(1) https://www.kernel.org/pub/software/scm/git/docs/
|
20
13
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git-scripts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Beardsley
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2019-
|
16
|
+
date: 2019-12-05 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: bundler
|
@@ -57,7 +57,7 @@ dependencies:
|
|
57
57
|
- - "~>"
|
58
58
|
- !ruby/object:Gem::Version
|
59
59
|
version: '1.8'
|
60
|
-
description: User scripts for managing feature branches
|
60
|
+
description: User scripts for managing and merging feature branches.
|
61
61
|
email:
|
62
62
|
- daniel@ifixit.com
|
63
63
|
- james@ifixit.com
|
@@ -67,7 +67,6 @@ email:
|
|
67
67
|
- robin@ifixit.com
|
68
68
|
executables:
|
69
69
|
- feature
|
70
|
-
- hotfix
|
71
70
|
extensions: []
|
72
71
|
extra_rdoc_files:
|
73
72
|
- COPYING
|
@@ -77,9 +76,7 @@ files:
|
|
77
76
|
- README.md
|
78
77
|
- Rakefile
|
79
78
|
- bin/feature
|
80
|
-
- bin/hotfix
|
81
79
|
- completion/_feature
|
82
|
-
- completion/_hotfix
|
83
80
|
- completion/bash_completion.sh
|
84
81
|
- lib/git.rb
|
85
82
|
- lib/github.rb
|
@@ -134,22 +131,6 @@ files:
|
|
134
131
|
- man/feature.1.html
|
135
132
|
- man/feature.1.markdown
|
136
133
|
- man/feature.1.ronn
|
137
|
-
- man/hotfix-finish-issue.1
|
138
|
-
- man/hotfix-finish-issue.1.ronn
|
139
|
-
- man/hotfix-finish.1
|
140
|
-
- man/hotfix-finish.1.ronn
|
141
|
-
- man/hotfix-list.1
|
142
|
-
- man/hotfix-list.1.ronn
|
143
|
-
- man/hotfix-merge.1
|
144
|
-
- man/hotfix-merge.1.ronn
|
145
|
-
- man/hotfix-start.1
|
146
|
-
- man/hotfix-start.1.ronn
|
147
|
-
- man/hotfix-switch.1
|
148
|
-
- man/hotfix-switch.1.ronn
|
149
|
-
- man/hotfix-url.1
|
150
|
-
- man/hotfix-url.1.ronn
|
151
|
-
- man/hotfix.1
|
152
|
-
- man/hotfix.1.ronn
|
153
134
|
- man/index.html
|
154
135
|
- man/index.txt
|
155
136
|
homepage: http://ifixit.github.com/git-scripts/
|
@@ -174,5 +155,5 @@ rubyforge_project:
|
|
174
155
|
rubygems_version: 2.7.6.2
|
175
156
|
signing_key:
|
176
157
|
specification_version: 4
|
177
|
-
summary: User scripts for managing feature branches
|
158
|
+
summary: User scripts for managing and merging feature branches.
|
178
159
|
test_files: []
|
data/bin/hotfix
DELETED
@@ -1,230 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
require_relative '../lib/signal_handlers.rb'
|
3
|
-
require_relative '../lib/github.rb'
|
4
|
-
require_relative '../lib/git.rb'
|
5
|
-
require_relative '../lib/helpers.rb'
|
6
|
-
require_relative '../lib/plugins.rb'
|
7
|
-
|
8
|
-
command=ARGV.first
|
9
|
-
|
10
|
-
$0 = ARGV.join(" ")
|
11
|
-
|
12
|
-
unless command == '--help' or command == '-h'
|
13
|
-
unless Git::in_a_repo
|
14
|
-
die("\nSwitch to a git repo. If you need help, use --help or -h.")
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
case command
|
19
|
-
when 'start'
|
20
|
-
require_argument(:hotfix, :start)
|
21
|
-
hotfix = hotfix_branch(ARGV[1])
|
22
|
-
stable_branch = Git::get_branch('stable')
|
23
|
-
|
24
|
-
Plugins.invoke :before_start, :hotfix, hotfix
|
25
|
-
|
26
|
-
Git::run_safe([
|
27
|
-
"git checkout #{stable_branch}",
|
28
|
-
"git fetch",
|
29
|
-
"git rebase --preserve-merges origin/#{stable_branch}",
|
30
|
-
"git branch \"#{hotfix}\" #{stable_branch}",
|
31
|
-
"git checkout \"#{hotfix}\""
|
32
|
-
])
|
33
|
-
|
34
|
-
Git::submodules_update
|
35
|
-
|
36
|
-
# Automatically setup remote tracking branch
|
37
|
-
Git::run_safe([
|
38
|
-
"git config branch.#{hotfix}.remote origin",
|
39
|
-
"git config branch.#{hotfix}.merge refs/heads/#{hotfix}",
|
40
|
-
"git config branch.#{hotfix}.rebase true"
|
41
|
-
])
|
42
|
-
|
43
|
-
Plugins.invoke :after_start, :hotfix, hotfix
|
44
|
-
|
45
|
-
when 'url'
|
46
|
-
require_argument(:hotfix, :url, min=1, max=2)
|
47
|
-
hotfix = ARGV[1] || Git::current_branch
|
48
|
-
|
49
|
-
url = Github::get_url(hotfix)
|
50
|
-
if url
|
51
|
-
puts url
|
52
|
-
else
|
53
|
-
abort "There is no pull request available for #{hotfix}.\n" +
|
54
|
-
'You can make one by using `hotfix finish`.'
|
55
|
-
end
|
56
|
-
|
57
|
-
|
58
|
-
when 'switch'
|
59
|
-
require_argument(:hotfix, :switch, min=2, max=5)
|
60
|
-
hotfix = current_hotfix_branch
|
61
|
-
|
62
|
-
Git::switch_branch(hotfix)
|
63
|
-
|
64
|
-
optional_pull
|
65
|
-
|
66
|
-
when 'finish'
|
67
|
-
hotfix = current_hotfix_branch
|
68
|
-
|
69
|
-
if !is_hotfix_branch hotfix
|
70
|
-
abort "This is a feature branch. Please use feature-finish."
|
71
|
-
end
|
72
|
-
|
73
|
-
# Push commits to origin
|
74
|
-
Git::run_safe(["git push origin #{hotfix}:#{hotfix}"])
|
75
|
-
|
76
|
-
exit 1 unless confirm("Create a pull-request for hotfix branch named: '#{hotfix}' ?")
|
77
|
-
octokit = Github::api
|
78
|
-
|
79
|
-
Plugins.invoke :before_finish, :hotfix, hotfix
|
80
|
-
|
81
|
-
description = Github::get_pull_request_description(hotfix)
|
82
|
-
puts "Pull-request description:"
|
83
|
-
puts description[:title]
|
84
|
-
puts "#"
|
85
|
-
puts description[:body]
|
86
|
-
|
87
|
-
response = octokit.create_pull_request(
|
88
|
-
Github::get_github_repo,
|
89
|
-
Git::get_branch('stable'),
|
90
|
-
hotfix,
|
91
|
-
description[:title],
|
92
|
-
description[:body]
|
93
|
-
)
|
94
|
-
|
95
|
-
Plugins.invoke :after_finish, :hotfix, hotfix, response
|
96
|
-
puts "Successfully created pull-request ##{response[:number]}"
|
97
|
-
puts " " + response[:html_url]
|
98
|
-
|
99
|
-
when 'finish-issue'
|
100
|
-
require_argument(:hotfix, :'finish-issue')
|
101
|
-
issue = ARGV[1]
|
102
|
-
hotfix = Git::current_branch
|
103
|
-
|
104
|
-
if !is_hotfix_branch hotfix
|
105
|
-
abort "This is a feature branch. Please use feature-finish-issue."
|
106
|
-
end
|
107
|
-
|
108
|
-
# Push commits to origin
|
109
|
-
Git::run_safe(["git push origin #{hotfix}:#{hotfix}"])
|
110
|
-
|
111
|
-
exit 1 unless confirm("Convert issue ##{issue} into a pull-request using " +
|
112
|
-
"hotfix branch named '#{hotfix}' ?")
|
113
|
-
octokit = Github::api
|
114
|
-
|
115
|
-
pull = octokit.create_pull_request_for_issue(
|
116
|
-
Github::get_github_repo,
|
117
|
-
Git::get_branch('stable'),
|
118
|
-
hotfix,
|
119
|
-
issue
|
120
|
-
)
|
121
|
-
|
122
|
-
# We've converted the issue to a pull request, now lets change the
|
123
|
-
# description to include the last commit message and prompt the user to
|
124
|
-
# confirm it.
|
125
|
-
|
126
|
-
last_commit_message = Git::commit_message(hotfix)
|
127
|
-
|
128
|
-
original_title = pull[:title].gsub("\r","")
|
129
|
-
original_body = pull[:body].gsub("\r","")
|
130
|
-
|
131
|
-
initial_message = <<-MESSAGE
|
132
|
-
#{last_commit_message}
|
133
|
-
|
134
|
-
----
|
135
|
-
|
136
|
-
Original issue: #{original_title}
|
137
|
-
----
|
138
|
-
|
139
|
-
#{original_body}
|
140
|
-
MESSAGE
|
141
|
-
|
142
|
-
description = Github::open_title_body_editor(initial_message)
|
143
|
-
|
144
|
-
updated_pull = octokit.update_pull_request(
|
145
|
-
Github::get_github_repo,
|
146
|
-
issue,
|
147
|
-
description[:title],
|
148
|
-
description[:body]
|
149
|
-
)
|
150
|
-
|
151
|
-
puts "Successfully converted issue ##{issue} to a pull-request"
|
152
|
-
puts " " + updated_pull[:html_url]
|
153
|
-
|
154
|
-
when 'merge'
|
155
|
-
fail_on_local_changes
|
156
|
-
dev_branch = Git::get_branch('development')
|
157
|
-
stable_branch = Git::get_branch('stable')
|
158
|
-
hotfix = current_hotfix_branch
|
159
|
-
|
160
|
-
if !is_hotfix_branch hotfix
|
161
|
-
exit 1 unless confirm("It looks like this is a feature branch. Are you sure you want to merge it into #{stable_branch}?")
|
162
|
-
end
|
163
|
-
|
164
|
-
Git::run_safe(["git fetch"])
|
165
|
-
|
166
|
-
pull_info = Github::get_pull_request_info_from_api(hotfix, stable_branch)
|
167
|
-
|
168
|
-
warning = Github::get_commit_status_warning(pull_info[:status])
|
169
|
-
unless warning.empty?
|
170
|
-
puts highlight(warning)
|
171
|
-
end
|
172
|
-
|
173
|
-
Plugins.invoke :before_merge, :hotfix, hotfix
|
174
|
-
|
175
|
-
exit 1 unless confirm("Merge hotfix named: '#{hotfix}' ?")
|
176
|
-
|
177
|
-
commit_message = Git::get_description_from_user(pull_info[:description])
|
178
|
-
commit_message_dev = commit_message.sub(stable_branch, dev_branch)
|
179
|
-
|
180
|
-
update = Git::submodules_update("get")
|
181
|
-
|
182
|
-
Git::run_safe([
|
183
|
-
# Checkout the branch to make sure we have it locally.
|
184
|
-
"git checkout #{hotfix.shellescape}",
|
185
|
-
"git rebase --preserve-merges origin/#{hotfix.shellescape}",
|
186
|
-
# Merge into stable.
|
187
|
-
"git checkout #{stable_branch}",
|
188
|
-
# Pull the latest changes and rebase the unpushed commits if any.
|
189
|
-
"git rebase --preserve-merges origin/#{stable_branch}",
|
190
|
-
# Merge the hotfix branch into stable.
|
191
|
-
"git merge --no-ff --no-edit -m #{commit_message.shellescape} \"#{hotfix}\"",
|
192
|
-
"#{update}",
|
193
|
-
# Merge into master.
|
194
|
-
"git checkout #{dev_branch}",
|
195
|
-
# Pull the latest changes and rebase the unpushed master commits if any.
|
196
|
-
"git rebase --preserve-merges origin/#{dev_branch}",
|
197
|
-
# Merge the hotfix branch into master.
|
198
|
-
"git merge --no-ff --no-edit -m #{commit_message_dev.shellescape} \"#{hotfix}\"",
|
199
|
-
# Init any submodules in the master branch. Note: no need to change.
|
200
|
-
# Directories before calling git submodule since we are already in the
|
201
|
-
# projects top-level directory.
|
202
|
-
"#{update}",
|
203
|
-
# Delete the local hotfix branch.
|
204
|
-
"git branch -d #{hotfix.shellescape}",
|
205
|
-
# Checkout stable branch.
|
206
|
-
"git checkout #{stable_branch}"
|
207
|
-
])
|
208
|
-
|
209
|
-
Plugins.invoke :after_merge, :hotfix, hotfix
|
210
|
-
|
211
|
-
puts "Successfully merged hotfix branch: #{hotfix} into #{stable_branch} and #{dev_branch}"
|
212
|
-
puts "If you are satisfied with the result, do this:\n" + <<CMDS
|
213
|
-
git push
|
214
|
-
git checkout #{dev_branch}
|
215
|
-
git push
|
216
|
-
CMDS
|
217
|
-
|
218
|
-
when 'list'
|
219
|
-
options = {
|
220
|
-
:hotfix => Git::hotfix_branches(:unmerged)
|
221
|
-
}
|
222
|
-
if ARGV.include?('-v')
|
223
|
-
options[:merged] = Git::hotfix_branches(:merged)
|
224
|
-
end
|
225
|
-
Git.show_branch_list(options)
|
226
|
-
else
|
227
|
-
display_hotfix_help
|
228
|
-
end
|
229
|
-
|
230
|
-
log_command("hotfix #{$0}")
|