git-up 0.5.7 → 0.5.8

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.
Files changed (4) hide show
  1. data/README.md +9 -2
  2. data/lib/git-up.rb +4 -6
  3. data/lib/git-up/version.rb +1 -1
  4. metadata +9 -24
data/README.md CHANGED
@@ -1,9 +1,12 @@
1
1
  git-up
2
2
  ======
3
3
 
4
- So `git pull` merges by default, when it [should really rebase](http://www.gitready.com/advanced/2009/02/11/pull-with-rebase.html). You can [ask it to rebase instead](http://d.strelau.net/post/47338904/git-pull-rebase-by-default), but it still won't touch anything other than the currently checked-out branch. If you're tracking a bunch of remote branches, you'll get non-fast-forward complaints next time you push.
4
+ `git pull` has two problems:
5
5
 
6
- Solve it once and for all:
6
+ * It merges upstream changes by default, when it's really more polite to [rebase over them](http://www.gitready.com/advanced/2009/02/11/pull-with-rebase.html), unless your collaborators enjoy a commit graph that looks like bedhead.
7
+ * It only updates the branch you're currently on, which means `git push` will shout at you for being behind on branches you don't particularly care about right now.
8
+
9
+ Solve them once and for all:
7
10
 
8
11
  ![gem install git-up](http://dl.dropbox.com/u/166030/nonsense/git-up.png)
9
12
 
@@ -46,6 +49,10 @@ Normally, `git-up` will only fetch remotes for which there is at least one local
46
49
 
47
50
  If this option is set, its contents will be used by `git-up` as additional arguments when it calls `git rebase`. For example, setting this to `--preserve-merges` will recreate your merge commits in the rebased branch.
48
51
 
52
+ ### `git-up.rebase.auto [true|false]`
53
+
54
+ If this option is set to false, `git-up` will not rebase branches for you. Instead, it will print a message saying they are diverged and let you handle rebasing them later. This can be useful if you have a lot of in-progress work that you don't want to deal with at once, but still want to update other branches.
55
+
49
56
  ### `git-up.rebase.log-hook "COMMAND"`
50
57
 
51
58
  Runs COMMAND every time a branch is rebased or fast-forwarded, with the old head as $1 and the new head as $2. This can be used to view logs or diffs of incoming changes. For example: `'echo "changes on $1:"; git log --oneline --decorate $1..$2'`
@@ -29,11 +29,6 @@ class GitUp
29
29
  def rebase_all_branches
30
30
  col_width = branches.map { |b| b.name.length }.max + 1
31
31
 
32
- branches.sort_by! do |b|
33
- # perhaps add some way to customize sorting?
34
- b.name
35
- end
36
-
37
32
  branches.each do |branch|
38
33
  remote = remote_map[branch.name]
39
34
 
@@ -53,6 +48,9 @@ class GitUp
53
48
 
54
49
  if base == branch.commit.sha
55
50
  puts "fast-forwarding...".yellow
51
+ elsif config("rebase.auto") == 'false'
52
+ puts "diverged".red
53
+ next
56
54
  else
57
55
  puts "rebasing...".yellow
58
56
  end
@@ -79,7 +77,7 @@ class GitUp
79
77
  end
80
78
 
81
79
  def branches
82
- @branches ||= repo.branches.select { |b| remote_map.has_key?(b.name) }
80
+ @branches ||= repo.branches.select { |b| remote_map.has_key?(b.name) }.sort_by { |b| b.name }
83
81
  end
84
82
 
85
83
  def remotes
@@ -1,3 +1,3 @@
1
1
  class GitUp
2
- VERSION = "0.5.7"
2
+ VERSION = "0.5.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-up
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.7
4
+ version: 0.5.8
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -12,11 +12,11 @@ authors:
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
- date: 2012-09-17 00:00:00.000000000 Z
15
+ date: 2012-09-20 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: thoughtbot-shoulda
19
- requirement: !ruby/object:Gem::Requirement
19
+ requirement: &70162618687840 !ruby/object:Gem::Requirement
20
20
  none: false
21
21
  requirements:
22
22
  - - ! '>='
@@ -24,15 +24,10 @@ dependencies:
24
24
  version: '0'
25
25
  type: :development
26
26
  prerelease: false
27
- version_requirements: !ruby/object:Gem::Requirement
28
- none: false
29
- requirements:
30
- - - ! '>='
31
- - !ruby/object:Gem::Version
32
- version: '0'
27
+ version_requirements: *70162618687840
33
28
  - !ruby/object:Gem::Dependency
34
29
  name: colored
35
- requirement: !ruby/object:Gem::Requirement
30
+ requirement: &70162618687340 !ruby/object:Gem::Requirement
36
31
  none: false
37
32
  requirements:
38
33
  - - ! '>='
@@ -40,15 +35,10 @@ dependencies:
40
35
  version: '1.2'
41
36
  type: :runtime
42
37
  prerelease: false
43
- version_requirements: !ruby/object:Gem::Requirement
44
- none: false
45
- requirements:
46
- - - ! '>='
47
- - !ruby/object:Gem::Version
48
- version: '1.2'
38
+ version_requirements: *70162618687340
49
39
  - !ruby/object:Gem::Dependency
50
40
  name: grit
51
- requirement: !ruby/object:Gem::Requirement
41
+ requirement: &70162618686920 !ruby/object:Gem::Requirement
52
42
  none: false
53
43
  requirements:
54
44
  - - ! '>='
@@ -56,12 +46,7 @@ dependencies:
56
46
  version: '0'
57
47
  type: :runtime
58
48
  prerelease: false
59
- version_requirements: !ruby/object:Gem::Requirement
60
- none: false
61
- requirements:
62
- - - ! '>='
63
- - !ruby/object:Gem::Version
64
- version: '0'
49
+ version_requirements: *70162618686920
65
50
  description:
66
51
  email:
67
52
  - aanand.prasad@gmail.com
@@ -96,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
96
81
  version: '0'
97
82
  requirements: []
98
83
  rubyforge_project:
99
- rubygems_version: 1.8.23
84
+ rubygems_version: 1.8.17
100
85
  signing_key:
101
86
  specification_version: 3
102
87
  summary: git command to fetch and rebase all branches