git-up 0.5.8 → 0.5.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. data/README.md +36 -18
  2. data/bin/git-up +1 -1
  3. data/lib/git-up.rb +31 -1
  4. data/lib/git-up/version.rb +1 -1
  5. metadata +24 -9
data/README.md CHANGED
@@ -6,15 +6,35 @@ git-up
6
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
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
8
 
9
- Solve them once and for all:
9
+ Solve them once and for all.
10
10
 
11
- ![gem install git-up](http://dl.dropbox.com/u/166030/nonsense/git-up.png)
11
+ install
12
+ -------
13
+
14
+ $ gem install git-up
15
+
16
+ Windows support is predictably absent. Try the [Python port](https://github.com/msiemens/PyGitUp), which was started for that reason.
17
+
18
+ use
19
+ ---
20
+
21
+ ![$ git up](http://dl.dropbox.com/u/166030/git-up/screenshot.png)
12
22
 
13
23
  although
14
24
  --------
15
25
 
16
26
  `git-up` might mess up your branches, or set your chest hair on fire, or be racist to your cat, I don't know. It works for me.
17
27
 
28
+ difficulties
29
+ ------------
30
+
31
+ ### Windows
32
+ Windows support is an ongoing pain. Have a look at [this ticket](https://github.com/aanand/git-up/issues/34) if you really need it, or if you're bored.
33
+
34
+ ### spawn.rb:187:in `_pspawn': Invalid command name (ArgumentError)
35
+
36
+ If you're using RVM and you get this error, [read this](https://github.com/aanand/git-up/blob/master/RVM.md).
37
+
18
38
  configuration
19
39
  -------------
20
40
 
@@ -27,32 +47,30 @@ To set it within a project, run the command inside that project's directory and
27
47
  cd myproject
28
48
  git config git-up.bundler.check true
29
49
 
30
- ### `git-up.bundler.check [true|false]`
31
-
32
- If set to `true`, `git-up` will check your app for any new bundled gems and suggest a `bundle install` if necessary.
50
+ ### git-up.bundler.check [true|false]
33
51
 
34
- It slows the process down slightly, and therefore defaults to `false`.
52
+ Default: **false**. If **true**, git-up will check your app for any new bundled gems and suggest a `bundle install` if necessary.
35
53
 
36
- ### `git-up.bundler.autoinstall [true|false]`
54
+ ### git-up.bundler.autoinstall [true|false]
37
55
 
38
- If you're even lazier, you can tell `git-up` to run `bundle install` for you if it finds missing gems. Make sure `git-up.bundler.check` is also set to `true` or it won't do anything.
56
+ Default: **false**. If **true**, and if `git-up.bundler.check` is also set to **true**, git-up will run `bundle install` for you if it finds missing gems.
39
57
 
40
- ### `git-up.fetch.prune [true|false]`
58
+ ### git-up.fetch.prune [true|false]
41
59
 
42
- By default, `git-up` will append the `--prune` flag to the `git fetch` command if your git version supports it (1.6.6 or greater), telling it to [remove any remote tracking branches which no longer exist on the remote](http://linux.die.net/man/1/git-fetch). Set this option to `false` to disable it.
60
+ Default: **true**. Append the `--prune` flag when running `git fetch`, if your git version supports it (1.6.6 or greater), telling it to [remove any remote tracking branches which no longer exist on the remote](http://linux.die.net/man/1/git-fetch).
43
61
 
44
- ### `git-up.fetch.all [true|false]`
62
+ ### git-up.fetch.all [true|false]
45
63
 
46
- Normally, `git-up` will only fetch remotes for which there is at least one local tracking branch. Setting this option will it `git-up` always fetch from all remotes, which is useful if e.g. you use a remote to push to your CI system but never check those branches out.
64
+ Default: **false**. Normally, git-up will only fetch remotes for which there is at least one local tracking branch. Setting this option to **true** will make git-up always fetch from all remotes, which is useful if e.g. you use a remote to push to your CI system but never check those branches out.
47
65
 
48
- ### `git-up.rebase.arguments [string]`
66
+ ### git-up.rebase.arguments [string]
49
67
 
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.
68
+ Default: **unset**. Additional arguments to pass to `git rebase`. For example, setting this to `--preserve-merges` will recreate your merge commits in the rebased branch.
51
69
 
52
- ### `git-up.rebase.auto [true|false]`
70
+ ### git-up.rebase.auto [true|false]
53
71
 
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.
72
+ Default: **true**. 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
73
 
56
- ### `git-up.rebase.log-hook "COMMAND"`
74
+ ### git-up.rebase.log-hook "COMMAND"
57
75
 
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'`
76
+ Default: **unset**. 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'`
data/bin/git-up CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  require 'git-up'
4
4
 
5
- GitUp.new.run
5
+ GitUp.new.run(ARGV)
6
6
 
@@ -2,7 +2,9 @@ require 'colored'
2
2
  require 'grit'
3
3
 
4
4
  class GitUp
5
- def run
5
+ def run(argv)
6
+ process_args(argv)
7
+
6
8
  command = ['git', 'fetch', '--multiple']
7
9
  command << '--prune' if prune?
8
10
  command += config("fetch.all") ? ['--all'] : remotes
@@ -26,6 +28,34 @@ class GitUp
26
28
  exit 1
27
29
  end
28
30
 
31
+ def process_args(argv)
32
+ banner = <<BANNER
33
+ Fetch and rebase all remotely-tracked branches.
34
+
35
+ $ git up
36
+ master #{"up to date".green}
37
+ development #{"rebasing...".yellow}
38
+ staging #{"fast-forwarding...".yellow}
39
+ production #{"up to date".green}
40
+
41
+ There are no command-line options, but there are a few
42
+ `git config` variables you can set, which are documented here:
43
+ #{"https://github.com/aanand/git-up#configuration".cyan}
44
+
45
+ BANNER
46
+
47
+ case argv
48
+ when []
49
+ return
50
+ when ["-h"], ["--help"]
51
+ $stderr.puts(banner)
52
+ exit
53
+ else
54
+ $stderr.puts(banner)
55
+ exit 1
56
+ end
57
+ end
58
+
29
59
  def rebase_all_branches
30
60
  col_width = branches.map { |b| b.name.length }.max + 1
31
61
 
@@ -1,3 +1,3 @@
1
1
  class GitUp
2
- VERSION = "0.5.8"
2
+ VERSION = "0.5.9"
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.8
4
+ version: 0.5.9
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-20 00:00:00.000000000 Z
15
+ date: 2013-07-16 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  name: thoughtbot-shoulda
19
- requirement: &70162618687840 !ruby/object:Gem::Requirement
19
+ requirement: !ruby/object:Gem::Requirement
20
20
  none: false
21
21
  requirements:
22
22
  - - ! '>='
@@ -24,10 +24,15 @@ dependencies:
24
24
  version: '0'
25
25
  type: :development
26
26
  prerelease: false
27
- version_requirements: *70162618687840
27
+ version_requirements: !ruby/object:Gem::Requirement
28
+ none: false
29
+ requirements:
30
+ - - ! '>='
31
+ - !ruby/object:Gem::Version
32
+ version: '0'
28
33
  - !ruby/object:Gem::Dependency
29
34
  name: colored
30
- requirement: &70162618687340 !ruby/object:Gem::Requirement
35
+ requirement: !ruby/object:Gem::Requirement
31
36
  none: false
32
37
  requirements:
33
38
  - - ! '>='
@@ -35,10 +40,15 @@ dependencies:
35
40
  version: '1.2'
36
41
  type: :runtime
37
42
  prerelease: false
38
- version_requirements: *70162618687340
43
+ version_requirements: !ruby/object:Gem::Requirement
44
+ none: false
45
+ requirements:
46
+ - - ! '>='
47
+ - !ruby/object:Gem::Version
48
+ version: '1.2'
39
49
  - !ruby/object:Gem::Dependency
40
50
  name: grit
41
- requirement: &70162618686920 !ruby/object:Gem::Requirement
51
+ requirement: !ruby/object:Gem::Requirement
42
52
  none: false
43
53
  requirements:
44
54
  - - ! '>='
@@ -46,7 +56,12 @@ dependencies:
46
56
  version: '0'
47
57
  type: :runtime
48
58
  prerelease: false
49
- version_requirements: *70162618686920
59
+ version_requirements: !ruby/object:Gem::Requirement
60
+ none: false
61
+ requirements:
62
+ - - ! '>='
63
+ - !ruby/object:Gem::Version
64
+ version: '0'
50
65
  description:
51
66
  email:
52
67
  - aanand.prasad@gmail.com
@@ -81,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
81
96
  version: '0'
82
97
  requirements: []
83
98
  rubyforge_project:
84
- rubygems_version: 1.8.17
99
+ rubygems_version: 1.8.23
85
100
  signing_key:
86
101
  specification_version: 3
87
102
  summary: git command to fetch and rebase all branches