git-scripts 0.4.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +8 -0
  3. data/bin/feature +81 -32
  4. data/bin/hotfix +40 -4
  5. data/completion/_feature +2 -1
  6. data/completion/bash_completion.sh +2 -2
  7. data/lib/github.rb +32 -6
  8. data/lib/helpers.rb +17 -6
  9. data/lib/plugins.rb +25 -0
  10. data/man/feature-finish-issue.1 +2 -2
  11. data/man/feature-finish-issue.1.ronn +1 -1
  12. data/man/feature-finish.1 +1 -1
  13. data/man/feature-switch.1 +12 -2
  14. data/man/feature-switch.1.ronn +5 -2
  15. data/man/feature-url.1 +22 -0
  16. data/man/feature-url.1.ronn +23 -0
  17. data/man/feature.1 +9 -1
  18. data/man/feature.1.ronn +4 -0
  19. data/man/hotfix-finish-issue.1 +2 -2
  20. data/man/hotfix-finish-issue.1.ronn +1 -1
  21. data/man/hotfix-finish.1 +1 -1
  22. data/man/hotfix-switch.1 +17 -1
  23. data/man/hotfix-switch.1.ronn +10 -2
  24. data/man/hotfix-url.1 +22 -0
  25. data/man/hotfix-url.1.ronn +23 -0
  26. data/man/hotfix.1 +9 -1
  27. data/man/hotfix.1.ronn +4 -0
  28. metadata +45 -78
  29. data/man/feature-clean.1.html +0 -120
  30. data/man/feature-clean.1.markdown +0 -61
  31. data/man/feature-finish-issue.1.html +0 -113
  32. data/man/feature-finish-issue.1.markdown +0 -56
  33. data/man/feature-finish.1.html +0 -113
  34. data/man/feature-finish.1.markdown +0 -56
  35. data/man/feature-github-test.1.html +0 -110
  36. data/man/feature-github-test.1.markdown +0 -53
  37. data/man/feature-list.1.html +0 -119
  38. data/man/feature-list.1.markdown +0 -60
  39. data/man/feature-merge.1.html +0 -116
  40. data/man/feature-merge.1.markdown +0 -59
  41. data/man/feature-prune.1.html +0 -116
  42. data/man/feature-prune.1.markdown +0 -60
  43. data/man/feature-start.1.html +0 -110
  44. data/man/feature-start.1.markdown +0 -53
  45. data/man/feature-stashes.1.html +0 -122
  46. data/man/feature-stashes.1.markdown +0 -63
  47. data/man/feature-status.1.html +0 -113
  48. data/man/feature-status.1.markdown +0 -56
  49. data/man/feature-switch.1.html +0 -120
  50. data/man/feature-switch.1.markdown +0 -61
  51. data/man/feature.1.html +0 -129
  52. data/man/feature.1.markdown +0 -80
  53. data/man/hotfix-finish-issue.1.html +0 -113
  54. data/man/hotfix-finish-issue.1.markdown +0 -56
  55. data/man/hotfix-finish.1.html +0 -112
  56. data/man/hotfix-finish.1.markdown +0 -55
  57. data/man/hotfix-list.1.html +0 -119
  58. data/man/hotfix-list.1.markdown +0 -60
  59. data/man/hotfix-merge.1.html +0 -116
  60. data/man/hotfix-merge.1.markdown +0 -59
  61. data/man/hotfix-start.1.html +0 -110
  62. data/man/hotfix-start.1.markdown +0 -53
  63. data/man/hotfix-switch.1.html +0 -112
  64. data/man/hotfix-switch.1.markdown +0 -55
  65. data/man/hotfix.1.html +0 -123
  66. data/man/hotfix.1.markdown +0 -68
@@ -13,8 +13,9 @@ def display_feature_help(command = nil, message = nil)
13
13
  :script_name => "Git Feature Branch Helper",
