git_autocomplete 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +5 -1
- data/README.txt +7 -1
- data/lib/git_autocomplete/command.rb +1 -1
- data/lib/git_autocomplete/version.rb +1 -1
- data/test/test_command.rb +5 -0
- data/website/index.html +31 -11
- data/website/index.txt +24 -11
- data/website/stylesheets/screen.css +1 -1
- metadata +2 -2
data/History.txt
CHANGED
data/README.txt
CHANGED
@@ -3,10 +3,16 @@ Contains a git CLI autocompletion script for bash users.
|
|
3
3
|
Currently, it autocompletes on local branch names for checkout cmds.
|
4
4
|
|
5
5
|
In the following, the 'mas' would autocomplete to 'master' in most cases:
|
6
|
-
* git checkout mas
|
6
|
+
* git checkout mas
|
7
|
+
* git-checkout mas
|
7
8
|
* git co mas
|
8
9
|
* gco mas
|
9
10
|
|
11
|
+
This is a work-in-progress. I'd like it to also autocomplete
|
12
|
+
on git commands, like <code>git brTAB</code> --> <code>git branch</code>,
|
13
|
+
but this is less important since you can autocomplete already
|
14
|
+
on <code>git-br</code>.
|
15
|
+
|
10
16
|
INSTALLATION
|
11
17
|
|
12
18
|
* Install ruby + the rubygems package system
|
@@ -18,7 +18,7 @@ module GitAutocomplete
|
|
18
18
|
# Returns the +after_match+ string, if the prefix of the +cmd_str+
|
19
19
|
# is a valid command that expects a branch name.
|
20
20
|
def branch_completion?(cmd_str)
|
21
|
-
valid_cmds = ['git checkout', 'git co', 'gco']
|
21
|
+
valid_cmds = ['git checkout', 'git-checkout', 'git co', 'gco', 'git merge', 'git-merge', 'git diff', 'git-diff']
|
22
22
|
valid_cmds_str = valid_cmds.join('|')
|
23
23
|
return nil unless /^(#{valid_cmds_str})\b/ =~ cmd_str
|
24
24
|
$'.strip # after_match
|
data/test/test_command.rb
CHANGED
@@ -27,6 +27,11 @@ class TestCommand < Test::Unit::TestCase
|
|
27
27
|
|
28
28
|
def test_supported_branch_cmd_names
|
29
29
|
assert_equal("mas", @command.branch_completion?("git checkout mas"), "Should be autocompletion for branches")
|
30
|
+
assert_equal("mas", @command.branch_completion?("git-checkout mas"), "Should be autocompletion for branches")
|
31
|
+
assert_equal("mas", @command.branch_completion?("git merge mas"), "Should be autocompletion for branches")
|
32
|
+
assert_equal("mas", @command.branch_completion?("git-merge mas"), "Should be autocompletion for branches")
|
33
|
+
assert_equal("mas", @command.branch_completion?("git diff mas"), "Should be autocompletion for branches")
|
34
|
+
assert_equal("mas", @command.branch_completion?("git-diff mas"), "Should be autocompletion for branches")
|
30
35
|
assert_equal("mas", @command.branch_completion?("git co mas"), "Should be autocompletion for branches")
|
31
36
|
assert_equal("mas", @command.branch_completion?("gco mas"), "Should be autocompletion for branches")
|
32
37
|
assert_equal("origin/mas", @command.branch_completion?("gco origin/mas"), "Should be autocompletion for branches")
|
data/website/index.html
CHANGED
@@ -33,33 +33,53 @@
|
|
33
33
|
<h1>git_autocomplete</h1>
|
34
34
|
<div id="version" class="clickable" onclick='document.location = "http://rubyforge.org/projects/git_autocomplete"; return false'>
|
35
35
|
<p>Get Version</p>
|
36
|
-
<a href="http://rubyforge.org/projects/git_autocomplete" class="numbers">0.
|
36
|
+
<a href="http://rubyforge.org/projects/git_autocomplete" class="numbers">0.2.0</a>
|
37
37
|
</div>
|
38
|
-
<h1>→
|
38
|
+
<h1>→ Git autocompletion for Bash</h1>
|
39
39
|
|
40
40
|
|
41
41
|
<h2>What</h2>
|
42
42
|
|
43
43
|
|
44
|
-
<
|
44
|
+
<p>Contains a git <span class="caps">CLI</span> autocompletion script for bash users.</p>
|
45
45
|
|
46
46
|
|
47
|
-
<p
|
47
|
+
<p>Currently, it autocompletes on local branch names for checkout cmds.</p>
|
48
48
|
|
49
49
|
|
50
|
-
|
50
|
+
In the following, the ‘mas’ would autocomplete to ‘master’ in most cases:
|
51
|
+
<ul>
|
52
|
+
<li>git checkout mas</li>
|
53
|
+
<li>git-checkout mas</li>
|
54
|
+
<li>git co mas</li>
|
55
|
+
<li>gco mas</li>
|
56
|
+
</ul>
|
51
57
|
|
52
58
|
|
53
|
-
<
|
59
|
+
<p>This is a work-in-progress. I’d like it to also autocomplete
|
60
|
+
on git commands, like <code>git brTAB</code>—> <code>git branch</code>,
|
61
|
+
but this is less important since you can autocomplete already
|
62
|
+
on <code>git-br</code>.</p>
|
54
63
|
|
55
64
|
|
56
|
-
<h2>
|
65
|
+
<h2>Installing</h2>
|
66
|
+
|
57
67
|
|
68
|
+
<p>To use this project, you’ll need to have ruby + the rubygems package system installed.</p>
|
58
69
|
|
59
|
-
|
70
|
+
|
71
|
+
<pre>sudo gem install git_autocomplete</pre>
|
72
|
+
|
73
|
+
To your ~/.bashrc (etc), add:
|
74
|
+
<pre>
|
75
|
+
complete -C git_autocomplete -o default git
|
76
|
+
complete -C git_autocomplete -o default gco
|
77
|
+
</pre>
|
78
|
+
|
79
|
+
<h2>Forum</h2>
|
60
80
|
|
61
81
|
|
62
|
-
<p><
|
82
|
+
<p><a href="http://groups.google.com/group/drnicutilities">http://groups.google.com/group/drnicutilities</a></p>
|
63
83
|
|
64
84
|
|
65
85
|
<h2>How to submit patches</h2>
|
@@ -68,7 +88,7 @@
|
|
68
88
|
<p>Read the <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/">8 steps for fixing other people’s code</a> and for section <a href="http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups">8b: Submit patch to Google Groups</a>, use the Google Group above.</p>
|
69
89
|
|
70
90
|
|
71
|
-
<p>
|
91
|
+
<p>Access the source via git <code>http://github.com/drnic/git_autocompletion/tree/master</code></p>
|
72
92
|
|
73
93
|
|
74
94
|
<h2>License</h2>
|
@@ -80,7 +100,7 @@
|
|
80
100
|
<h2>Contact</h2>
|
81
101
|
|
82
102
|
|
83
|
-
<p>Comments are welcome. Send an email to <a href="mailto:drnicwilliams@gmail.com">Dr Nic Williams</a> via the <a href="http://groups.google.com/group/
|
103
|
+
<p>Comments are welcome. Send an email to <a href="mailto:drnicwilliams@gmail.com">Dr Nic Williams</a> via the <a href="http://groups.google.com/group/drnicutilities">forum</a></p>
|
84
104
|
<p class="coda">
|
85
105
|
<a href="drnicwilliams@gmail.com">Dr Nic Williams</a>, 5th February 2008<br>
|
86
106
|
Theme extended from <a href="http://rb2js.rubyforge.org/">Paul Battley</a>
|
data/website/index.txt
CHANGED
@@ -1,33 +1,46 @@
|
|
1
1
|
h1. git_autocomplete
|
2
2
|
|
3
|
-
h1. →
|
4
|
-
|
3
|
+
h1. → Git autocompletion for Bash
|
5
4
|
|
6
5
|
h2. What
|
7
6
|
|
7
|
+
Contains a git CLI autocompletion script for bash users.
|
8
8
|
|
9
|
-
|
9
|
+
Currently, it autocompletes on local branch names for checkout cmds.
|
10
10
|
|
11
|
-
|
11
|
+
In the following, the 'mas' would autocomplete to 'master' in most cases:
|
12
|
+
* git checkout mas
|
13
|
+
* git-checkout mas
|
14
|
+
* git co mas
|
15
|
+
* gco mas
|
12
16
|
|
13
|
-
|
17
|
+
This is a work-in-progress. I'd like it to also autocomplete
|
18
|
+
on git commands, like <code>git brTAB</code> --> <code>git branch</code>,
|
19
|
+
but this is less important since you can autocomplete already
|
20
|
+
on <code>git-br</code>.
|
14
21
|
|
22
|
+
h2. Installing
|
15
23
|
|
16
|
-
|
24
|
+
To use this project, you'll need to have ruby + the rubygems package system installed.
|
17
25
|
|
26
|
+
<pre>sudo gem install git_autocomplete</pre>
|
18
27
|
|
28
|
+
To your ~/.bashrc (etc), add:
|
29
|
+
<pre>
|
30
|
+
complete -C git_autocomplete -o default git
|
31
|
+
complete -C git_autocomplete -o default gco
|
32
|
+
</pre>
|
19
33
|
|
20
|
-
h2. Forum
|
21
34
|
|
22
|
-
|
35
|
+
h2. Forum
|
23
36
|
|
24
|
-
|
37
|
+
"http://groups.google.com/group/drnicutilities":http://groups.google.com/group/drnicutilities
|
25
38
|
|
26
39
|
h2. How to submit patches
|
27
40
|
|
28
41
|
Read the "8 steps for fixing other people's code":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/ and for section "8b: Submit patch to Google Groups":http://drnicwilliams.com/2007/06/01/8-steps-for-fixing-other-peoples-code/#8b-google-groups, use the Google Group above.
|
29
42
|
|
30
|
-
|
43
|
+
Access the source via git <code>http://github.com/drnic/git_autocompletion/tree/master</code>
|
31
44
|
|
32
45
|
h2. License
|
33
46
|
|
@@ -35,5 +48,5 @@ This code is free to use under the terms of the MIT license.
|
|
35
48
|
|
36
49
|
h2. Contact
|
37
50
|
|
38
|
-
Comments are welcome. Send an email to "Dr Nic Williams":mailto:drnicwilliams@gmail.com via the "forum":http://groups.google.com/group/
|
51
|
+
Comments are welcome. Send an email to "Dr Nic Williams":mailto:drnicwilliams@gmail.com via the "forum":http://groups.google.com/group/drnicutilities
|
39
52
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: git_autocomplete
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dr Nic Williams
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-02-
|
12
|
+
date: 2008-02-07 00:00:00 +10:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|