git-whistles 0.7.0 → 0.7.1

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/Gemfile.lock CHANGED
@@ -1,19 +1,19 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- git-whistles (0.7.0)
4
+ git-whistles (0.7.1)
5
5
  pivotal-tracker (~> 0.5.6)
6
6
  term-ansicolor
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- builder (3.1.4)
11
+ builder (3.2.0)
12
12
  coderay (1.0.7)
13
13
  crack (0.3.2)
14
14
  happymapper (0.4.0)
15
15
  libxml-ruby (~> 2.0)
16
- libxml-ruby (2.5.0)
16
+ libxml-ruby (2.6.0)
17
17
  method_source (0.8)
18
18
  mime-types (1.21)
19
19
  nokogiri (1.5.6)
@@ -39,7 +39,7 @@ GEM
39
39
  rest-client (1.6.7)
40
40
  mime-types (>= 1.16)
41
41
  slop (3.3.2)
42
- term-ansicolor (1.0.7)
42
+ term-ansicolor (1.1.1)
43
43
 
44
44
  PLATFORMS
45
45
  ruby
data/README.md CHANGED
@@ -13,11 +13,12 @@ Use it with:
13
13
  - `git ff-all-branches [-f] [-p] [-v]`. Fast-forward all local tracking branches to their remote counterpart (where possible). Very useful on big projects.
14
14
  - `git stash-and-checkout [branch]` As the name implies: stash and checkout another branch.
15
15
  - `git-pull-request [--from your-branch] [--to target-branch]` Open your browser at a Github pull-request page for the specified branch (defaults to the current `head`). If you're using Pivotal Tracker and your branch has a story number in its name, populates your pull request with story details.
