git-hub 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/HISTORY.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## 0.1.3 (2009-12-11)
2
+
3
+ * Homebrew!
4
+ * Fix inaccuracy in man page
5
+ * Better help arrangement
6
+ * Bugfix: Path problems in standalone.rb
7
+ * Bugfix: Standalone not loaded by default
8
+
1
9
  ## 0.1.2 (2009-12-10)
2
10
 
3
11
  * Fixed README typos
data/README.md CHANGED
@@ -44,6 +44,10 @@ Assuming `~/bin/` is in your `$PATH`, you're ready to roll:
44
44
  git version 1.6.4.2
45
45
  hub version 0.1.0
46
46
 
47
+ ### Homebrew
48
+
49
+ brew install hub
50
+
47
51
  ### RubyGems
48
52
 
49
53
  Though not recommended, `hub` can also be installed as a RubyGem:
@@ -58,8 +62,7 @@ You can also install from source:
58
62
 
59
63
  $ git clone git://github.com/defunkt/hub.git
60
64
  $ cd hub
61
- $ rake standalone
62
- $ cp hub /usr/local/bin/
65
+ $ rake install prefix=/usr/local
63
66
 
64
67
 
65
68
  Aliasing
@@ -123,6 +126,8 @@ superpowers:
123
126
 
124
127
  $ git help
125
128
  > (improved git help)
129
+ $ git help hub
130
+ > (hub man page)
126
131
 
127
132
 
128
133
  GitHub Login
data/Rakefile CHANGED
@@ -18,13 +18,19 @@ desc "Build a gem"
18
18
  task :gem => [ :gemspec, :build ]
19
19
 
20
20
  desc "Build standalone script"
21
- task :standalone => [ :test, :load_hub ] do
21
+ task :standalone => :load_hub do
22
+ require 'hub/standalone'
22
23
  Hub::Standalone.save('hub')
23
24
  end
24
25
 
25
26
  desc "Build hub manual"
26
- task 'man' do
27
- sh "ron -br5 -m --organization=DEFUNKT --manual='Git Manual' man/*.ron"
27
+ task :build_man do
28
+ sh "ron -br5 --organization=DEFUNKT --manual='Git Manual' man/*.ron"
29
+ end
30
+
31
+ desc "Show hub manual"
32
+ task :man => :build_man do
33
+ exec "man man/hub.1"
28
34
  end
29
35
 
30
36
  task :load_hub do
@@ -71,6 +77,27 @@ rescue LoadError
71
77
  puts "Install it with: gem install jeweler"
72
78
  end
73
79
 
80
+
81
+ Rake::TaskManager.class_eval do
82
+ def remove_task(task_name)
83
+ @tasks.delete(task_name.to_s)
84
+ end
85
+ end
86
+
87
+ # Remove jewelers install task
88
+ Rake.application.remove_task(:install)
89
+
90
+ desc "Install standalone script and man pages"
91
+ task :install => :standalone do
92
+ prefix = ENV['PREFIX'] || ENV['prefix'] || '/usr/local'
93
+
94
+ FileUtils.mkdir_p "#{prefix}/bin"
95
+ FileUtils.cp "hub", "#{prefix}/bin"
96
+
97
+ FileUtils.mkdir_p "#{prefix}/share/man/man1"
98
+ FileUtils.cp "man/hub.1", "#{prefix}/share/man/man1"
99
+ end
100
+
74
101
  desc "Push a new version to Gemcutter"
75
102
  task :publish => [ :test, :gemspec, :build ] do
76
103
  system "git tag v#{Hub::Version}"
@@ -82,10 +109,13 @@ task :publish => [ :test, :gemspec, :build ] do
82
109
  end
83
110
 
84
111
  desc "Publish to GitHub Pages"
85
- task :pages => [ :check_dirty, :standalone ] do
112
+ task :pages => [ :build_man, :check_dirty, :standalone ] do
113
+ cp "man/hub.1.html", "html"
86
114
  `git checkout gh-pages`
87
115
  `mv hub standalone`
88
116
  `git add standalone*`
117
+ `mv html hub.1.html`
118
+ `git add hub.1.html`
89
119
  `git commit -m "update standalone"`
90
120
  `git push origin gh-pages`
91
121
  `git checkout master`
data/lib/hub/commands.rb CHANGED
@@ -162,35 +162,37 @@ usage: git [--version] [--exec-path[=GIT_EXEC_PATH]] [--html-path]
162
162
  [-p|--paginate|--no-pager] [--bare] [--git-dir=GIT_DIR]
