hub 1.6.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of hub might be problematic. Click here for more details.

data/LICENSE ADDED
@@ -0,0 +1,20 @@
1
+ Copyright (c) 2009 Chris Wanstrath
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining
4
+ a copy of this software and associated documentation files (the
5
+ "Software"), to deal in the Software without restriction, including
6
+ without limitation the rights to use, copy, modify, merge, publish,
7
+ distribute, sublicense, and/or sell copies of the Software, and to
8
+ permit persons to whom the Software is furnished to do so, subject to
9
+ the following conditions:
10
+
11
+ The above copyright notice and this permission notice shall be
12
+ included in all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
17
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
18
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
19
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
20
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,351 @@
1
+ hub: git + hub = github
2
+ =======================
3
+
4
+ `hub` is a command line utility which adds GitHub knowledge to `git`.
5
+
6
+ It can used on its own or as a `git` wrapper.
7
+
8
+ Normal:
9
+
10
+ $ hub clone rtomayko/tilt
11
+
12
+ Expands to:
13
+ $ git clone git://github.com/rtomayko/tilt.git
14
+
15
+ Wrapping `git`:
16
+
17
+ $ git clone rack/rack
18
+
19
+ Expands to:
20
+ $ git clone git://github.com/rack/rack.git
21
+
22
+ hub requires you have `git` installed and in your `$PATH`. It also
23
+ requires Ruby 1.8.6+ or Ruby 1.9.1+. No other libraries necessary.
24
+
25
+
26
+ Install
27
+ -------
28
+
29
+ ### Standalone
30
+
31
+ `hub` is most easily installed as a standalone script:
32
+
33
+ curl http://defunkt.io/hub/standalone -sLo ~/bin/hub &&
34
+ chmod 755 ~/bin/hub
35
+
36
+ Assuming `~/bin/` is in your `$PATH`, you're ready to roll:
37
+
38
+ $ hub version
39
+ git version 1.7.0.4
40
+ hub version 1.1.0
41
+
42
+ ### Homebrew
43
+
44
+ $ brew install hub
45
+ $ which hub
46
+ /usr/local/bin/hub
47
+ $ hub version
48
+ ...
49
+
50
+ ### RubyGems
51
+
52
+ Though not recommended, `hub` can also be installed as a RubyGem:
53
+
54
+ $ gem install hub
55
+
56
+ (It's not recommended for casual use because of the RubyGems startup
57
+ time. See [this gist][speed] for information.)
58
+
59
+ ### Standalone via RubyGems
60
+
61
+ $ gem install hub
62
+ $ hub hub standalone > ~/bin/hub && chmod 755 ~/bin/hub
63
+
64
+ This installs a standalone version which doesn't require RubyGems to
65
+ run.
66
+
67
+ ### Source
68
+
69
+ You can also install from source:
70
+
71
+ $ git clone git://github.com/defunkt/hub.git
72
+ $ cd hub
73
+ $ rake install prefix=/usr/local
74
+
75
+ ### Help! It's Slow!
76
+
77
+ Is your prompt slow? It may be hub.
78
+
79
+ 1. Check that it's **not** installed using RubyGems.
80
+ 2. Check that RUBYOPT isn't loading anything shady:
81
+
82
+ $ echo $RUBYOPT
83
+
84
+ 3. Check that your system Ruby is speedy:
85
+
86
+ $ time /usr/bin/env ruby -e0
87
+
88
+ If #3 is slow, it may be your [GC settings][gc].
89
+
90
+
91
+ Aliasing
92
+ --------
93
+
94
+ `hub` works best when it wraps `git`. This is not dangerous - your
95
+ normal git commands should all work. hub merely adds some sugar.
96
+
97
+ Typing `hub alias <shell>` will display alias instructions for
98
+ your shell. `hub alias` alone will show the known shells.
99
+
100
+ For example:
101
+
102
+ $ hub alias bash
103
+ Run this in your shell to start using `hub` as `git`:
104
+ alias git=hub
105
+
106
+ You should place this command in your `.bash_profile` or other startup
107
+ script to ensure runs on login.
108
+
109
+ The alias command can also be eval'd directly using the `-s` flag:
110
+
111
+ $ eval `hub alias -s bash`
112
+
113
+
114
+ Commands
115
+ --------
116
+
117
+ Assuming you've aliased `hub` to `git` the following commands now have
118
+ superpowers:
119
+
120
+ ### git clone
121
+
122
+ $ git clone schacon/ticgit
123
+ > git clone git://github.com/schacon/ticgit.git
124
+
125
+ $ git clone -p schacon/ticgit
126
+ > git clone git@github.com:schacon/ticgit.git
127
+
128
+ $ git clone resque
129
+ > git clone git://github.com/YOUR_USER/resque.git
130
+
131
+ $ git clone -p resque
132
+ > git clone git@github.com:YOUR_USER/resque.git
133
+
134
+ ### git remote add
135
+
136
+ $ git remote add rtomayko
137
+ > git remote add rtomayko git://github.com/rtomayko/CURRENT_REPO.git
138
+
139
+ $ git remote add -p rtomayko
140
+ > git remote add rtomayko git@github.com:rtomayko/CURRENT_REPO.git
141
+
142
+ $ git remote add origin
143
+ > git remote add origin git://github.com/YOUR_USER/CURRENT_REPO.git
144
+
145
+ ### git fetch
146
+
147
+ $ git fetch mislav
148
+ > git remote add mislav git://github.com/mislav/REPO.git
149
+ > git fetch mislav
150
+
151
+ $ git fetch mislav,xoebus
152
+ > git remote add mislav ...
153
+ > git remote add xoebus ...
154
+ > git fetch --multiple mislav xoebus
155
+
156
+ ### git cherry-pick
157
+
158
+ $ git cherry-pick http://github.com/mislav/REPO/commit/SHA
159
+ > git remote add -f mislav git://github.com/mislav/REPO.git
160
+ > git cherry-pick SHA
161
+
162
+ $ git cherry-pick mislav@SHA
163
+ > git remote add -f mislav git://github.com/mislav/CURRENT_REPO.git
164
+ > git cherry-pick SHA
165
+
166
+ $ git cherry-pick mislav@SHA
167
+ > git fetch mislav
168
+ > git cherry-pick SHA
169
+
170
+ ### git fork
171
+
172
+ $ git fork
173
+ ... hardcore forking action ...
174
+ > git remote add -f YOUR_USER git@github.com:YOUR_USER/CURRENT_REPO.git
175
+
176
+ Forks the original repo on GitHub and adds the new remote under your
177
+ username. It requires your GitHub token to be present; see "GitHub
178
+ login" below for details.
179
+
180
+ ### git create
181
+
182
+ $ git create
183
+ ... hardcore creating action ...
184
+ > git remote add origin git@github.com:YOUR_USER/CURRENT_REPO.git
185
+
186
+ Creates a new public github repository and adds the remote `origin` at
187
+ "git@github.com:<USER>/<REPOSITORY>.git"
188
+
189
+ ### git init
190
+
191
+ $ git init -g
192
+ > git init
193
+ > git remote add origin git@github.com:YOUR_USER/REPO.git
194
+
195
+ ### git push
196
+
197
+ $ git push origin,staging,qa bert_timeout
198
+ > git push origin bert_timeout
199
+ > git push staging bert_timeout
200
+ > git push qa bert_timeout
201
+
202
+ ### git browse
203
+
204
+ $ git browse
205
+ > open https://github.com/YOUR_USER/CURRENT_REPO
206
+
207
+ $ git browse -- issues
208
+ > open https://github.com/YOUR_USER/CURRENT_REPO/issues
209
+
210
+ $ git browse schacon/ticgit
211
+ > open https://github.com/schacon/ticgit
212
+
213
+ $ git browse resque
214
+ > open https://github.com/YOUR_USER/resque
215
+
216
+ $ git browse resque network
217
+ > open https://github.com/YOUR_USER/resque/network
218
+
219
+ ### git compare
220
+
221
+ $ git compare refactor
222
+ > open https://github.com/CURRENT_REPO/compare/refactor
223
+
224
+ $ git compare 1.0...1.1
225
+ > open https://github.com/CURRENT_REPO/compare/1.0...1.1
226
+
227
+ $ git compare -u fix
228
+ > (https://github.com/CURRENT_REPO/compare/fix)
229
+
230
+ $ git compare other-user patch
231
+ > open https://github.com/other-user/REPO/compare/patch
232
+
233
+ ### git submodule
234
+
235
+ $ hub submodule add wycats/bundler vendor/bundler
236
+ > git submodule add git://github.com/wycats/bundler.git vendor/bundler
237
+
238
+ $ hub submodule add -p wycats/bundler vendor/bundler
239
+ > git submodule add git@github.com:wycats/bundler.git vendor/bundler
240
+
241
+ $ hub submodule add -b ryppl ryppl/pip vendor/pip
242
+ > git submodule add -b ryppl git://github.com/ryppl/pip.git vendor/pip
243
+
244
+
245
+ ### git help
246
+
247
+ $ git help
248
+ > (improved git help)
249
+ $ git help hub
250
+ > (hub man page)
251
+
252
+
253
+ GitHub Login
254
+ ------------
255
+
256
+ To get the most out of `hub`, you'll want to ensure your GitHub login
257
+ is stored locally in your Git config or environment variables.
258
+
259
+ To test it run this:
260
+
261
+ $ git config --global github.user
262
+
263
+ If you see nothing, you need to set the config setting:
264
+
265
+ $ git config --global github.user YOUR_USER
266
+
267
+ For commands that require write access to GitHub (such as `fork`), you'll want to
268
+ setup "github.token" as well. See [local GitHub config guide][2] for more information.
269
+
270
+ Want to use environment variables instead of a local gitconfig?
271
+
272
+ * `GITHUB_USER` - If set, this will be used instead of the `github.user` config
273
+ value to determine your GitHub username.
274
+ * `GITHUB_TOKEN` - If set, this will be used instead of the `github.token` config
275
+ value to determine your GitHub API token.
276
+
277
+ Configuration
278
+ -------------
279
+
280
+ If you prefer `http://` clones to `git://` clones, you can set the
281
+ `hub.http-clone` option to true using `git-config`.
282
+
283
+ For example:
284
+
285
+ $ git clone defunkt/repl
286
+ < git clone >
287
+ $ git config --global --bool hub.http-clone true
288
+ $ git clone defunkt/repl
289
+ < http clone >
290
+
291
+ Or you can enter this manually into your `~/.gitconfig` file:
292
+
293
+ $ cat ~/.gitconfig
294
+ [hub]
295
+ http-clone = yes
296
+
297
+
298
+ Prior Art
299
+ ---------
300
+
301
+ These projects also aim to either improve git or make interacting with
302
+ GitHub simpler:
303
+
304
+ * [eg](http://www.gnome.org/~newren/eg/)
305
+ * [github-gem](http://github.com/defunkt/github-gem)
306
+ * [gh](http://github.com/visionmedia/gh)
307
+
308
+
309
+ Contributing
310
+ ------------
311
+
312
+ Once you've made your great commits:
313
+
314
+ 1. [Fork][0] hub
315
+ 2. Create a topic branch - `git checkout -b my_branch`
316
+ 3. Push to your branch - `git push origin my_branch`
317
+ 4. Create an [Issue][1] with a link to your branch
318
+ 5. That's it!
319
+
320
+ ### Development Gems
321
+ You will need the following gems (and their dependencies) to
322
+ contribute to `hub`:
323
+
324
+ * `rake` (`gem install rake`)
325
+ * `kicker` (`gem install kicker`)
326
+ * `turn` (`gem install turn`)
327
+ * `mg` (`gem install mg`)
328
+ * `ronn` (`gem install ronn`)
329
+ * `webmock` (`gem install webmock`)
330
+
331
+ Meta
332
+ ----
333
+
334
+ * Code: `git clone git://github.com/defunkt/hub.git`
335
+ * Home: <http://github.com/defunkt/hub>
336
+ * Bugs: <http://github.com/defunkt/hub/issues>
337
+ * List: <http://groups.google.com/group/github>
338
+ * Test: <http://runcoderun.com/defunkt/hub>
339
+ * Gems: <http://gemcutter.org/gems/hub>
340
+
341
+
342
+ Authors
343
+ -------
344
+
345
+ <https://github.com/defunkt/hub/contributors>
346
+
347
+ [0]: http://help.github.com/forking/
348
+ [1]: http://github.com/defunkt/hub/issues
349
+ [speed]: http://gist.github.com/284823
350
+ [2]: http://github.com/guides/local-github-config
351
+ [gc]: https://twitter.com/brynary/status/49560668994674688
data/Rakefile ADDED
@@ -0,0 +1,104 @@
1
+ require 'rake/testtask'
2
+
3
+ #
4
+ # Helpers
5
+ #
6
+
7
+ def command?(command)
8
+ `which #{command} 2>/dev/null`
9
+ $?.success?
10
+ end
11
+
12
+ task :load_hub do
13
+ $LOAD_PATH.unshift 'lib'
14
+ require 'hub'
15
+ end
16
+
17
+ task :check_dirty do
18
+ if !`git status`.include?('nothing to commit')
19
+ abort "dirty index - not publishing!"
20
+ end
21
+ end
22
+
23
+
24
+ #
25
+ # Tests
26
+ #
27
+
28
+ task :default => :test
29
+
30
+ if command? :turn
31
+ desc "Run tests"
32
+ task :test do
33
+ suffix = "-n #{ENV['TEST']}" if ENV['TEST']
34
+ sh "turn test/*.rb #{suffix}"
35
+ end
36
+ else
37
+ Rake::TestTask.new do |t|
38
+ t.libs << 'lib'
39
+ t.ruby_opts << '-rubygems'
40
+ t.pattern = 'test/**/*_test.rb'
41
+ t.verbose = false
42
+ end
43
+ end
44
+
45
+ if command? :kicker
46
+ desc "Launch Kicker (like autotest)"
47
+ task :kicker do
48
+ puts "Kicking... (ctrl+c to cancel)"
49
+ exec "kicker -e rake test lib"
50
+ end
51
+ end
52
+
53
+
54
+ #
55
+ # Ron
56
+ #
57
+
58
+ if command? :ronn
59
+ desc "Show the manual"
60
+ task :man => "man:build" do
61
+ exec "man man/hub.1"
62
+ end
63
+
64
+ desc "Build the manual"
65
+ task "man:build" do
66
+ sh "ronn -br5 --organization=DEFUNKT --manual='Git Manual' man/*.ronn"
67
+ end
68
+ end
69
+
70
+
71
+ #
72
+ # Gems
73
+ #
74
+
75
+ desc "Build standalone script"
76
+ task :standalone => :load_hub do
77
+ require 'hub/standalone'
78
+ Hub::Standalone.save('hub')
79
+ end
80
+
81
+ desc "Install standalone script and man pages"
82
+ task :install => :standalone do
83
+ prefix = ENV['PREFIX'] || ENV['prefix'] || '/usr/local'
84
+
85
+ FileUtils.mkdir_p "#{prefix}/bin"
86
+ FileUtils.cp "hub", "#{prefix}/bin", :preserve => true
87
+
88
+ FileUtils.mkdir_p "#{prefix}/share/man/man1"
89
+ FileUtils.cp "man/hub.1", "#{prefix}/share/man/man1"
90
+ end
91
+
92
+ desc "Publish to GitHub Pages"
93
+ task :pages => [ "man:build", :check_dirty, :standalone ] do
94
+ cp "man/hub.1.html", "html"
95
+ sh "git checkout gh-pages"
96
+ sh "mv hub standalone"
97
+ sh "git add standalone*"
98
+ sh "mv html hub.1.html"
99
+ sh "git add hub.1.html"
100
+ sh "git commit -m 'update standalone'"
101
+ sh "git push origin gh-pages"
102
+ sh "git checkout master"
103
+ puts :done
104
+ end