legit 0.0.6 → 0.0.7
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.
- data/README.md +11 -1
- data/legit.gemspec +1 -1
- data/lib/legit/version.rb +1 -1
- data/lib/legit.rb +12 -5
- data/lib/legit_helper.rb +5 -0
- metadata +73 -93
data/README.md
CHANGED
@@ -1,4 +1,8 @@
|
|
1
|
-
# Legit
|
1
|
+
# Legit
|
2
|
+
|
3
|
+
[](http://badge.fury.io/rb/legit)
|
4
|
+
[](https://gemnasium.com/dillonkearns/legit)
|
5
|
+
[](https://codeclimate.com/github/dillonkearns/dotfile-linker)
|
2
6
|
|
3
7
|
## Installation
|
4
8
|
```bash
|
@@ -22,6 +26,12 @@ legit catch-todos TODO
|
|
22
26
|
chmod +x .git/hooks/pre-commit
|
23
27
|
```
|
24
28
|
|
29
|
+
Enable or disable catch-todos with the `--enable` and `--disable` options
|
30
|
+
```
|
31
|
+
legit catch-todos --disable # will not check todos until re-enabled
|
32
|
+
legit catch-todos --enable # sets it back to normal
|
33
|
+
```
|
34
|
+
|
25
35
|
Note: if you use a graphical git tool (such as [SourceTree](http://http://www.sourcetreeapp.com/) for OS X), you may need read the following:
|
26
36
|
|
27
37
|
RVM and similar tools do store executables in custom locations instead of the standard locations for executables such as `/usr/bin`. Since your `.bash_profile` (or similar) might not be executed by your GUI tool, you may need to create a symlink to legit in a location that is in the tool's default path. `/usr/bin` is usually included, so this should do:
|
data/legit.gemspec
CHANGED
@@ -19,5 +19,5 @@ Gem::Specification.new do |gem|
|
|
19
19
|
gem.add_development_dependency "rake", "~> 10.0.3"
|
20
20
|
gem.add_runtime_dependency "colorize", "~> 0.5.8"
|
21
21
|
gem.add_runtime_dependency "thor", "~> 0.17.0"
|
22
|
-
gem.add_runtime_dependency "rugged", "0.17.0.b7"
|
22
|
+
gem.add_runtime_dependency "rugged", "0.17.0.b7" # need version 0.17 for a bug accessing Rugged::Repo.config in 0.16
|
23
23
|
end
|
data/lib/legit/version.rb
CHANGED
data/lib/legit.rb
CHANGED
@@ -12,11 +12,10 @@ class Legit < Thor
|
|
12
12
|
command << arg
|
13
13
|
end
|
14
14
|
|
15
|
-
|
15
|
+
run_command(command.join(' '))
|
16
16
|
end
|
17
17
|
|
18
18
|
desc "catch-todos [TODO_FORMAT]", "Abort commit if any todos in TODO_FORMAT found"
|
19
|
-
method_option :warn, :type => :boolean, :aliases => "-w", :desc => 'Warn and prompt the user to choose whether to abort the commit'
|
20
19
|
method_option :enable, :type => :boolean, :desc => 'Enable todo checking'
|
21
20
|
method_option :disable, :type => :boolean, :desc => 'Disable todo checking'
|
22
21
|
def catch_todos(todo_format = "TODO")
|
@@ -33,16 +32,24 @@ class Legit < Thor
|
|
33
32
|
end
|
34
33
|
end
|
35
34
|
|
35
|
+
desc "bisect BAD GOOD COMMAND", "Find the first bad commit by running COMMAND, using GOOD and BAD as the first known good and bad commits"
|
36
|
+
def bisect(bad, good, *command_args)
|
37
|
+
command = command_args.join(' ')
|
38
|
+
run_command("git bisect start #{bad} #{good}")
|
39
|
+
run_command("git bisect run #{command}")
|
40
|
+
run_command("git bisect reset")
|
41
|
+
end
|
42
|
+
|
36
43
|
desc "delete BRANCH", "Delete BRANCH both locally and remotely"
|
37
44
|
def delete(branch_name)
|
38
|
-
|
45
|
+
run_command("git branch -d #{branch_name}")
|
39
46
|
|
40
47
|
if $?.success?
|
41
48
|
delete_remote_branch(branch_name)
|
42
49
|
else
|
43
50
|
show("Force delete branch #{branch_name}? (y/n)", :warning)
|
44
51
|
if STDIN.gets.chomp =~ /^y/
|
45
|
-
|
52
|
+
run_command("git branch -D #{branch_name}")
|
46
53
|
delete_remote_branch(branch_name)
|
47
54
|
else
|
48
55
|
puts "Abort. #{branch_name} not deleted"
|
@@ -56,7 +63,7 @@ class Legit < Thor
|
|
56
63
|
end
|
57
64
|
|
58
65
|
def run_catch_todos(todo_format)
|
59
|
-
|
66
|
+
run_command("git diff --staged | grep '^+' | grep #{todo_format}")
|
60
67
|
|
61
68
|
if $?.success?
|
62
69
|
if options[:warn]
|
data/lib/legit_helper.rb
CHANGED
metadata
CHANGED
@@ -1,99 +1,89 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: legit
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.7
|
5
5
|
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 0
|
9
|
-
- 6
|
10
|
-
version: 0.0.6
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Dillon Kearns
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
version_requirements: &id001 !ruby/object:Gem::Requirement
|
12
|
+
date: 2013-02-19 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: rake
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
23
17
|
none: false
|
24
|
-
requirements:
|
18
|
+
requirements:
|
25
19
|
- - ~>
|
26
|
-
- !ruby/object:Gem::Version
|
27
|
-
hash: 73
|
28
|
-
segments:
|
29
|
-
- 10
|
30
|
-
- 0
|
31
|
-
- 3
|
20
|
+
- !ruby/object:Gem::Version
|
32
21
|
version: 10.0.3
|
33
|
-
requirement: *id001
|
34
|
-
prerelease: false
|
35
|
-
name: rake
|
36
22
|
type: :development
|
37
|
-
|
38
|
-
version_requirements:
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
39
25
|
none: false
|
40
|
-
requirements:
|
26
|
+
requirements:
|
41
27
|
- - ~>
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
|
44
|
-
|
45
|
-
- 0
|
46
|
-
- 5
|
47
|
-
- 8
|
48
|
-
version: 0.5.8
|
49
|
-
requirement: *id002
|
50
|
-
prerelease: false
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: 10.0.3
|
30
|
+
- !ruby/object:Gem::Dependency
|
51
31
|
name: colorize
|
52
|
-
|
53
|
-
- !ruby/object:Gem::Dependency
|
54
|
-
version_requirements: &id003 !ruby/object:Gem::Requirement
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
55
33
|
none: false
|
56
|
-
requirements:
|
34
|
+
requirements:
|
57
35
|
- - ~>
|
58
|
-
- !ruby/object:Gem::Version
|
59
|
-
|
60
|
-
|
61
|
-
- 0
|
62
|
-
- 17
|
63
|
-
- 0
|
64
|
-
version: 0.17.0
|
65
|
-
requirement: *id003
|
36
|
+
- !ruby/object:Gem::Version
|
37
|
+
version: 0.5.8
|
38
|
+
type: :runtime
|
66
39
|
prerelease: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ~>
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: 0.5.8
|
46
|
+
- !ruby/object:Gem::Dependency
|
67
47
|
name: thor
|
68
|
-
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
version_requirements: &id004 !ruby/object:Gem::Requirement
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
71
49
|
none: false
|
72
|
-
requirements:
|
73
|
-
- -
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
|
76
|
-
|
77
|
-
- 0
|
78
|
-
- 17
|
79
|
-
- 0
|
80
|
-
- b
|
81
|
-
- 7
|
82
|
-
version: 0.17.0.b7
|
83
|
-
requirement: *id004
|
50
|
+
requirements:
|
51
|
+
- - ~>
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: 0.17.0
|
54
|
+
type: :runtime
|
84
55
|
prerelease: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ~>
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: 0.17.0
|
62
|
+
- !ruby/object:Gem::Dependency
|
85
63
|
name: rugged
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
65
|
+
none: false
|
66
|
+
requirements:
|
67
|
+
- - '='
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 0.17.0.b7
|
86
70
|
type: :runtime
|
87
|
-
|
88
|
-
|
71
|
+
prerelease: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - '='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: 0.17.0.b7
|
78
|
+
description: A collection of scripts for common git tasks to simplify and improve
|
79
|
+
workflow.
|
80
|
+
email:
|
89
81
|
- dillon@dillonkearns.com
|
90
|
-
executables:
|
82
|
+
executables:
|
91
83
|
- legit
|
92
84
|
extensions: []
|
93
|
-
|
94
85
|
extra_rdoc_files: []
|
95
|
-
|
96
|
-
files:
|
86
|
+
files:
|
97
87
|
- .gitignore
|
98
88
|
- Gemfile
|
99
89
|
- LICENSE
|
@@ -104,41 +94,31 @@ files:
|
|
104
94
|
- lib/legit.rb
|
105
95
|
- lib/legit/version.rb
|
106
96
|
- lib/legit_helper.rb
|
107
|
-
has_rdoc: true
|
108
97
|
homepage: https://github.com/dillonkearns/legit
|
109
98
|
licenses: []
|
110
|
-
|
111
99
|
post_install_message:
|
112
100
|
rdoc_options: []
|
113
|
-
|
114
|
-
require_paths:
|
101
|
+
require_paths:
|
115
102
|
- lib
|
116
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
103
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
117
104
|
none: false
|
118
|
-
requirements:
|
119
|
-
- -
|
120
|
-
- !ruby/object:Gem::Version
|
121
|
-
hash: 57
|
122
|
-
segments:
|
123
|
-
- 1
|
124
|
-
- 8
|
125
|
-
- 7
|
105
|
+
requirements:
|
106
|
+
- - ! '>='
|
107
|
+
- !ruby/object:Gem::Version
|
126
108
|
version: 1.8.7
|
127
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
109
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
128
110
|
none: false
|
129
|
-
requirements:
|
130
|
-
- -
|
131
|
-
- !ruby/object:Gem::Version
|
132
|
-
|
133
|
-
segments:
|
111
|
+
requirements:
|
112
|
+
- - ! '>='
|
113
|
+
- !ruby/object:Gem::Version
|
114
|
+
version: '0'
|
115
|
+
segments:
|
134
116
|
- 0
|
135
|
-
|
117
|
+
hash: 1460548303740247406
|
136
118
|
requirements: []
|
137
|
-
|
138
119
|
rubyforge_project:
|
139
|
-
rubygems_version: 1.
|
120
|
+
rubygems_version: 1.8.23
|
140
121
|
signing_key:
|
141
122
|
specification_version: 3
|
142
123
|
summary: A collection of scripts for common git tasks to simplify and improve workflow.
|
143
124
|
test_files: []
|
144
|
-
|