163
163
  [--work-tree=GIT_WORK_TREE] [--help] COMMAND [ARGS]
164
164
 
165
- Creating a git repository:
166
- clone Clone a repository into a new directory
165
+ Basic Commands:
167
166
  init Create an empty git repository or reinitialize an existing one
168
-
169
- Working with content:
170
- add Add file contents to the index
171
- branch List, create, or delete branches
172
- checkout Checkout a branch or paths to the working tree
167
+ add Add new or modified files to the staging area
168
+ rm Remove files from the working directory and staging area
169
+ mv Move or rename a file, a directory, or a symlink
170
+ status Show the status of the working directory and staging area
173
171
  commit Record changes to the repository
172
+
173
+ History Commands:
174
+ log Show the commit history log
174
175
  diff Show changes between commits, commit and working tree, etc
175
- log Show commit logs
176
- merge Join two or more development histories together
177
- mv Move or rename a file, a directory, or a symlink
178
- rm Remove files from the working tree and from the index
179
- status Show the working tree status
180
- show Show various types of objects
181
- tag Create, list, delete or verify a tag object signed with GPG
176
+ show Show information about commits, tags or files
177
+
178
+ Branching Commands:
179
+ branch List, create, or delete branches
180
+ checkout Switch the active branch to another branch
181
+ merge Join two or more development histories (branches) together
182
+ tag Create, list, delete, sign or verify a tag object
182
183
 
183
- Over the network:
184
- fetch Download objects and refs from another repository
184
+ Remote Commands:
185
+ clone Clone a remote repository into a new directory
186
+ fetch Download data, tags and branches from a remote repository
185
187
  pull Fetch from and merge with another repository or a local branch
186
- push Update remote refs along with associated objects
187
- remote Manage a set of tracked repositories
188
+ push Upload data, tags and branches to a remote repository
189
+ remote View and manage a set of remote repositories
188
190
 
189
191
  Advanced commands:
192
+ reset Reset your staging area or working directory to another point
193
+ rebase Re-apply a series of patches in one branch onto another
190
194
  bisect Find by binary search the change that introduced a bug
191
- grep Print lines matching a pattern
192
- reset Reset current HEAD to the specified state
193
- rebase Forward-port local commits to the updated upstream head
195
+ grep Print files with lines matching a pattern in your codebase
194
196
 
195
197
  See 'git help COMMAND' for more information on a specific command.
196
198
  help
@@ -2,7 +2,7 @@ module Hub
2
2
  module Standalone
3
3
  extend self
4
4
 
5
- PREAMBLE = <<-premable
5
+ PREAMBLE = <<-preamble
6
6
  #!/usr/bin/env ruby
7
7
  #
8
8
  # This file, hub, is generated code.
@@ -14,10 +14,11 @@ module Hub
14
14
  # that build hub.
15
15
  #
16
16
 
17
- premable
17
+ preamble
18
18
 
19
19
  POSTAMBLE = "Hub::Runner.execute(*ARGV)\n"
20
- MANPAGE = "__END__\n#{File.read('man/hub.1')}"
20
+ __DIR__ = File.dirname(__FILE__)
21
+ MANPAGE = "__END__\n#{File.read(__DIR__ + '/../../man/hub.1')}"
21
22
 
22
23
  def save(filename, path = '.')
23
24
  target = File.join(File.expand_path(path), filename)
data/lib/hub/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Hub
2
- Version = '0.1.2'
2
+ Version = '0.1.3'
3
3
  end
data/lib/hub.rb CHANGED
@@ -2,4 +2,3 @@ require 'hub/version'
2
2
  require 'hub/args'
3
3
  require 'hub/commands'
4
4
  require 'hub/runner'
5
- require 'hub/standalone'
data/man/hub.1 CHANGED
@@ -16,11 +16,13 @@
16
16
  \fBgit init \-g\fR \fIOPTIONS\fR
17
17
  .
18
18
  .br
19
- \fBgit clone\fR [\fB\-p\fR] \fIOPTIONS\fR \fIUSER\fR[/\fIREPOSITORY\fR] \fIDIRECTORY\fR
19
+ \fBgit clone\fR [\fB\-p\fR] \fIOPTIONS\fR [\fIUSER\fR/]\fIREPOSITORY\fR \fIDIRECTORY\fR
20
20
  .
21
21
  .br
22
22
  \fBgit remote add\fR [\fB\-p\fR] \fIOPTIONS\fR \fIUSER\fR[/\fIREPOSITORY\fR]
23
23
  .
24
+ .br
25
+ .
24
26
  .SH "DESCRIPTION"
