git-up 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/git-up.gemspec +3 -3
  3. data/lib/git-up.rb +5 -6
  4. metadata +30 -17
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.1.0
1
+ 0.2.0
data/git-up.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{git-up}
8
- s.version = "0.1.0"
8
+ s.version = "0.2.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Aanand Prasad"]
12
- s.date = %q{2010-01-15}
12
+ s.date = %q{2010-03-04}
13
13
  s.default_executable = %q{git-up}
14
14
  s.email = %q{aanand.prasad@gmail.com}
15
15
  s.executables = ["git-up"]
@@ -33,7 +33,7 @@ Gem::Specification.new do |s|
33
33
  s.homepage = %q{http://github.com/aanand/git-up}
34
34
  s.rdoc_options = ["--charset=UTF-8"]
35
35
  s.require_paths = ["lib"]
36
- s.rubygems_version = %q{1.3.5}
36
+ s.rubygems_version = %q{1.3.6}
37
37
  s.summary = %q{git command to fetch and rebase all branches}
38
38
  s.test_files = [
39
39
  "test/helper.rb",
data/lib/git-up.rb CHANGED
@@ -12,10 +12,12 @@ class GitUp
12
12
 
13
13
  with_stash do
14
14
  returning_to_current_branch do
15
+ col_width = @repo.branches.map { |b| b.name.length }.max + 1
16
+
15
17
  @repo.branches.each do |branch|
16
18
  next unless remote = remote_for_branch(branch)
17
19
 
18
- print branch.name.ljust(20)
20
+ print branch.name.ljust(col_width)
19
21
 
20
22
  if remote.commit.sha == branch.commit.sha
21
23
  puts "up to date".green
@@ -47,11 +49,8 @@ class GitUp
47
49
  end
48
50
 
49
51
  def remote_for_branch(branch)
50
- if remote_name = @repo.config["branch.#{branch.name}.remote"]
51
- @repo.remotes.find { |r| r.name == "#{remote_name}/#{branch.name}" }
52
- else
53
- nil
54
- end
52
+ remote_name = @repo.config["branch.#{branch.name}.remote"] || "origin"
53
+ @repo.remotes.find { |r| r.name == "#{remote_name}/#{branch.name}" }
55
54
  end
56
55
 
57
56
  def with_stash
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-up
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 2
8
+ - 0
9
+ version: 0.2.0
5
10
  platform: ruby
6
11
  authors:
7
12
  - Aanand Prasad
@@ -9,39 +14,45 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2010-01-15 00:00:00 -05:00
17
+ date: 2010-03-04 00:00:00 -05:00
13
18
  default_executable: git-up
14
19
  dependencies:
15
20
  - !ruby/object:Gem::Dependency
16
21
  name: thoughtbot-shoulda
17
- type: :development
18
- version_requirement:
19
- version_requirements: !ruby/object:Gem::Requirement
22
+ prerelease: false
23
+ requirement: &id001 !ruby/object:Gem::Requirement
20
24
  requirements:
21
25
  - - ">="
22
26
  - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
23
29
  version: "0"
24
- version:
30
+ type: :development
31
+ version_requirements: *id001
25
32
  - !ruby/object:Gem::Dependency
26
33
  name: colored
27
- type: :runtime
28
- version_requirement:
29
- version_requirements: !ruby/object:Gem::Requirement
34
+ prerelease: false
35
+ requirement: &id002 !ruby/object:Gem::Requirement
30
36
  requirements:
31
37
  - - ">="
32
38
  - !ruby/object:Gem::Version
39
+ segments:
40
+ - 0
33
41
  version: "0"
34
- version:
42
+ type: :runtime
43
+ version_requirements: *id002
35
44
  - !ruby/object:Gem::Dependency
36
45
  name: grit
37
- type: :runtime
38
- version_requirement:
39
- version_requirements: !ruby/object:Gem::Requirement
46
+ prerelease: false
47
+ requirement: &id003 !ruby/object:Gem::Requirement
40
48
  requirements:
41
49
  - - ">="
42
50
  - !ruby/object:Gem::Version
51
+ segments:
52
+ - 0
43
53
  version: "0"
44
- version:
54
+ type: :runtime
55
+ version_requirements: *id003
45
56
  description:
46
57
  email: aanand.prasad@gmail.com
47
58
  executables:
@@ -76,18 +87,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
76
87
  requirements:
77
88
  - - ">="
78
89
  - !ruby/object:Gem::Version
90
+ segments:
91
+ - 0
79
92
  version: "0"
80
- version:
81
93
  required_rubygems_version: !ruby/object:Gem::Requirement
82
94
  requirements:
83
95
  - - ">="
84
96
  - !ruby/object:Gem::Version
97
+ segments:
98
+ - 0
85
99
  version: "0"
86
- version:
87
100
  requirements: []
88
101
 
89
102
  rubyforge_project:
90
- rubygems_version: 1.3.5
103
+ rubygems_version: 1.3.6
91
104
  signing_key:
92
105
  specification_version: 3
93
106
  summary: git command to fetch and rebase all branches