git-pairing 0.3.4 → 0.3.6
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.
- checksums.yaml +8 -8
- data/README.md +2 -2
- data/bin/git-pair +9 -6
- data/lib/commands.rb +1 -1
- data/lib/helper.rb +5 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
ZTk2ZjEwOTFhOTYyZmZiNWY1ODZlZjFmYzFlNTk3ZDZmNjQxMzdiMg==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
NjE1ZDUwNDYzMTAyOGZjNTQ3ODc3MDcwZGUyYzk4YzRkNmQ4ZWMxOA==
|
|
7
7
|
!binary "U0hBNTEy":
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
ZGMwMzc0M2I2ZTlmNDY2NGM1NzYxNThjMWRlZmNlNTQ3YTdjZjJiMmU1YmM3
|
|
10
|
+
YWUyZjNlMTk4NWRmNjg5Y2Y2OWRjYjNhMDFkOWFjMWViY2Q4MjZmODcyMTll
|
|
11
|
+
NGVlZjhjMTJjNTVhODU3ODJhNWJlMGI2NTY1NTk0Y2JjNjA3Y2I=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
ODJhNjJiNmQ5ZTAzMTg3OWQ3ZmZmMTk0ZjlmZjJiZjRiNWQwZjMyN2YwMmVk
|
|
14
|
+
YTcxNjc2OTMyMjVlOGE3YzEzMTA2OTZjMjdmNmIzODE1OGVmZDJhMDYzYTBk
|
|
15
|
+
YjM3NTY3MjU3MmYyMzk2ZTNmZDNkOTgzMTIzZDgwZGFlYTMxMWQ=
|
data/README.md
CHANGED
|
@@ -11,13 +11,13 @@ configured in a git repo.
|
|
|
11
11
|
* maintains a list of pairing partners, so that you can specify multiple commit authors by their initials
|
|
12
12
|
* prompts to configure new partners as needed
|
|
13
13
|
* reverts back to original global settings
|
|
14
|
-
*
|
|
14
|
+
* complements [promptula](http://github.com/wballard/promptula)
|
|
15
15
|
|
|
16
16
|
See help for more details and available options on the commands
|
|
17
17
|
|
|
18
18
|
```
|
|
19
19
|
$ git pair -h
|
|
20
|
-
$ git whoami -h
|
|
20
|
+
$ git [ who | whoami ] -h
|
|
21
21
|
$ git solo -h
|
|
22
22
|
```
|
|
23
23
|
|
data/bin/git-pair
CHANGED
|
@@ -8,17 +8,15 @@ require 'highline/import'
|
|
|
8
8
|
require 'paint'
|
|
9
9
|
require 'pp'
|
|
10
10
|
|
|
11
|
-
# config file is put into the user's home directory
|
|
12
|
-
path_to_conf = File.join(File.expand_path(ENV['HOME']),'.pairs')
|
|
13
|
-
pairs_conf = GitPairs::Helper.init(path_to_conf)
|
|
14
|
-
|
|
15
|
-
GitPairs::Helper.git_repo?
|
|
16
|
-
|
|
17
11
|
opts = Trollop::options do
|
|
18
12
|
banner <<-EOS
|
|
19
13
|
|
|
20
14
|
Enables you to attribute git code commits to multiple authors
|
|
21
15
|
|
|
16
|
+
Also see:
|
|
17
|
+
git solo [-h | <user-initials>]
|
|
18
|
+
git [who | whoami]
|
|
19
|
+
|
|
22
20
|
Usage:
|
|
23
21
|
git pair <user-initials-1> <user-initials-2> [<user-initials-3> ...]
|
|
24
22
|
git pair [-a | --add] <user-initials-1> [<user-initials-2> ...]
|
|
@@ -34,6 +32,11 @@ EOS
|
|
|
34
32
|
opt :show, "Display the current ~/.pairs config"
|
|
35
33
|
end
|
|
36
34
|
|
|
35
|
+
# config file is put into the user's home directory
|
|
36
|
+
path_to_conf = File.join(File.expand_path(ENV['HOME']),'.pairs')
|
|
37
|
+
pairs_conf = GitPairs::Helper.init(path_to_conf)
|
|
38
|
+
|
|
39
|
+
|
|
37
40
|
too_many = (opts[:show_given] && opts[:add_given]) || (opts[:show_given] && opts[:delete_given]) || (opts[:add_given] && opts[:delete_given])
|
|
38
41
|
Trollop::die "Options are mutually exclusive - please enter only one" if too_many
|
|
39
42
|
|
data/lib/commands.rb
CHANGED
|
@@ -17,7 +17,7 @@ module GitPairs
|
|
|
17
17
|
def self.set(conf, path_to_conf, partners)
|
|
18
18
|
if partners.size < 2
|
|
19
19
|
puts ""
|
|
20
|
-
puts Paint["
|
|
20
|
+
puts Paint["To configure pairing for this repo, supply a list of parnter initials. E.g., 'git pair sq jo'", :yellow]
|
|
21
21
|
Trollop::die "Wrong number of arguments"
|
|
22
22
|
end
|
|
23
23
|
authors = []
|
data/lib/helper.rb
CHANGED
|
@@ -21,6 +21,7 @@ module GitPairs
|
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
def self.git_repo?
|
|
24
|
+
self.git_installed?
|
|
24
25
|
warning = "Not in a git repo"
|
|
25
26
|
# Check if we are in a git repo
|
|
26
27
|
if self.windows?
|
|
@@ -29,8 +30,9 @@ module GitPairs
|
|
|
29
30
|
Trollop::die warning unless system 'git status > /dev/null 2>/dev/null'
|
|
30
31
|
end
|
|
31
32
|
end
|
|
32
|
-
|
|
33
|
+
|
|
33
34
|
def self.git_reset
|
|
35
|
+
self.git_installed?
|
|
34
36
|
if self.windows?
|
|
35
37
|
`git config --unset-all user.name > NUL 2>NUL`
|
|
36
38
|
`git config --unset-all user.email > NUL 2>NUL`
|
|
@@ -75,6 +77,7 @@ module GitPairs
|
|
|
75
77
|
end
|
|
76
78
|
|
|
77
79
|
def self.whoami
|
|
80
|
+
self.git_installed?
|
|
78
81
|
user = `git config --get user.name`.strip
|
|
79
82
|
email = `git config --get user.email`.strip
|
|
80
83
|
puts ""
|
|
@@ -109,6 +112,7 @@ module GitPairs
|
|
|
109
112
|
end
|
|
110
113
|
|
|
111
114
|
def self.set(conf, authors)
|
|
115
|
+
self.git_repo?
|
|
112
116
|
authors.sort!
|
|
113
117
|
sorted_authors = ""
|
|
114
118
|
sorted_initials = ""
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: git-pairing
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.3.
|
|
4
|
+
version: 0.3.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Steve Quince
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2013-
|
|
11
|
+
date: 2013-05-02 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: trollop
|
|
@@ -112,7 +112,7 @@ files:
|
|
|
112
112
|
- lib/commands.rb
|
|
113
113
|
- lib/helper.rb
|
|
114
114
|
- README.md
|
|
115
|
-
homepage: https://github.com/
|
|
115
|
+
homepage: https://github.com/glg/git-pairing
|
|
116
116
|
licenses: []
|
|
117
117
|
metadata: {}
|
|
118
118
|
post_install_message:
|