25
27
  \fBhub\fR enhances various \fBgit\fR commands with GitHub remote expansion. The
26
28
  alias command displays information on configuring your environment:
@@ -39,10 +41,10 @@ Create a git repository as with git\-init(1) and add remote \fBorigin\fR at
39
41
  "git@github.com:\fIUSER\fR/\fIREPOSITORY\fR.git"; \fIUSER\fR is your GitHub username and \fIREPOSITORY\fR is the current working directory's basename.
40
42
  .
41
43
  .TP
42
- \fBgit clone\fR [\fB\-p\fR] \fIOPTIONS\fR \fIUSER\fR[\fB/\fR\fIREPOSITORY\fR] \fIDIRECTORY\fR
43
- Clone repository "git://github.com/\fIUSER\fR/\fIREPOSITORY\fR.git" into \fIDIRECTORY\fR as with git\-clone(1). When /\fIREPOSITORY\fR is omitted, the
44
- basename of the current working directory is used. With \fB\-p\fR, use private
45
- remote "git@github.com:\fIUSER\fR/\fIREPOSITORY\fR.git".
44
+ \fBgit clone\fR [\fB\-p\fR] \fIOPTIONS\fR [\fIUSER\fR\fB/\fR]\fIREPOSITORY\fR \fIDIRECTORY\fR
45
+ Clone repository "git://github.com/\fIUSER\fR/\fIREPOSITORY\fR.git" into \fIDIRECTORY\fR as with git\-clone(1). When \fIUSER\fR/ is omitted, assumes
46
+ your GitHub login. With \fB\-p\fR, use private remote
47
+ "git@github.com:\fIUSER\fR/\fIREPOSITORY\fR.git".
46
48
  .
47
49
  .TP
48
50
  \fBgit remote add\fR [\fB\-p\fR] \fIOPTIONS\fR \fIUSER\fR[\fB/\fR\fIREPOSITORY\fR]