14
14
  :commands => {
15
15
  :list => "feature list [-v]",
16
+ :url => "feature url [name-of-feature]",
16
17
  :start => "feature start name-of-feature",
17
- :switch => "feature switch (name-of-feature | -n number-of-feature) [--clean]",
18
+ :switch => "feature switch (name-of-feature | -n number-of-feature) [options]",
18
19
  :finish => "feature finish [name-of-feature]",
19
20
  :'finish-issue' => "feature finish-issue issue-number",
20
21
  :merge => "feature merge (name-of-feature | -n number-of-feature)",
@@ -36,8 +37,9 @@ def display_hotfix_help(command = nil, message = nil)
36
37
  :script_name => "Git Hotfix Helper",
37
38
  :commands => {
38
39
  :list => "hotfix list [-v]",
40
+ :url => "hotfix url [name-of-hotfix]",
39
41
  :start => "hotfix start name-of-hotfix",
40
- :switch => "hotfix switch (name-of-hotfix | -n number-of-hotfix)",
42
+ :switch => "hotfix switch (name-of-hotfix | -n number-of-hotfix) [options]",
41
43
  :finish => "hotfix finish [name-of-hotfix]",
42
44
  :'finish-issue' => "hotfix finish-issue issue-number",
43
45
  :merge => "hotfix merge (name-of-hotfix | -n number-of-hotfix)",
@@ -157,10 +159,6 @@ def current_hotfix_branch()
157
159
  branch = Git::current_branch
158
160
  end
159
161
 
160
- unless is_hotfix_branch(branch)
161
- puts "#{branch} is not a hotfix branch"
162
- exit 1
163
- end
164
162
  return branch
165
163
  end
166
164
 
@@ -184,3 +182,16 @@ def log_command(command)
184
182
  log.puts "#{Time.now.iso8601}: #{command}"
185
183
  log.close
186
184
  end
185
+
186
+ ##
187
+ # If the commandline arguments contain '--pull', perform a feature pull
188
+ ##
189
+ def optional_pull
190
+ if ARGV.include?("--pull")
191
+ puts %x(feature pull)
192
+ end
193
+ end
194
+
195
+ def esc(str)
196
+ str.shellescape
197
+ end
@@ -0,0 +1,25 @@
1
+ module Plugins
2
+ def Plugins.register(plugin_module)
3
+ @@plugins << plugin_module
4
+ end
5
+
6
+ def Plugins.invoke(action, *arguments)
7
+ @@plugins.each do |plugin|
8
+ if plugin.respond_to?(action)
9
+ plugin.send(action, *arguments)
10
+ end
11
+ end
12
+ end
13
+
14
+ def Plugins.init
15
+ @@plugins = []
16
+ end
17
+ end
18
+
19
+ Plugins.init
20
+
21
+ cwd = File.dirname(__FILE__)
22
+ Dir.glob(File.join(cwd, '../plugins/*.rb')).each do |file|
23
+ require file
24
+ end
25
+
@@ -1,13 +1,13 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "FEATURE\-FINISH\-ISSUE" "1" "September 2013" "iFixit" ""
4
+ .TH "FEATURE\-FINISH\-ISSUE" "1" "February 2014" "iFixit" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBfeature\-finish\-issue\fR \- Finish this feature branch and attach it to an issue\.
8
8
  .
9
9
  .SH "SYNOPSIS"
10
- \fBfeature finish\fR \fIissue\-number\fR
10
+ \fBfeature finish\-issue\fR \fIissue\-number\fR
11
11
  .
12
12
  .SH "DESCRIPTION"
13
13
  Finish the current feature branch and optionally convert an existing issue into a pull request\. The pull\'s description defaults to the commit message from the last commit on the branch with the issue\'s original title and description underneath\.
@@ -3,7 +3,7 @@ feature-finish-issue(1) - Finish this feature branch and attach it to an issue.
3
3
 
4
4
  ## SYNOPSIS
5
5
 
6
- `feature finish` <issue-number>
6
+ `feature finish-issue` <issue-number>
7
7
 
8
8
  ## DESCRIPTION
9
9
 
@@ -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\-FINISH" "1" "September 2013" "iFixit" ""
4
+ .TH "FEATURE\-FINISH" "1" "February 2014" "iFixit" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBfeature\-finish\fR \- Finish this feature branch\.
@@ -1,13 +1,16 @@
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" "September 2013" "iFixit" ""
4
+ .TH "FEATURE\-SWITCH" "1" "September 2013" "" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBfeature\-switch\fR \- Switch to another feature branch\.
8
8
  .
9
9
  .SH "SYNOPSIS"
10
- \fBfeature switch\fR \fIname\-of\-feature\fR [\-\-clean] \fBfeature switch\fR \-n \fInumber\-of\-pull\fR [\-\-clean]
10
+ \fBfeature switch\fR \fIname\-of\-feature\fR \fIoptions\fR
11
+ .
12
+ .br
13
+ \fBfeature switch\fR \-n \fInumber\-of\-pull\fR \fIoptions\fR
11
14
  .
12
15
  .SH "DESCRIPTION"
13
16
  Switch to the \fIname\-of\-feature\fR branch, or with the \-n argument switch to the branch with a pull request numbered \fInumber\-of\-pull\fR
@@ -17,6 +20,13 @@ Switch to the \fIname\-of\-feature\fR branch, or with the \-n argument switch to
17
20
  .TP
18
21
  \fB\-\-clean\fR
19
22
  Remove files that aren\'t tracked in \fIname\-of\-feature\fR\.
23
+ .
24
+ .TP
25
+ \fB\-\-pull\fR:
26
+ .
27
+ .br
28
+ Pull the branch after switching to insure the local branch is up to date\.
29
+
20
30
  .
21
31
  .SH "COPYRIGHT"
22
32
  Copyright (c) 2012\-2013 iFixit\.
@@ -3,8 +3,8 @@ feature-switch(1) - Switch to another feature branch.
3
3
 
4
4
  ## SYNOPSIS
5
5
 
6
- `feature switch` <name-of-feature> [--clean]
7
- `feature switch` -n <number-of-pull> [--clean]
6
+ `feature switch` <name-of-feature> [options]
7
+ `feature switch` -n <number-of-pull> [options]
8
8
 
9
9
  ## DESCRIPTION
10
10
 
@@ -16,6 +16,9 @@ to the branch with a pull request numbered <number-of-pull>
16
16
  * `--clean`:
17
17
  Remove files that aren't tracked in <name-of-feature>.
18
18
 
19
+ * `--pull`:
20
+ Pull the branch after switching to insure the local branch is up to date.
21
+
19
22
  ## COPYRIGHT
20
23
 
21
24
  Copyright (c) 2012-2013 iFixit.
@@ -0,0 +1,22 @@
1
+ .\" generated with Ronn/v0.7.3
2
+ .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
+ .
4
+ .TH "FEATURE\-URL" "1" "August 2013" "iFixit" ""
5
+ .
6
+ .SH "NAME"
7
+ \fBfeature\-url\fR \- Grab the pull request url\.
8
+ .
9
+ .SH "SYNOPSIS"
10
+ \fBfeature url\fR [name\-of\-feature]
11
+ .
12
+ .SH "DESCRIPTION"
13
+ Grab the url of the pull request for the current branch or the one specified\.
14
+ .
15
+ .SH "COPYRIGHT"
16
+ Copyright (c) 2012\-2013 iFixit\.
17
+ .
18
+ .SH "SEE ALSO"
19
+ feature(1), hotfix\-url(1)
20
+ .
21
+ .SH "WWW"
22
+ https://github\.com/iFixit/git\-scripts
@@ -0,0 +1,23 @@
1
+ feature-url(1) - Grab the pull request url.
2
+ ===========================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ `feature url` [name-of-feature]
7
+
8
+ ## DESCRIPTION
9
+
10
+ Grab the url of the pull request for the current branch or the one specified.
11
+
12
+ ## COPYRIGHT
13
+
14
+ Copyright (c) 2012-2013 iFixit.
15
+
16
+ ## SEE ALSO
17
+
18
+ feature(1), hotfix-url(1)
19
+
20
+ ## WWW
21
+
22
+ https://github.com/iFixit/git-scripts
23
+
@@ -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" "September 2013" "iFixit" ""
4
+ .TH "FEATURE" "1" "February 2014" "iFixit" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBfeature\fR \- Perform actions on a git feature branch\.
@@ -23,6 +23,10 @@ feature\-start(1)
23
23
  Start a new feature branch\.
24
24
  .
25
25
  .TP
26
+ feature\-url(1)
27
+ Get the url of a branch\'s pull request\.
28
+ .
29
+ .TP
26
30
  feature\-switch(1)
27
31
  Switch to another feature branch\.
28
32
  .
@@ -31,6 +35,10 @@ feature\-finish(1)
31
35
  Finish this feature branch (push and open a pull request)\.
32
36
  .
33
37
  .TP
38
+ feature\-finish\-issue(1)
39
+ Finish this feature branch and attach it to an issue\.
40
+ .
41
+ .TP
34
42
  feature\-merge(1)
35
43
  Merge a feature branch into the development branch\.
36
44
  .
@@ -16,10 +16,14 @@ feature(1) - Perform actions on a git feature branch.
16
16
  List the current branch and any available feature branches.
17
17
  * feature-start(1):
18
18
  Start a new feature branch.
19
+ * feature-url(1):
20
+ Get the url of a branch's pull request.
19
21
  * feature-switch(1):
20
22
  Switch to another feature branch.
21
23
  * feature-finish(1):
22
24
  Finish this feature branch (push and open a pull request).
25
+ * feature-finish-issue(1):
26
+ Finish this feature branch and attach it to an issue.
23
27
  * feature-merge(1):
24
28
  Merge a feature branch into the development branch.
25
29
  * feature-pull(1):
@@ -1,13 +1,13 @@
1
1
  .\" generated with Ronn/v0.7.3
2
2
  .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
3
  .
4
- .TH "HOTFIX\-FINISH\-ISSUE" "1" "September 2013" "iFixit" ""
4
+ .TH "HOTFIX\-FINISH\-ISSUE" "1" "February 2014" "iFixit" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBhotfix\-finish\-issue\fR \- Finish this hotfix branch and attach it to an issue\.
8
8
  .
9
9
  .SH "SYNOPSIS"
10
- \fBhotfix finish\fR \fIissue\-number\fR
10
+ \fBhotfix finish\-issue\fR \fIissue\-number\fR
11
11
  .
12
12
  .SH "DESCRIPTION"
13
13
  Finish the current hotfix branch and optionally convert an existing issue into a pull request\. The pull\'s description defaults to the commit message from the last commit on the branch with the issue\'s original title and description underneath\.
@@ -3,7 +3,7 @@ hotfix-finish-issue(1) - Finish this hotfix branch and attach it to an issue.
3
3
 
4
4
  ## SYNOPSIS
5
5
 
6
- `hotfix finish` <issue-number>
6
+ `hotfix finish-issue` <issue-number>
7
7
 
8
8
  ## DESCRIPTION
9
9
 
@@ -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 "HOTFIX\-FINISH" "1" "September 2013" "iFixit" ""
4
+ .TH "HOTFIX\-FINISH" "1" "February 2014" "iFixit" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBhotfix\-finish\fR \- Finish this hotfix branch\.
@@ -7,10 +7,26 @@
7
7
  \fBhotfix\-switch\fR \- Switch to another hotfix branch\.
8
8
  .
9
9
  .SH "SYNOPSIS"
10
- \fBhotfix switch\fR \fIname\-of\-hotfix\fR \fBhotfix switch\fR \-n \fInumber\-of\-pull\fR
10
+ \fBhotfix switch\fR \fIname\-of\-hotfix\fR \fIoptions\fR
11
+ .
12
+ .br
13
+ \fBhotfix switch\fR \-n \fInumber\-of\-pull\fR \fIoptions\fR
11
14
  .
12
15
  .SH "DESCRIPTION"
13
16
  Switch to the \fIname\-of\-hotfix\fR branch, or with the \-n argument switch to the branch with a pull request numbered \fInumber\-of\-pull\fR
17
+ .
18
+ .SH "OPTIONS"
19
+ .
20
+ .TP
21
+ \fB\-\-clean\fR
22
+ Remove files that aren\'t tracked in \fIname\-of\-feature\fR\.
23
+ .
24
+ .TP
25
+ \fB\-\-pull\fR:
26
+ .
27
+ .br
28
+ Pull the branch after switching to insure the local branch is up to date\.
29
+
14
30
  .
15
31
  .SH "COPYRIGHT"
16
32
  Copyright (c) 2012\-2013 iFixit\.
@@ -3,14 +3,22 @@ hotfix-switch(1) - Switch to another hotfix branch.
3
3
 
4
4
  ## SYNOPSIS
5
5
 
6
- `hotfix switch` <name-of-hotfix>
7
- `hotfix switch` -n <number-of-pull>
6
+ `hotfix switch` <name-of-hotfix> [options]
7
+ `hotfix switch` -n <number-of-pull> [options]
8
8
 
9
9
  ## DESCRIPTION
10
10
 
11
11
  Switch to the <name-of-hotfix> branch, or with the -n argument switch
12
12
  to the branch with a pull request numbered <number-of-pull>
13
13
 
14
+ ## OPTIONS
15
+
16
+ * `--clean`:
17
+ Remove files that aren't tracked in <name-of-feature>.
18
+
19
+ * `--pull`:
20
+ Pull the branch after switching to insure the local branch is up to date.
21
+
14
22
  ## COPYRIGHT
15
23
 
16
24
  Copyright (c) 2012-2013 iFixit.
@@ -0,0 +1,22 @@
1
+ .\" generated with Ronn/v0.7.3
2
+ .\" http://github.com/rtomayko/ronn/tree/0.7.3
3
+ .
4
+ .TH "HOTFIX\-URL" "1" "August 2013" "iFixit" ""
5
+ .
6
+ .SH "NAME"
7
+ \fBhotfix\-url\fR \- Grab the pull request url\.
8
+ .
9
+ .SH "SYNOPSIS"
10
+ \fBhotfix url\fR [name\-of\-hotfix]
11
+ .
12
+ .SH "DESCRIPTION"
13
+ Grab the url of the pull request for the current branch or the one specified\.
14
+ .
15
+ .SH "COPYRIGHT"
16
+ Copyright (c) 2012\-2013 iFixit\.
17
+ .
18
+ .SH "SEE ALSO"
19
+ hotfix(1), feature\-url(1)
20
+ .
21
+ .SH "WWW"
22
+ https://github\.com/iFixit/git\-scripts
@@ -0,0 +1,23 @@
1
+ hotfix-url(1) - Grab the pull request url.
2
+ ==========================================
3
+
4
+ ## SYNOPSIS
5
+
6
+ `hotfix url` [name-of-hotfix]
7
+
8
+ ## DESCRIPTION
9
+
10
+ Grab the url of the pull request for the current branch or the one specified.
11
+
12
+ ## COPYRIGHT
13
+
14
+ Copyright (c) 2012-2013 iFixit.
15
+
16
+ ## SEE ALSO
17
+
18
+ hotfix(1), feature-url(1)
19
+
20
+ ## WWW
21
+
22
+ https://github.com/iFixit/git-scripts
23
+
@@ -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 "HOTFIX" "1" "September 2013" "iFixit" ""
4
+ .TH "HOTFIX" "1" "February 2014" "iFixit" ""
5
5
  .
6
6
  .SH "NAME"
7
7
  \fBhotfix\fR \- Perform actions on a git hotfix branch\.
@@ -19,6 +19,10 @@ hotfix\-list(1)
19
19
  List the current branch and any available hotfix branches\.
20
20
  .
21
21
  .TP
22
+ hotfix\-url(1)
23
+ Get the url of a branch\'s pull request\.
24
+ .
25
+ .TP
22
26
  hotfix\-start(1)
23
27
  Start a new hotfix branch\.
24
28
  .
@@ -31,6 +35,10 @@ hotfix\-finish(1)
31
35
  Finish this hotfix branch (push and open a pull request)\.
32
36
  .
33
37
  .TP
38
+ hotfix\-finish\-issue(1)
39
+ Finish this hotfix branch and attach it to an issue\.
40
+ .
41
+ .TP
34
42
  hotfix\-merge(1)
35
43
  Merge a hotfix branch into stable and the development branch\.
36
44
  .
@@ -14,12 +14,16 @@ hotfix(1) - Perform actions on a git hotfix branch.
14
14
 
15
15
  * hotfix-list(1):
16
16
  List the current branch and any available hotfix branches.
17
+ * hotfix-url(1):
18
+ Get the url of a branch's pull request.
17
19
  * hotfix-start(1):
18
20
  Start a new hotfix branch.
19
21
  * hotfix-switch(1):
20
22
  Switch to another hotfix branch.
21
23
  * hotfix-finish(1):
22
24
  Finish this hotfix branch (push and open a pull request).
25
+ * hotfix-finish-issue(1):
26
+ Finish this hotfix branch and attach it to an issue.
23
27
  * hotfix-merge(1):
24
28
  Merge a hotfix branch into stable and the development branch.
25
29