git-topic 0.1.6.3 → 0.1.6.4
Sign up to get free protection for your applications and to get access to all the features.
- data/.autotest +10 -0
- data/.vimrc +21 -1
- data/Gemfile +2 -0
- data/Gemfile.lock +2 -0
- data/Rakefile +4 -11
- data/VERSION.yml +1 -1
- data/bin/git-topic +1 -165
- data/git-topic +13 -0
- data/git-topic.gemspec +52 -6
- data/lib/git_topic/cli.rb +171 -0
- data/lib/git_topic/git.rb +13 -3
- data/lib/git_topic/naming.rb +16 -8
- data/lib/git_topic.rb +15 -9
- data/lib/tasks/annotations.rake +20 -0
- data/spec/git_topic_spec.rb +107 -6
- data/spec/template/origin/ORIG_HEAD +1 -0
- data/spec/template/origin/RENAMED-REF +1 -0
- data/spec/template/origin/objects/2d/a16986c7f742f808a3a3e68108bd2e4dae009d +0 -0
- data/spec/template/origin/objects/65/3d7112dadcacaaae6390612eac58c234f92b18 +2 -0
- data/spec/template/origin/objects/dd/26afde91bbae18e13e4df1cd1da56a75ccc665 +0 -0
- data/spec/template/origin/refs/heads/rejected/{davidjh → USER}/krakens +0 -0
- data/spec/template/origin/refs/heads/review/{davidjh → USER}/pirates +0 -0
- data/spec/template/origin/refs/heads/wip/USER/pirates-advanced +1 -0
- data/spec/template/origin/refs/heads/wip/USER/zombie-basic +1 -0
- data/spec/template/origin/refs/heads/wip/prevent-ff +1 -0
- data/spec/template/origin-fresh/HEAD +1 -0
- data/spec/template/origin-fresh/RENAMED-REF +1 -0
- data/spec/template/origin-fresh/config +7 -0
- data/spec/template/origin-fresh/description +1 -0
- data/spec/template/origin-fresh/hooks/applypatch-msg.sample +15 -0
- data/spec/template/origin-fresh/hooks/commit-msg.sample +24 -0
- data/spec/template/origin-fresh/hooks/post-commit.sample +8 -0
- data/spec/template/origin-fresh/hooks/post-receive.sample +15 -0
- data/spec/template/origin-fresh/hooks/post-update.sample +8 -0
- data/spec/template/origin-fresh/hooks/pre-applypatch.sample +14 -0
- data/spec/template/origin-fresh/hooks/pre-commit.sample +46 -0
- data/spec/template/origin-fresh/hooks/pre-rebase.sample +169 -0
- data/spec/template/origin-fresh/hooks/prepare-commit-msg.sample +36 -0
- data/spec/template/origin-fresh/hooks/update.sample +128 -0
- data/spec/template/origin-fresh/info/exclude +6 -0
- data/spec/template/origin-fresh/objects/0a/da6d051b94cd0df50f5a0b7229aec26f0d2cdf +0 -0
- data/spec/template/origin-fresh/objects/0c/e06c616769768f09f5e629cfcc68eabe3dee81 +0 -0
- data/spec/template/origin-fresh/objects/20/049991cdafdce826f5a3c01e10ffa84d6997ec +0 -0
- data/spec/template/origin-fresh/objects/33/1d827fd47fb234af54e3a4bbf8c6705e9116cc +3 -0
- data/spec/template/origin-fresh/objects/41/51899b742fd6b1c873b177b9d13451682089bc +0 -0
- data/spec/template/origin-fresh/objects/44/ffd9c9c8b52b201659e3ad318cdad6ec836b46 +0 -0
- data/spec/template/origin-fresh/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904 +0 -0
- data/spec/template/origin-fresh/objects/55/eeb01bdf874d1a35870bcf24a970c475c63344 +0 -0
- data/spec/template/origin-fresh/objects/8d/09f9b8d80ce282218125cb0cbf53cccf022203 +0 -0
- data/spec/template/origin-fresh/objects/b4/8e68d5cac189af36abe48e893d11c24b7b2a19 +0 -0
- data/spec/template/origin-fresh/objects/c0/838ed2ee8f2e83c8bda859fc5e332b92f0a5a3 +1 -0
- data/spec/template/origin-fresh/objects/cd/f7b9dbc4911a0d1404db54cde2ed448f6a6afd +0 -0
- data/spec/template/origin-fresh/objects/d2/6b33daea1ed9823a189992bba38fbc913483c1 +0 -0
- data/spec/template/origin-fresh/objects/fe/4e254557e19f338f40ccfdc00a7517771db880 +0 -0
- data/spec/template/origin-fresh/refs/heads/master +1 -0
- data/spec/template/origin-fresh/refs/heads/wip/USER/zombie-basic +1 -0
- metadata +61 -5
@@ -0,0 +1,128 @@
|
|
1
|
+
#!/bin/sh
|
2
|
+
#
|
3
|
+
# An example hook script to blocks unannotated tags from entering.
|
4
|
+
# Called by git-receive-pack with arguments: refname sha1-old sha1-new
|
5
|
+
#
|
6
|
+
# To enable this hook, rename this file to "update".
|
7
|
+
#
|
8
|
+
# Config
|
9
|
+
# ------
|
10
|
+
# hooks.allowunannotated
|
11
|
+
# This boolean sets whether unannotated tags will be allowed into the
|
12
|
+
# repository. By default they won't be.
|
13
|
+
# hooks.allowdeletetag
|
14
|
+
# This boolean sets whether deleting tags will be allowed in the
|
15
|
+
# repository. By default they won't be.
|
16
|
+
# hooks.allowmodifytag
|
17
|
+
# This boolean sets whether a tag may be modified after creation. By default
|
18
|
+
# it won't be.
|
19
|
+
# hooks.allowdeletebranch
|
20
|
+
# This boolean sets whether deleting branches will be allowed in the
|
21
|
+
# repository. By default they won't be.
|
22
|
+
# hooks.denycreatebranch
|
23
|
+
# This boolean sets whether remotely creating branches will be denied
|
24
|
+
# in the repository. By default this is allowed.
|
25
|
+
#
|
26
|
+
|
27
|
+
# --- Command line
|
28
|
+
refname="$1"
|
29
|
+
oldrev="$2"
|
30
|
+
newrev="$3"
|
31
|
+
|
32
|
+
# --- Safety check
|
33
|
+
if [ -z "$GIT_DIR" ]; then
|
34
|
+
echo "Don't run this script from the command line." >&2
|
35
|
+
echo " (if you want, you could supply GIT_DIR then run" >&2
|
36
|
+
echo " $0 <ref> <oldrev> <newrev>)" >&2
|
37
|
+
exit 1
|
38
|
+
fi
|
39
|
+
|
40
|
+
if [ -z "$refname" -o -z "$oldrev" -o -z "$newrev" ]; then
|
41
|
+
echo "Usage: $0 <ref> <oldrev> <newrev>" >&2
|
42
|
+
exit 1
|
43
|
+
fi
|
44
|
+
|
45
|
+
# --- Config
|
46
|
+
allowunannotated=$(git config --bool hooks.allowunannotated)
|
47
|
+
allowdeletebranch=$(git config --bool hooks.allowdeletebranch)
|
48
|
+
denycreatebranch=$(git config --bool hooks.denycreatebranch)
|
49
|
+
allowdeletetag=$(git config --bool hooks.allowdeletetag)
|
50
|
+
allowmodifytag=$(git config --bool hooks.allowmodifytag)
|
51
|
+
|
52
|
+
# check for no description
|
53
|
+
projectdesc=$(sed -e '1q' "$GIT_DIR/description")
|
54
|
+
case "$projectdesc" in
|
55
|
+
"Unnamed repository"* | "")
|
56
|
+
echo "*** Project description file hasn't been set" >&2
|
57
|
+
exit 1
|
58
|
+
;;
|
59
|
+
esac
|
60
|
+
|
61
|
+
# --- Check types
|
62
|
+
# if $newrev is 0000...0000, it's a commit to delete a ref.
|
63
|
+
zero="0000000000000000000000000000000000000000"
|
64
|
+
if [ "$newrev" = "$zero" ]; then
|
65
|
+
newrev_type=delete
|
66
|
+
else
|
67
|
+
newrev_type=$(git-cat-file -t $newrev)
|
68
|
+
fi
|
69
|
+
|
70
|
+
case "$refname","$newrev_type" in
|
71
|
+
refs/tags/*,commit)
|
72
|
+
# un-annotated tag
|
73
|
+
short_refname=${refname##refs/tags/}
|
74
|
+
if [ "$allowunannotated" != "true" ]; then
|
75
|
+
echo "*** The un-annotated tag, $short_refname, is not allowed in this repository" >&2
|
76
|
+
echo "*** Use 'git tag [ -a | -s ]' for tags you want to propagate." >&2
|
77
|
+
exit 1
|
78
|
+
fi
|
79
|
+
;;
|
80
|
+
refs/tags/*,delete)
|
81
|
+
# delete tag
|
82
|
+
if [ "$allowdeletetag" != "true" ]; then
|
83
|
+
echo "*** Deleting a tag is not allowed in this repository" >&2
|
84
|
+
exit 1
|
85
|
+
fi
|
86
|
+
;;
|
87
|
+
refs/tags/*,tag)
|
88
|
+
# annotated tag
|
89
|
+
if [ "$allowmodifytag" != "true" ] && git rev-parse $refname > /dev/null 2>&1
|
90
|
+
then
|
91
|
+
echo "*** Tag '$refname' already exists." >&2
|
92
|
+
echo "*** Modifying a tag is not allowed in this repository." >&2
|
93
|
+
exit 1
|
94
|
+
fi
|
95
|
+
;;
|
96
|
+
refs/heads/*,commit)
|
97
|
+
# branch
|
98
|
+
if [ "$oldrev" = "$zero" -a "$denycreatebranch" = "true" ]; then
|
99
|
+
echo "*** Creating a branch is not allowed in this repository" >&2
|
100
|
+
exit 1
|
101
|
+
fi
|
102
|
+
;;
|
103
|
+
refs/heads/*,delete)
|
104
|
+
# delete branch
|
105
|
+
if [ "$allowdeletebranch" != "true" ]; then
|
106
|
+
echo "*** Deleting a branch is not allowed in this repository" >&2
|
107
|
+
exit 1
|
108
|
+
fi
|
109
|
+
;;
|
110
|
+
refs/remotes/*,commit)
|
111
|
+
# tracking branch
|
112
|
+
;;
|
113
|
+
refs/remotes/*,delete)
|
114
|
+
# delete tracking branch
|
115
|
+
if [ "$allowdeletebranch" != "true" ]; then
|
116
|
+
echo "*** Deleting a tracking branch is not allowed in this repository" >&2
|
117
|
+
exit 1
|
118
|
+
fi
|
119
|
+
;;
|
120
|
+
*)
|
121
|
+
# Anything else (is there anything else?)
|
122
|
+
echo "*** Update hook: unknown type of update to ref $refname of type $newrev_type" >&2
|
123
|
+
exit 1
|
124
|
+
;;
|
125
|
+
esac
|
126
|
+
|
127
|
+
# --- Finished
|
128
|
+
exit 0
|
@@ -0,0 +1 @@
|
|
1
|
+
x��;N1�aj�b.@��CB��Qq����$�F����Y�@��~���&ؐ�`��/��(�8�(i�F�`�5�����'8gj�I�O�X�Q�g�~Y$SL:p1&)��k���V��o����;<�?:�/빶;����M9��b�G��V�����Pm���p����O���[��~�R�
|
@@ -0,0 +1 @@
|
|
1
|
+
0ce06c616769768f09f5e629cfcc68eabe3dee81
|
@@ -0,0 +1 @@
|
|
1
|
+
331d827fd47fb234af54e3a4bbf8c6705e9116cc
|
metadata
CHANGED
@@ -6,8 +6,8 @@ version: !ruby/object:Gem::Version
|
|
6
6
|
- 0
|
7
7
|
- 1
|
8
8
|
- 6
|
9
|
-
-
|
10
|
-
version: 0.1.6.
|
9
|
+
- 4
|
10
|
+
version: 0.1.6.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- David J. Hamilton
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-07-
|
18
|
+
date: 2010-07-21 00:00:00 -07:00
|
19
19
|
default_executable: git-topic
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -129,6 +129,19 @@ dependencies:
|
|
129
129
|
type: :development
|
130
130
|
prerelease: false
|
131
131
|
version_requirements: *id008
|
132
|
+
- !ruby/object:Gem::Dependency
|
133
|
+
name: autotest-screen
|
134
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
135
|
+
none: false
|
136
|
+
requirements:
|
137
|
+
- - ">="
|
138
|
+
- !ruby/object:Gem::Version
|
139
|
+
segments:
|
140
|
+
- 0
|
141
|
+
version: "0"
|
142
|
+
type: :development
|
143
|
+
prerelease: false
|
144
|
+
version_requirements: *id009
|
132
145
|
description: "\n gem command around reviewed topic branches. Supports workflow of the form:\n\n # alexander:\n git work-on <topic>\n git done\n\n # bismarck:\n git status # notice a review branch\n git review <topic>\n # happy, merge into master, push and cleanup\n git accept\n\n git review <topic2>\n # unhappy\n git reject\n\n # alexander:\n git status # notice rejected topic\n git work-on <topic>\n\n see README.rdoc for more (any) details.\n "
|
133
146
|
email: git-topic@hjdivad.com
|
134
147
|
executables:
|
@@ -139,6 +152,7 @@ extra_rdoc_files:
|
|
139
152
|
- LICENSE
|
140
153
|
- README.rdoc
|
141
154
|
files:
|
155
|
+
- .autotest
|
142
156
|
- .gitignore
|
143
157
|
- .gvimrc
|
144
158
|
- .rspec
|
@@ -154,14 +168,50 @@ files:
|
|
154
168
|
- VERSION.yml
|
155
169
|
- autotest/discover.rb
|
156
170
|
- bin/git-topic
|
171
|
+
- git-topic
|
157
172
|
- git-topic.gemspec
|
158
173
|
- lib/core_ext.rb
|
159
174
|
- lib/git_topic.rb
|
175
|
+
- lib/git_topic/cli.rb
|
160
176
|
- lib/git_topic/git.rb
|
161
177
|
- lib/git_topic/naming.rb
|
178
|
+
- lib/tasks/annotations.rake
|
162
179
|
- spec/git_topic_spec.rb
|
163
180
|
- spec/spec_helper.rb
|
181
|
+
- spec/template/origin-fresh/HEAD
|
182
|
+
- spec/template/origin-fresh/RENAMED-REF
|
183
|
+
- spec/template/origin-fresh/config
|
184
|
+
- spec/template/origin-fresh/description
|
185
|
+
- spec/template/origin-fresh/hooks/applypatch-msg.sample
|
186
|
+
- spec/template/origin-fresh/hooks/commit-msg.sample
|
187
|
+
- spec/template/origin-fresh/hooks/post-commit.sample
|
188
|
+
- spec/template/origin-fresh/hooks/post-receive.sample
|
189
|
+
- spec/template/origin-fresh/hooks/post-update.sample
|
190
|
+
- spec/template/origin-fresh/hooks/pre-applypatch.sample
|
191
|
+
- spec/template/origin-fresh/hooks/pre-commit.sample
|
192
|
+
- spec/template/origin-fresh/hooks/pre-rebase.sample
|
193
|
+
- spec/template/origin-fresh/hooks/prepare-commit-msg.sample
|
194
|
+
- spec/template/origin-fresh/hooks/update.sample
|
195
|
+
- spec/template/origin-fresh/info/exclude
|
196
|
+
- spec/template/origin-fresh/objects/0a/da6d051b94cd0df50f5a0b7229aec26f0d2cdf
|
197
|
+
- spec/template/origin-fresh/objects/0c/e06c616769768f09f5e629cfcc68eabe3dee81
|
198
|
+
- spec/template/origin-fresh/objects/20/049991cdafdce826f5a3c01e10ffa84d6997ec
|
199
|
+
- spec/template/origin-fresh/objects/33/1d827fd47fb234af54e3a4bbf8c6705e9116cc
|
200
|
+
- spec/template/origin-fresh/objects/41/51899b742fd6b1c873b177b9d13451682089bc
|
201
|
+
- spec/template/origin-fresh/objects/44/ffd9c9c8b52b201659e3ad318cdad6ec836b46
|
202
|
+
- spec/template/origin-fresh/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904
|
203
|
+
- spec/template/origin-fresh/objects/55/eeb01bdf874d1a35870bcf24a970c475c63344
|
204
|
+
- spec/template/origin-fresh/objects/8d/09f9b8d80ce282218125cb0cbf53cccf022203
|
205
|
+
- spec/template/origin-fresh/objects/b4/8e68d5cac189af36abe48e893d11c24b7b2a19
|
206
|
+
- spec/template/origin-fresh/objects/c0/838ed2ee8f2e83c8bda859fc5e332b92f0a5a3
|
207
|
+
- spec/template/origin-fresh/objects/cd/f7b9dbc4911a0d1404db54cde2ed448f6a6afd
|
208
|
+
- spec/template/origin-fresh/objects/d2/6b33daea1ed9823a189992bba38fbc913483c1
|
209
|
+
- spec/template/origin-fresh/objects/fe/4e254557e19f338f40ccfdc00a7517771db880
|
210
|
+
- spec/template/origin-fresh/refs/heads/master
|
211
|
+
- spec/template/origin-fresh/refs/heads/wip/USER/zombie-basic
|
164
212
|
- spec/template/origin/HEAD
|
213
|
+
- spec/template/origin/ORIG_HEAD
|
214
|
+
- spec/template/origin/RENAMED-REF
|
165
215
|
- spec/template/origin/config
|
166
216
|
- spec/template/origin/description
|
167
217
|
- spec/template/origin/hooks/applypatch-msg.sample
|
@@ -178,22 +228,28 @@ files:
|
|
178
228
|
- spec/template/origin/objects/0a/da6d051b94cd0df50f5a0b7229aec26f0d2cdf
|
179
229
|
- spec/template/origin/objects/0c/e06c616769768f09f5e629cfcc68eabe3dee81
|
180
230
|
- spec/template/origin/objects/20/049991cdafdce826f5a3c01e10ffa84d6997ec
|
231
|
+
- spec/template/origin/objects/2d/a16986c7f742f808a3a3e68108bd2e4dae009d
|
181
232
|
- spec/template/origin/objects/33/1d827fd47fb234af54e3a4bbf8c6705e9116cc
|
182
233
|
- spec/template/origin/objects/41/51899b742fd6b1c873b177b9d13451682089bc
|
183
234
|
- spec/template/origin/objects/44/ffd9c9c8b52b201659e3ad318cdad6ec836b46
|
184
235
|
- spec/template/origin/objects/4b/825dc642cb6eb9a060e54bf8d69288fbee4904
|
185
236
|
- spec/template/origin/objects/55/eeb01bdf874d1a35870bcf24a970c475c63344
|
237
|
+
- spec/template/origin/objects/65/3d7112dadcacaaae6390612eac58c234f92b18
|
186
238
|
- spec/template/origin/objects/8d/09f9b8d80ce282218125cb0cbf53cccf022203
|
187
239
|
- spec/template/origin/objects/b4/8e68d5cac189af36abe48e893d11c24b7b2a19
|
188
240
|
- spec/template/origin/objects/c0/838ed2ee8f2e83c8bda859fc5e332b92f0a5a3
|
189
241
|
- spec/template/origin/objects/cd/f7b9dbc4911a0d1404db54cde2ed448f6a6afd
|
190
242
|
- spec/template/origin/objects/d2/6b33daea1ed9823a189992bba38fbc913483c1
|
243
|
+
- spec/template/origin/objects/dd/26afde91bbae18e13e4df1cd1da56a75ccc665
|
191
244
|
- spec/template/origin/objects/fe/4e254557e19f338f40ccfdc00a7517771db880
|
192
245
|
- spec/template/origin/refs/heads/master
|
193
|
-
- spec/template/origin/refs/heads/rejected/
|
194
|
-
- spec/template/origin/refs/heads/review/
|
246
|
+
- spec/template/origin/refs/heads/rejected/USER/krakens
|
247
|
+
- spec/template/origin/refs/heads/review/USER/pirates
|
195
248
|
- spec/template/origin/refs/heads/review/user24601/ninja-basic
|
196
249
|
- spec/template/origin/refs/heads/review/user24601/zombie-basic
|
250
|
+
- spec/template/origin/refs/heads/wip/USER/pirates-advanced
|
251
|
+
- spec/template/origin/refs/heads/wip/USER/zombie-basic
|
252
|
+
- spec/template/origin/refs/heads/wip/prevent-ff
|
197
253
|
has_rdoc: true
|
198
254
|
homepage: http://github.com/hjdivad/git-topic
|
199
255
|
licenses: []
|