data/man/hub.1.html ADDED
@@ -0,0 +1,157 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv='content-type' value='text/html;charset=utf8'>
5
+ <meta name='generator' value='Ron/v0.3'>
6
+ <title>hub(1) -- git + hub = github</title>
7
+ <style type='text/css'>
8
+ body {margin:0}
9
+ #man, #man code, #man pre, #man tt, #man kbd, #man samp {
10
+ font-family:consolas,monospace;
11
+ font-size:16px;
12
+ line-height:1.3;
13
+ color:#343331;
14
+ background:#fff; }
15
+ #man { max-width:89ex; text-align:justify; margin:0 25px 25px 25px }
16
+ #man h1, #man h2, #man h3 { color:#232221;clear:left }
17
+ #man h1 { font-size:28px; margin:15px 0 30px 0; text-align:center }
18
+ #man h2 { font-size:18px; margin-bottom:0; margin-top:10px; line-height:1.3; }
19
+ #man h3 { font-size:16px; margin:0 0 0 4ex; }
20
+ #man p, #man ul, #man ol, #man dl, #man pre { margin:0 0 18px 0; }
21
+ #man pre {
22
+ color:#333231;
23
+ background:#edeceb;
24
+ padding:5px 7px;
25
+ margin:0px 0 20px 0;
26
+ border-left:2ex solid #ddd}
27
+ #man pre + h2, #man pre + h3 {
28
+ margin-top:22px;
29
+ }
30
+ #man h2 + pre, #man h3 + pre {
31
+ margin-top:5px;
32
+ }
33
+ #man > p, #man > ul, #man > ol, #man > dl, #man > pre { margin-left:8ex; }
34
+ #man dt { margin:0; clear:left }
35
+ #man dt.flush { float:left; width:8ex }
36
+ #man dd { margin:0 0 0 9ex }
37
+ #man code, #man strong, #man b { font-weight:bold; color:#131211; }
38
+ #man pre code { font-weight:normal; color:#232221; background:inherit }
39
+ #man em, var, u {
40
+ font-style:normal; color:#333231; border-bottom:1px solid #999; }
41
+ #man h1.man-title { display:none; }
42
+ #man ol.man, #man ol.man li { margin:2px 0 10px 0; padding:0;
43
+ float:left; width:33%; list-style-type:none;
44
+ text-transform:uppercase; font-size:18px; color:#999;
45
+ letter-spacing:1px;}
46
+ #man ol.man { width:100%; }
47
+ #man ol.man li.tl { text-align:left }
48
+ #man ol.man li.tc { text-align:center;letter-spacing:4px }
49
+ #man ol.man li.tr { text-align:right }
50
+ #man ol.man a { color:#999 }
51
+ #man ol.man a:hover { color:#333231 }
52
+ </style>
53
+ </head>
54
+ <body>
55
+ <div id='man'>
56
+
57
+ <h1 class='man-title'>hub(1)</h1>
58
+
59
+ <ol class='head man'>
60
+ <li class='tl'>hub(1)</li>
61
+ <li class='tc'>Git Manual</li>
62
+ <li class='tr'>hub(1)</li>
63
+ </ol>
64
+
65
+ <h2 id='NAME'>NAME</h2>
66
+ <p><code>hub</code> -- git + hub = github</p>
67
+ <h2>SYNOPSIS</h2>
68
+
69
+ <p><code>hub</code> <var>COMMAND</var> <var>OPTIONS</var><br>
70
+ <code>hub alias</code> [<code>-s</code>] <var>SHELL</var></p>
71
+
72
+ <p><code>git init -g</code> <var>OPTIONS</var><br>
73
+ <code>git clone</code> [<code>-p</code>] <var>OPTIONS</var> [<var>USER</var>/]<var>REPOSITORY</var> <var>DIRECTORY</var><br>
74
+ <code>git remote add</code> [<code>-p</code>] <var>OPTIONS</var> <var>USER</var>[/<var>REPOSITORY</var>]<br>
75
+ </p>
76
+
77
+ <h2>DESCRIPTION</h2>
78
+
79
+ <p><code>hub</code> enhances various <code>git</code> commands with GitHub remote expansion. The
80
+ alias command displays information on configuring your environment:</p>
81
+
82
+ <dl>
83
+ <dt>
84
+ <code>hub alias</code> [<code>-s</code>] <var>SHELL</var>
85
+ </dt>
86
+ <dd>Writes shell aliasing code for <var>SHELL</var> (<code>bash</code>, <code>sh</code>, <code>zsh</code>,
87
+ <code>csh</code>) to standard output. With the <code>-s</code> option, the output of
88
+ this command can be evaluated directly within the shell:
89
+ <code>eval $(hub alias -s bash)</code>
90
+ </dd>
91
+ </dl>
92
+
93
+
94
+ <p>After configuring the alias, the following commands have superpowers:</p>
95
+
96
+ <dl>
97
+ <dt>
98
+ <code>git init</code> <code>-g</code> <var>OPTIONS</var>
99
+ </dt>
100
+ <dd><p>Create a git repository as with git-init(1) and add remote <code>origin</code> at
101
+ "git@github.com:<var>USER</var>/<var>REPOSITORY</var>.git"; <var>USER</var> is your GitHub username and
102
+ <var>REPOSITORY</var> is the current working directory's basename.</p></dd>
103
+ <dt>
104
+ <code>git clone</code> [<code>-p</code>] <var>OPTIONS</var> [<var>USER</var><code>/</code>]<var>REPOSITORY</var> <var>DIRECTORY</var>
105
+ </dt>
106
+ <dd><p>Clone repository "git://github.com/<var>USER</var>/<var>REPOSITORY</var>.git" into
107
+ <var>DIRECTORY</var> as with git-clone(1). When <var>USER</var>/ is omitted, assumes
108
+ your GitHub login. With <code>-p</code>, use private remote
109
+ "git@github.com:<var>USER</var>/<var>REPOSITORY</var>.git".</p></dd>
110
+ <dt>
111
+ <code>git remote add</code> [<code>-p</code>] <var>OPTIONS</var> <var>USER</var>[<code>/</code><var>REPOSITORY</var>]</dt>
112
+ <dd><p>Add remote "git://github.com/<var>USER</var>/<var>REPOSITORY</var>.git" as with
113
+ git-remote(1). When /<var>REPOSITORY</var> is omitted, the basename of the
114
+ current working directory is used. With <code>-p</code>, use private remote
115
+ "git@github.com:<var>USER</var>/<var>REPOSITORY</var>.git".</p></dd>
116
+ <dt><code>git help</code></dt>
117
+ <dd><p>Display enhanced git-help(1).</p></dd>
118
+ </dl>
119
+
120
+
121
+ <h2>CONFIGURATION</h2>
122
+
123
+ <p>Use git-config(1) to display the currently configured GitHub username:</p>
124
+
125
+ <pre><code>$ git config --global github.user
126
+ </code></pre>
127
+
128
+ <p>Or, set the GitHub username with:</p>
129
+
130
+ <pre><code>$ git config --global github.user &lt;username&gt;
131
+ </code></pre>
132
+
133
+ <p>See <a href="http://github.com/guides/local-github-config">http://github.com/guides/local-github-config</a> for more information.</p>
134
+
135
+ <h2>BUGS</h2>
136
+
137
+ <p><a href="http://github.com/defunkt/hub/issues">http://github.com/defunkt/hub/issues</a></p>
138
+
139
+ <h2>AUTHOR</h2>
140
+
141
+ <p>Chris Wanstrath :: chris@ozmm.org :: @defunkt</p>
142
+
143
+ <h2>SEE ALSO</h2>
144
+
145
+ <p>git(1), git-clone(1), git-remote(1), git-init(1),
146
+ <a href="http://github.com">http://github.com</a>,
147
+ <a href="http://github.com/defunkt/hub">http://github.com/defunkt/hub</a></p>
148
+
149
+ <ol class='foot man'>
150
+ <li class='tl'>DEFUNKT</li>
151
+ <li class='tc'>December 2009</li>
152
+ <li class='tr'>hub(1)</li>
153
+ </ol>
154
+
155
+ </div>
156
+ </body>
157
+ </html>
data/man/hub.1.ron CHANGED
@@ -7,8 +7,8 @@ hub(1) -- git + hub = github
7
7
  `hub alias` [`-s`] <SHELL>