16
- - `git outstanding-features [-f from-branch] [-t to-branch]` List the pull requests merged in `[to-branch]` but not in `[from-branch]`. Useful to prepare a list of stuff you're going to deploy. Defaults to listing what's on `origin/master` but not on `origin/production`. ([PedroCunha](https://github.com/PedroCunha))
16
+ - `git outstanding-features [-f from-branch] [-t to-branch]` List the pull requests merged in `[to-branch]` but not in `[from-branch]`. Useful to prepare a list of stuff you're going to deploy. Defaults to listing what's on `origin/master` but not on `origin/production`. [[PedroCunha](https://github.com/PedroCunha)]
17
17
  - `git chop [branch]` Delete the local and origin copy of a branch. Useful to close feature branches once a feature is completed.
18
18
  - `git list-branches [-l] [-r] [-i integration-branch]` Colourful listing of all local or origin branches, and their distance to an integration branch (`master` by default).
19
19
  - `git merge-po <ancestor> <left> <right>` Merge engine for GetText PO files.
20
20
  - `git select <story-id>` Checkout a local branch with the matching number. If not found, lists remote branches
21
+ - `git latest-pushes [-n NR_RESULTS] [-p PATTERN]` Show latest pushed branches to origin. Defaults to 20 results. Pattern is appended to refs/remotes/origin/ so include the team or project name to filter results. [[PedroCunha](https://github.com/PedroCunha)]
21
22
 
22
23
  ### More details on some of the commands
23
24
 
@@ -0,0 +1,67 @@
1
+ #!/usr/bin/env ruby
2
+ # encoding: UTF-8
3
+ #
4
+ # git-latest-pushes --
5
+ #
6
+ # List of latest pushed branches on origin
7
+ #
8
+ require 'rubygems'
9
+ require 'optparse'
10
+ require 'term/ansicolor'
11
+ require 'git-whistles/app'
12
+
13
+ class App < Git::Whistles::App
14
+
15
+ def initialize
16
+ super
17
+ end
18
+
19
+ def main(args)
20
+ super
21
+ parse_args!(args)
22
+
23
+ results = `git for-each-ref --sort=-committerdate --count=#{options.results} refs/remotes/origin/#{options.pattern} --format='[%(committerdate:relative)] (%(authorname)) %(refname)'`
24
+ results = results.split("\n")
25
+
26
+ if results.any?
27
+ puts "Latest #{ [results.length, options.results].min } pushed branches:"
28
+
29
+ results.each do |branch|
30
+ puts branch.gsub('refs/remotes/origin/', '')
31
+ end
32
+ else
33
+ puts "no results..."
34
+ end
35
+ end
36
+
37
+ def defaults
38
+ {
39
+ :results => 20,
40
+ :pattern => ''
41
+ }
42
+ end
43
+
44
+ def option_parser
45
+ @option_parser ||= OptionParser.new do |op|
46
+ op.banner = %Q{
47
+ Returns the list of latest pushed branches on origin
48
+ Usage: git latest-pushes [-n NR_RESULTS] [-p PATTERN]
49
+ }
50
+
51
+ op.on("-n", "--n [NR_RESULTS]", "Number of results to display, defaults to 20") do |n|
52
+ options.nr_results = n
53
+ end
54
+
55
+ op.on("-p", "--p [PATTERN]", "Pattern to lookup. Eg. -p my-team-name") do |pattern|
56
+ options.pattern = pattern
57
+ end
58
+
59
+ op.on_tail("-h", "--help", "Show this message") do
60
+ puts op
61
+ exit
62
+ end
63
+ end
64
+ end
65
+ end
66
+
67
+ App.run!
@@ -20,7 +20,7 @@ class App < Git::Whistles::App
20
20
  super
21
21
  parse_args!(args)
22
22
 
23
- `git log --oneline #{options.to} ^#{options.from} | grep 'Merge pull request' | sed -e 's:.*from [^/]*/::'`
23
+ `git log --oneline #{options.from} ^#{options.to} | grep 'Merge pull request' | sed -e 's:.*from [^/]*/::'`
24
24
  end
25
25
 
26
26
  def defaults
@@ -4,7 +4,7 @@ require 'pathname'
4
4
 
5
5
  module Git
6
6
  module Whistles
7
- VERSION = "0.7.0"
7
+ VERSION = "0.7.1"
8
8
  GEMDIR = Pathname.new(__FILE__).parent.parent.parent
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,117 +1,119 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: git-whistles
3
- version: !ruby/object:Gem::Version
4
- hash: 3
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.7.1
5
5
  prerelease:
6
- segments:
7
- - 0
8
- - 7
9
- - 0
10
- version: 0.7.0
11
6
  platform: ruby
12
- authors:
7
+ authors:
13
8
  - Julien Letessier
14
9
  autorequire:
15
10
  bindir: bin
16
11
  cert_chain: []
17
-
18
- date: 2013-03-03 00:00:00 +00:00
19
- default_executable:
20
- dependencies:
21
- - !ruby/object:Gem::Dependency
22
- requirement: &id001 !ruby/object:Gem::Requirement
12
+ date: 2013-03-13 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: bundler
16
+ requirement: !ruby/object:Gem::Requirement
23
17
  none: false
24
- requirements:
25
- - - ">="
26
- - !ruby/object:Gem::Version
27
- hash: 23
28
- segments:
29
- - 1
30
- - 0
31
- - 0
18
+ requirements:
19
+ - - ! '>='
20
+ - !ruby/object:Gem::Version
32
21
  version: 1.0.0
33
- prerelease: false
34
- name: bundler
35
22
  type: :development
36
- version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
38
- requirement: &id002 !ruby/object:Gem::Requirement
39
- none: false
40
- requirements:
41
- - - ">="
42
- - !ruby/object:Gem::Version
43
- hash: 3
44
- segments:
45
- - 0
46
- version: "0"
47
23
  prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ! '>='
28
+ - !ruby/object:Gem::Version
29
+ version: 1.0.0
30
+ - !ruby/object:Gem::Dependency
48
31
  name: rake
49
- type: :development
50
- version_requirements: *id002
51
- - !ruby/object:Gem::Dependency
52
- requirement: &id003 !ruby/object:Gem::Requirement
32
+ requirement: !ruby/object:Gem::Requirement
53
33
  none: false
54
- requirements:
55
- - - ">="
56
- - !ruby/object:Gem::Version
57
- hash: 3
58
- segments:
59
- - 0
60
- version: "0"
34
+ requirements:
35
+ - - ! '>='
36
+ - !ruby/object:Gem::Version
37
+ version: '0'
38
+ type: :development
61
39
  prerelease: false
40
+ version_requirements: !ruby/object:Gem::Requirement
41
+ none: false
42
+ requirements:
43
+ - - ! '>='
44
+ - !ruby/object:Gem::Version
45
+ version: '0'
46
+ - !ruby/object:Gem::Dependency
62
47
  name: pry
63
- type: :development
64
- version_requirements: *id003
65
- - !ruby/object:Gem::Dependency
66
- requirement: &id004 !ruby/object:Gem::Requirement
48
+ requirement: !ruby/object:Gem::Requirement
67
49
  none: false
68
- requirements:
69
- - - ">="
70
- - !ruby/object:Gem::Version
71
- hash: 3
72
- segments:
73
- - 0
74
- version: "0"
50
+ requirements:
51
+ - - ! '>='
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
54
+ type: :development
75
55
  prerelease: false
56
+ version_requirements: !ruby/object:Gem::Requirement
57
+ none: false
58
+ requirements:
59
+ - - ! '>='
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ - !ruby/object:Gem::Dependency
76
63
  name: pry-nav
64
+ requirement: !ruby/object:Gem::Requirement
65
+ none: false
66
+ requirements:
67
+ - - ! '>='
68
+ - !ruby/object:Gem::Version
69
+ version: '0'
77
70
  type: :development
78
- version_requirements: *id004
79
- - !ruby/object:Gem::Dependency
80
- requirement: &id005 !ruby/object:Gem::Requirement
71
+ prerelease: false
72
+ version_requirements: !ruby/object:Gem::Requirement
73
+ none: false
74
+ requirements:
75
+ - - ! '>='
76
+ - !ruby/object:Gem::Version
77
+ version: '0'
78
+ - !ruby/object:Gem::Dependency
79
+ name: pivotal-tracker
80
+ requirement: !ruby/object:Gem::Requirement
81
81
  none: false
82
- requirements:
82
+ requirements:
83
83
  - - ~>
84
- - !ruby/object:Gem::Version
85
- hash: 7
86
- segments:
87
- - 0
88
- - 5
89
- - 6
84
+ - !ruby/object:Gem::Version
90
85
  version: 0.5.6
91
- prerelease: false
92
- name: pivotal-tracker
93
86
  type: :runtime
94
- version_requirements: *id005
95
- - !ruby/object:Gem::Dependency
96
- requirement: &id006 !ruby/object:Gem::Requirement
97
- none: false
98
- requirements:
99
- - - ">="
100
- - !ruby/object:Gem::Version
101
- hash: 3
102
- segments:
103
- - 0
104
- version: "0"
105
87
  prerelease: false
88
+ version_requirements: !ruby/object:Gem::Requirement
89
+ none: false
90
+ requirements:
91
+ - - ~>
92
+ - !ruby/object:Gem::Version
93
+ version: 0.5.6
94
+ - !ruby/object:Gem::Dependency
106
95
  name: term-ansicolor
96
+ requirement: !ruby/object:Gem::Requirement
97
+ none: false
98
+ requirements:
99
+ - - ! '>='
100
+ - !ruby/object:Gem::Version
101
+ version: '0'
107
102
  type: :runtime
108
- version_requirements: *id006
103
+ prerelease: false
104
+ version_requirements: !ruby/object:Gem::Requirement
105
+ none: false
106
+ requirements:
107
+ - - ! '>='
108
+ - !ruby/object:Gem::Version
109
+ version: '0'
109
110
  description: A few helpers for classic Git workflows
110
- email:
111
+ email:
111
112
  - julien.letessier@gmail.com
112
- executables:
113
+ executables:
113
114
  - git-chop
114
115
  - git-ff-all-branches
116
+ - git-latest-pushes
115
117
  - git-list-branches
116
118
  - git-merge-po
117
119
  - git-outstanding-features
@@ -119,10 +121,8 @@ executables:
119
121
  - git-select
120
122
  - git-stash-and-checkout
121
123
  extensions: []
122
-
123
124
  extra_rdoc_files: []
124
-
125
- files:
125
+ files:
126
126
  - .gitignore
127
127
  - Gemfile
128
128
  - Gemfile.lock
@@ -131,6 +131,7 @@ files:
131
131
  - Rakefile
132
132
  - bin/git-chop
133
133
  - bin/git-ff-all-branches
134
+ - bin/git-latest-pushes
134
135
  - bin/git-list-branches
135
136
  - bin/git-merge-po
136
137
  - bin/git-outstanding-features
@@ -148,41 +149,32 @@ files:
148
149
  - libexec/git-merge-po.sh
149
150
  - libexec/git-stash-and-checkout.sh
150
151
  - libexec/runner.rb
151
- has_rdoc: true
152
152
  homepage: http://github.com/mezis/git-whistles
153
153
  licenses: []
154
-
155
154
  post_install_message:
156
155
  rdoc_options: []
157
-
158
- require_paths:
156
+ require_paths:
159
157
  - lib
160
- required_ruby_version: !ruby/object:Gem::Requirement
158
+ required_ruby_version: !ruby/object:Gem::Requirement
161
159
  none: false
162
- requirements:
163
- - - ">="
164
- - !ruby/object:Gem::Version
165
- hash: 3
166
- segments:
160
+ requirements:
161
+ - - ! '>='
162
+ - !ruby/object:Gem::Version
163
+ version: '0'
164
+ segments:
167
165
  - 0
168
- version: "0"
169
- required_rubygems_version: !ruby/object:Gem::Requirement
166
+ hash: 4556227689092932790
167
+ required_rubygems_version: !ruby/object:Gem::Requirement
170
168
  none: false
171
- requirements:
172
- - - ">="
173
- - !ruby/object:Gem::Version
174
- hash: 23
175
- segments:
176
- - 1
177
- - 3
178
- - 6
169
+ requirements:
170
+ - - ! '>='
171
+ - !ruby/object:Gem::Version
179
172
  version: 1.3.6
180
173
  requirements: []
181
-
182
174
  rubyforge_project:
183
- rubygems_version: 1.3.9.5
175
+ rubygems_version: 1.8.23
184
176
  signing_key:
185
177
  specification_version: 3
186
- summary: "A few helpers for classic Git workflows: makes branching and merging, PO file handling, issuing pull requests slightly simpler."
178
+ summary: ! 'A few helpers for classic Git workflows: makes branching and merging,
179
+ PO file handling, issuing pull requests slightly simpler.'
187
180
  test_files: []
188
-