gitty 0.4.2 → 0.4.3
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/Rakefile +1 -1
- data/assets/hooks/auto-submodules +6 -8
- data/bin/cucumber +1 -0
- data/bin/spec +1 -0
- data/lib/gitty/commands/list.rb +6 -6
- data/spec/spec_helper.rb +3 -1
- metadata +22 -6
data/Rakefile
CHANGED
@@ -10,7 +10,7 @@ begin
|
|
10
10
|
gem.email = "timcharper@gmail.com"
|
11
11
|
gem.homepage = "http://github.com/timcharper/gitty"
|
12
12
|
gem.authors = ["Tim Harper"]
|
13
|
-
gem.files = Dir['lib/**/*.rb'] + Dir['assets/**/*'] +
|
13
|
+
gem.files = Dir['lib/**/*.rb'] + Dir['assets/**/*'] + ['bin/git-hook'] + Dir['cucumber/**/*'] + Dir['spec/**/*'] + %w[cucumber.yml Rakefile README.textile LICENSE]
|
14
14
|
# gem.executables << 'git-hook'/
|
15
15
|
end
|
16
16
|
Jeweler::GemcutterTasks.new
|
@@ -8,7 +8,7 @@
|
|
8
8
|
# - If a submodule has been removed from the branch you move to, it alerts you
|
9
9
|
# - If a submodule has been added on the branch you move to, it alerts you
|
10
10
|
# - Otherwise, it checks out the revision for you
|
11
|
-
# version: 0.
|
11
|
+
# version: 0.5
|
12
12
|
# targets: ["pre-rebase", "post-applypatch", "post-checkout", "post-merge"]
|
13
13
|
|
14
14
|
# this is a bit of a hack: when a rebase is ran, we don't want to have the initial checkout update submodules
|
@@ -57,7 +57,6 @@ HELPERS = File.expand_path(ENV['HELPERS'], Dir.pwd)
|
|
57
57
|
chdir_parent
|
58
58
|
current_submodules = list_submodules('HEAD')
|
59
59
|
previous_submodules = list_submodules('HEAD@{1}')
|
60
|
-
|
61
60
|
(current_submodules.keys + previous_submodules.keys).uniq.sort.each do |path|
|
62
61
|
rev = submodule_current_rev(path)
|
63
62
|
case
|
@@ -84,27 +83,26 @@ previous_submodules = list_submodules('HEAD@{1}')
|
|
84
83
|
system("(git show '#{current_submodules[path]}' 2> /dev/null 1> /dev/null) || git fetch")
|
85
84
|
|
86
85
|
current_rev = current_submodules[path]
|
87
|
-
rev, ref_kind, ref = %x{git for-each-ref}.split("\n").
|
86
|
+
rev, ref_kind, ref = %x{git for-each-ref}.split("\n").
|
87
|
+
map { |l| l.split(" ") }.
|
88
|
+
detect {|rev, ref_kind, ref| rev == current_rev && (! ref.include?("HEAD")) }
|
88
89
|
|
89
90
|
if ref.nil?
|
90
91
|
system("git checkout -q #{current_rev}")
|
91
92
|
if $? == 0
|
92
93
|
STDERR.puts "Submodule HEAD was detached. The following branches contain the new HEAD:"
|
93
94
|
system("git branch --contains #{current_rev} -a | egrep -v 'no branch|HEAD' 1>&2")
|
94
|
-
exit 0
|
95
95
|
else
|
96
96
|
STDERR.puts "Couldn't update submodule."
|
97
|
-
exit $?
|
98
97
|
end
|
98
|
+
next
|
99
99
|
end
|
100
100
|
if ref.match(/^refs\/heads/)
|
101
101
|
output = %x(git checkout '#{File.basename(ref)}' 2>&1)
|
102
102
|
if $? == 0
|
103
103
|
STDERR.puts "Switched to branch #{File.basename(ref)}"
|
104
|
-
exit 0
|
105
104
|
else
|
106
105
|
STDERR.puts "Couldn't update submodule: #{output}"
|
107
|
-
exit $?
|
108
106
|
end
|
109
107
|
end
|
110
108
|
|
@@ -120,7 +118,7 @@ previous_submodules = list_submodules('HEAD@{1}')
|
|
120
118
|
else
|
121
119
|
system("git branch -f #{local_ref} #{ref}")
|
122
120
|
end
|
123
|
-
|
121
|
+
system("git checkout #{local_ref}")
|
124
122
|
end
|
125
123
|
end
|
126
124
|
end
|
data/bin/cucumber
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
exec bundle exec cucumber "$*"
|
data/bin/spec
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
exec bundle exec spec "$*"
|
data/lib/gitty/commands/list.rb
CHANGED
@@ -23,18 +23,18 @@ class Gitty::HookCommand::List < Gitty::Runner
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def show_local_or_shared_hooks(which)
|
26
|
-
|
27
|
-
puts "#{which}:\n#{listify(
|
26
|
+
hooks = all_hooks.select { |h| h.install_kind == which.to_sym }
|
27
|
+
puts "#{which}:\n#{listify(hooks)}\n\n"
|
28
28
|
end
|
29
29
|
|
30
30
|
def listify(hooks)
|
31
|
-
hooks.map { |h| "- #{h}" }.join("\n")
|
31
|
+
hooks.map { |h| "- #{h.name} #{h.inspect}" }.join("\n")
|
32
32
|
end
|
33
33
|
|
34
34
|
def show_uninstalled_hooks
|
35
|
-
|
36
|
-
|
37
|
-
uninstalled_hooks =
|
35
|
+
available_hooks = all_hooks.select { |h| ! h.installed? }
|
36
|
+
installed_hooks = all_hooks.select { |h| h.installed? }
|
37
|
+
uninstalled_hooks = available_hooks.reject { |h| installed_hooks.name == h.name }
|
38
38
|
puts "uninstalled:\n#{listify(uninstalled_hooks)}\n\n"
|
39
39
|
end
|
40
40
|
|
data/spec/spec_helper.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
|
-
require File.dirname(__FILE__) + "/../lib/gitty"
|
2
1
|
require 'rubygems'
|
2
|
+
require 'bundler'
|
3
|
+
Bundler.setup
|
4
|
+
require File.dirname(__FILE__) + "/../lib/gitty"
|
3
5
|
require "spec"
|
4
6
|
SPEC_PATH = Pathname.new(File.dirname(__FILE__))
|
5
7
|
require SPEC_PATH + "../features/support/sandbox_world.rb"
|
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitty
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 9
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 4
|
9
|
+
- 3
|
10
|
+
version: 0.4.3
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- Tim Harper
|
@@ -9,14 +15,16 @@ autorequire:
|
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
17
|
|
12
|
-
date: 2010-
|
13
|
-
default_executable:
|
18
|
+
date: 2010-05-19 00:00:00 -06:00
|
19
|
+
default_executable:
|
14
20
|
dependencies: []
|
15
21
|
|
16
22
|
description: Unobtrusively extend git
|
17
23
|
email: timcharper@gmail.com
|
18
24
|
executables:
|
25
|
+
- cucumber
|
19
26
|
- git-hook
|
27
|
+
- spec
|
20
28
|
extensions: []
|
21
29
|
|
22
30
|
extra_rdoc_files:
|
@@ -59,6 +67,8 @@ files:
|
|
59
67
|
- spec/spec.opts
|
60
68
|
- spec/spec_helper.rb
|
61
69
|
- spec/support/constants.rb
|
70
|
+
- bin/cucumber
|
71
|
+
- bin/spec
|
62
72
|
has_rdoc: true
|
63
73
|
homepage: http://github.com/timcharper/gitty
|
64
74
|
licenses: []
|
@@ -69,21 +79,27 @@ rdoc_options:
|
|
69
79
|
require_paths:
|
70
80
|
- lib
|
71
81
|
required_ruby_version: !ruby/object:Gem::Requirement
|
82
|
+
none: false
|
72
83
|
requirements:
|
73
84
|
- - ">="
|
74
85
|
- !ruby/object:Gem::Version
|
86
|
+
hash: 3
|
87
|
+
segments:
|
88
|
+
- 0
|
75
89
|
version: "0"
|
76
|
-
version:
|
77
90
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
91
|
+
none: false
|
78
92
|
requirements:
|
79
93
|
- - ">="
|
80
94
|
- !ruby/object:Gem::Version
|
95
|
+
hash: 3
|
96
|
+
segments:
|
97
|
+
- 0
|
81
98
|
version: "0"
|
82
|
-
version:
|
83
99
|
requirements: []
|
84
100
|
|
85
101
|
rubyforge_project:
|
86
|
-
rubygems_version: 1.3.
|
102
|
+
rubygems_version: 1.3.7
|
87
103
|
signing_key:
|
88
104
|
specification_version: 3
|
89
105
|
summary: Unobtrusively extend git
|