8
8
 
9
9
  `git init -g` <OPTIONS>
10
- `git clone` [`-p`] <OPTIONS> <USER>[/<REPOSITORY>] <DIRECTORY>
11
- `git remote add` [`-p`] <OPTIONS> <USER>[/<REPOSITORY>]
10
+ `git clone` [`-p`] <OPTIONS> [<USER>/]<REPOSITORY> <DIRECTORY>
11
+ `git remote add` [`-p`] <OPTIONS> <USER>[/<REPOSITORY>]
12
12
 
13
13
  ## DESCRIPTION
14
14
 
@@ -28,11 +28,11 @@ After configuring the alias, the following commands have superpowers:
28
28
  "git@github.com:<USER>/<REPOSITORY>.git"; <USER> is your GitHub username and
29
29
  <REPOSITORY> is the current working directory's basename.
30
30
 
31
- * `git clone` [`-p`] <OPTIONS> <USER>[`/`<REPOSITORY>] <DIRECTORY>:
31
+ * `git clone` [`-p`] <OPTIONS> [<USER>`/`]<REPOSITORY> <DIRECTORY>:
32
32
  Clone repository "git://github.com/<USER>/<REPOSITORY>.git" into
33
- <DIRECTORY> as with git-clone(1). When /<REPOSITORY> is omitted, the
34
- basename of the current working directory is used. With `-p`, use private
35
- remote "git@github.com:<USER>/<REPOSITORY>.git".
33
+ <DIRECTORY> as with git-clone(1). When <USER>/ is omitted, assumes
34
+ your GitHub login. With `-p`, use private remote
35
+ "git@github.com:<USER>/<REPOSITORY>.git".
36
36
 
37
37
  * `git remote add` [`-p`] <OPTIONS> <USER>[`/`<REPOSITORY>]:
38
38
  Add remote "git://github.com/<USER>/<REPOSITORY>.git" as with
data/test/helper.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'test/unit'
2
2
  $LOAD_PATH.unshift File.dirname(__FILE__) + '/../lib'
3
3
  require 'hub'
4
+ require 'hub/standalone'
4
5
 
5
6
  class Test::Unit::TestCase
6
7
  # Shortcut for creating a `Hub` instance. Pass it what you would
data/test/hub_test.rb CHANGED
@@ -101,7 +101,7 @@ class HubTest < Test::Unit::TestCase
101
101
  def test_help_hub
102
102
  help_manpage = hub("help hub")
103
103
  assert_includes "git + hub = github", help_manpage
104
- assert_includes "Writes shell aliasing code for", help_manpage
104
+ assert_includes "Writes shell aliasing code", help_manpage
105
105
  assert_includes "Chris Wanstrath :: chris@ozmm.org", help_manpage
106
106
  assert_includes <<-config, help_manpage
107
107
  Use git-config(1) to display the currently configured GitHub username:
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: git-hub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Wanstrath
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-12-10 00:00:00 -08:00
12
+ date: 2009-12-11 00:00:00 -08:00
13
13
  default_executable: hub
14
14
  dependencies: []
15
15
 
@@ -37,6 +37,7 @@ files:
37
37
  - lib/hub/standalone.rb
38
38
  - lib/hub/version.rb
39
39
  - man/hub.1
40
+ - man/hub.1.html
40
41
  - man/hub.1.ron
41
42
  - test/alias_test.rb
42
43
  - test/helper.rb