]> git.madduck.net Git - code/vcsh.git/blob - vcsh.1

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

vcsh: Make status() show commit offsets to remote tracking branch
[code/vcsh.git] / vcsh.1
1 .\" generated with Ronn/v0.7.3
2 .\" http://github.com/rtomayko/ronn/tree/0.7.3
3 .
4 .TH "VCSH" "1" "March 2014" "" ""
5 .
6 .SH "NAME"
7 \fBvcsh\fR \- Version Control System for $HOME \- multiple Git repositories in $HOME
8 .
9 .SH "SYNOPSIS"
10 \fBvcsh\fR [\fIoptions\fR] \fIcommand\fR
11 .
12 .P
13 \fBvcsh\fR clone \fIurl\fR [\fIrepo\fR]
14 .
15 .P
16 \fBvcsh\fR delete \fIrepo\fR
17 .
18 .P
19 \fBvcsh\fR enter \fIrepo\fR
20 .
21 .P
22 \fBvcsh\fR help
23 .
24 .P
25 \fBvcsh\fR init \fIrepo\fR
26 .
27 .P
28 \fBvcsh\fR list
29 .
30 .P
31 \fBvcsh\fR list\-tracked
32 .
33 .P
34 \fBvcsh\fR list\-tracked\-by \fIrepo\fR
35 .
36 .P
37 \fBvcsh\fR pull
38 .
39 .P
40 \fBvcsh\fR push
41 .
42 .P
43 \fBvcsh\fR rename \fIrepo\fR \fInewname\fR
44 .
45 .P
46 \fBvcsh\fR run \fIrepo\fR \fIshell command\fR
47 .
48 .P
49 \fBvcsh\fR status [\fIrepo\fR]
50 .
51 .P
52 \fBvcsh\fR upgrade \fIrepo\fR
53 .
54 .P
55 \fBvcsh\fR version
56 .
57 .P
58 \fBvcsh\fR which \fIsubstring\fR
59 .
60 .P
61 \fBvcsh\fR write\-gitignore \fIrepo\fR
62 .
63 .P
64 \fBvcsh\fR \fIrepo\fR \fIgit command\fR
65 .
66 .P
67 \fBvcsh\fR \fIrepo\fR
68 .
69 .SH "DESCRIPTION"
70 \fBvcsh\fR allows you to have several \fBgit\fR(1) repositories, all maintaining their working trees in $HOME without clobbering each other\. That, in turn, means you can have one repository per config set (zsh, vim, ssh, etc), picking and choosing which configs you want to use on which machine\.
71 .
72 .P
73 \fBvcsh\fR is using a technique called fake bare Git repositories, keeping \fI$GIT_DIR\fR in a different directory from \fI$GIT_WORK_TREE\fR which is pointed to \fI$HOME\fR\.
74 .
75 .P
76 The use of symlinks is not needed in this setup, making for a cleaner setup\.
77 .
78 .P
79 \fBvcsh\fR was designed with \fBmr\fR(1) in mind so you might want to install it alongside vcsh\. That being said, you can easily use \fBvcsh\fR without \fBmr\fR if you prefer\.
80 .
81 .P
82 A sample configuration for \fBvcsh\fR and \fBmr\fR can be found at \fIhttps://github\.com/RichiH/vcsh_mr_template\fR and used with \fBvcsh clone https://github\.com/RichiH/vcsh_mr_template mr\fR\.
83 .
84 .P
85 Please note that you can always use a path instead of a name for \fIrepo\fR\. This is needed to support mr and other scripts properly and of no concern to an interactive user\.
86 .
87 .SH "OPTIONS"
88 .
89 .TP
90 \-c
91 Source \fIfile\fR prior to other configuration files
92 .
93 .TP
94 \-d
95 Enable debug mode
96 .
97 .TP
98 \-v
99 Enable verbose mode
100 .
101 .SH "COMMANDS"
102 .
103 .TP
104 clone
105 Clone an existing repository\.
106 .
107 .IP
108 If you need to clone a bundle of repositories, look into the \fBpost\-clone\-retired\fR hook\.
109 .
110 .TP
111 commit
112 Commit in all repositories
113 .
114 .TP
115 delete
116 Delete an existing repository\.
117 .
118 .TP
119 enter
120 Enter repository; spawn new \fI$SHELL\fR\.
121 .
122 .TP
123 help
124 Display help\.
125 .
126 .TP
127 init
128 Initialize an empty repository\.
129 .
130 .TP
131 list
132 List all local vcsh repositories\.
133 .
134 .TP
135 list\-tracked
136 List all files tracked by vcsh\.
137 .
138 .TP
139 list\-tracked\-by
140 List files tracked by a repository\.
141 .
142 .TP
143 pull
144 Pull from all vcsh remotes\.
145 .
146 .TP
147 push
148 Push to all vcsh remotes\.
149 .
150 .TP
151 rename
152 Rename a repository\.
153 .
154 .TP
155 run
156 Run command with \fI$GIT_DIR\fR and \fI$GIT_WORK_TREE\fR set\. Allows you to run any and all commands without any restrictions\. Use with care\.
157 .
158 .IP
159 Please note that there is a somewhat magic feature for run\. Instead of \fIrepo\fR it accepts \fIpath\fR, as well\. Anything that has a slash in it will be assumed to be a path\. \fBvcsh run\fR will then operate on this directory instead of the one normally generated from the repository\'s name\. This is needed to support mr and other scripts properly and of no concern to an interactive user\.
160 .
161 .TP
162 status
163 Show statuses of all/one vcsh repositories\.
164 .
165 .TP
166 upgrade
167 Upgrade repository to currently recommended settings\.
168 .
169 .TP
170 version
171 Print version information\.
172 .
173 .TP
174 which \fIsubstring\fR
175 Find \fIsubstring\fR in name of any tracked file\.
176 .
177 .TP
178 write\-gitignore
179 Write \.gitignore\.d/\fIrepo\fR via \fBgit ls\-files\fR\.
180 .
181 .TP
182 \fIrepo\fR \fIgitcommand\fR
183 Shortcut to run \fBvcsh\fR on a repo\. Will prepend \fBgit\fR to \fIcommand\fR\.
184 .
185 .TP
186 \fIrepo\fR
187 Shortcut to run \fBvcsh enter <repo>\fR\.
188 .
189 .SH "ENVIRONMENT"
190 As noted earlier, \fBvcsh\fR will set \fI$GIT_DIR\fR and \fI$GIT_WORK_TREE\fR to the appropriate values for fake bare Git repositories\.
191 .
192 .SH "CONFIG"
193 There are several ways to turn the various knobs on \fBvcsh\fR\. In order of ascending precedence, they are:
194 .
195 .IP "\(bu" 4
196 \fBVARIABLE=foo vcsh\fR
197 .
198 .IP "\(bu" 4
199 </etc/vcsh/config>
200 .
201 .IP "\(bu" 4
202 <$XDG_CONFIG_HOME/vcsh/config>
203 .
204 .IP "\(bu" 4
205 \fBvcsh \-c <file>\fR
206 .
207 .IP "" 0
208 .
209 .P
210 Please note that those files are sourced\. Any and all commands will be executed in the context of your shell\.
211 .
212 .P
213 Interesting knobs you can turn:
214 .
215 .TP
216 \fI$VCSH_GITATTRIBUTES\fR
217 Can be \fInone\fR, or any other value\.
218 .
219 .IP
220 \fInone\fR will not maintain Git attributes in a special location\.
221 .
222 .IP
223 If set to any other value, repo\-specific gitattributes files will be maintained\.
224 .
225 .IP
226 Defaults to \fInone\fR\.
227 .
228 .TP
229 \fI$VCSH_GITIGNORE\fR
230 Can be \fIexact\fR, \fInone\fR, or \fIrecursive\fR\.
231 .
232 .IP
233 \fIexact\fR will seed the repo\-specific ignore file with all file and directory names which \fBgit ls\-files\fR returns\.
234 .
235 .IP
236 \fInone\fR will not write any ignore file\.
237 .
238 .IP
239 \fIrecursive\fR will descend through all directories recursively additionally to the above\.
240 .
241 .IP
242 Defaults to \fIexact\fR\.
243 .
244 .TP
245 \fI$VCSH_VCSH_WORKTREE\fR
246 Can be \fIabsolute\fR, or \fIrelative\fR\.
247 .
248 .IP
249 \fIabsolute\fR will set an absolute path; defaulting to \fI$HOME\fR\.
250 .
251 .IP
252 \fIrelative\fR will set a path relative to \fI$GIT_DIR\fR\.
253 .
254 .IP
255 Defaults to \fIabsolute\fR\.
256 .
257 .P
258 Less interesting knobs you could turn:
259 .
260 .TP
261 \fI$VCSH_DEBUG\fR
262 Enter debug mode\.
263 .
264 .TP
265 \fI$XDG_CONFIG_HOME\fR
266 As specified in the \'XDG Base Directory Specification\', see \fIhttp://standards\.freedesktop\.org/basedir\-spec/basedir\-spec\-latest\.html\fR
267 .
268 .IP
269 Defaults to <$HOME/\.config>\.
270 .
271 .TP
272 \fI$VCSH_REPO_D\fR
273 The directory where repositories are read from and stored\.
274 .
275 .IP
276 Defaults to <$XDG_CONFIG_HOME/vcsh/repo\.d>\.
277 .
278 .TP
279 \fI$VCSH_HOOK_D\fR
280 The directory where hooks are read from\.
281 .
282 .IP
283 Defaults to <$XDG_CONFIG_HOME/vcsh/hooks\-enabled>\.
284 .
285 .TP
286 \fI$VCSH_BASE\fR
287 The directory where repositories are checked out to\.
288 .
289 .IP
290 Defaults to \fI$HOME\fR\.
291 .
292 .SH "HOOK SYSTEM"
293 \fBvcsh\fR provides a hook system\. Hook scripts must be executable and should be placed in <$XDG_CONFIG_HOME/vcsh/hooks\-available>\. From there, they can be soft\-linked into <$XDG_CONFIG_HOME/vcsh/hooks\-enabled>; \fBvcsh\fR will only execute hooks that are in this directory\.
294 .
295 .P
296 Hooks follow a simple format\. \fIpre\-run\fR will be run before anything is run\. If you want to have more than one script for a certain hook, just append any kind of string to order them\. A system of \fIpre\-run\fR, <pre\-run\.10>, <pre\-run\.20> etc is suggested; other options would be \fIpre\-run\-10\fR or <pre\-run\.sh>\. A dot after the hook name is optional\.
297 .
298 .P
299 If you want to create hooks for a specific \fIvcsh\fR repository, simply prepend the repository\'s name, followed by a dot, i\.e\. <zsh\.pre\-run>\. Otherwise, the same rules as above apply\. The dot between the repository\'s name and the hook is mandatory, though\.
300 .
301 .P
302 Available hooks are \fIpre\-clone\fR, \fIpost\-clone\fR, \fIpost\-clone\-retired\fR, \fIpre\-command\fR, \fIpost\-command\fR, \fIpre\-enter\fR, \fIpost\-enter\fR, \fIpre\-init\fR, \fIpost\-init\fR, \fIpre\-pull\fR, \fIpost\-pull\fR, \fIpre\-push\fR, \fIpost\-push\fR, \fIpre\-run\fR, \fIpost\-run\fR, \fIpre\-upgrade\fR, and \fIpost\-upgrade\fR\. If you need more, vcsh is trivial to patch, but please let upstream know so we can ship them by default\.
303 .
304 .SH "DETAILED HOWTO AND FURTHER READING"
305 Manpages are often short and sometimes useless to glean best practices from\. While the author tried to avoid this in this case, manpages can not cover detailed howtos\.
306 .
307 .P
308 This software also comes with a file called <README\.md>\. It contains various approaches to setting up and using vcsh\. You can view the file it as plain text or render it into various other formats via Markdown\.
309 .
310 .P
311 On Debian\-based systems, this file can be found in </usr/share/doc/vcsh>\.
312 .
313 .SH "SECURITY CONSIDERATIONS"
314 \fBvcsh\fR allows you to execute arbitrary commands via \fBvcsh run\fR\. For example, adding a \fBsudo\fR(8) rule for \fBvcsh\fR would be pretty stupid\.
315 .
316 .P
317 Additionally, vcsh will source, i\.e\. execute, all files listed in \fICONFIG\fR\. You can put any and all commands into these config files and they will be executed\.
318 .
319 .SH "BUGS"
320 None are known at this time, but reports and/or patches are more than welcome\.
321 .
322 .SH "INTEROPERABILITY"
323 If you rely on \fBgit submodule\fR use \fBgit\fR 1\.7\.12 or later\. Earlier versions do not clean internal variables properly before descending into submodules, resulting in unhappy end users\.
324 .
325 .SH "HISTORY"
326 Like most people, the author initially made do with a single repository for all config files, all of which were soft\-linked into \fI$HOME\fR\.
327 .
328 .P
329 Martin F\. Krafft aka madduck came up with the concept of fake bare Git repositories\.
330 .
331 .P
332 vcsh was initally written by madduck\. This version is a re\-implementation from scratch with a lot more features\. madduck graciously agreed to let the author take over the name\.
333 .
334 .SH "AUTHOR"
335 This manpage and \fBvcsh\fR itself were written by Richard "RichiH" Hartmann\.
336 .
337 .SH "COPYRIGHT"
338 Copyright 2011\-2013 Richard Hartmann \fIrichih@debian\.org\fR
339 .
340 .P
341 Licensed under the GNU GPL version 2 or higher\.
342 .
343 .P
344 https://github\.com/RichiH/vcsh
345 .
346 .SH "SEE ALSO"
347 \fBgit\fR(1), \fBmr\fR(1)