aboutsummaryrefslogtreecommitdiffstats
path: root/doc/gitto.texi
blob: a1a3344e81ee71854804ca0390adb25acc2f954c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
\input texinfo   @c -*-texinfo-*-
@c %**start of header
@setfilename gitto.info
@settitle Gitto
@c %**end of header
@copying
Gitto User Manual.

Copyright @copyright{} 2013  Tom Willemse

@quotation
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3
or any later version published by the Free Software Foundation;
with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts.
A copy of the license is included in the section entitled ``GNU
Free Documentation License''.

A copy of the license is also available from the Free Software
Foundation Web site at @url{http://www.gnu.org/licenses/fdl.html}.

@end quotation

The document was typeset with
@uref{http://www.texinfo.org/, GNU Texinfo}.

@end copying

@titlepage
@title Gitto
@subtitle Gitto User Manual
@author Tom Willemse <tom@@ryuslash.org>
@page
@vskip 0pt plus 1filll
@insertcopying
@end titlepage

@dircategory Individual utilities
@direntry
* Gitto: (gitto).     Keep track of your git repositories.
@end direntry

@c Output the table of the contents at the beginning.
@contents

@ifnottex
@node Top, Introduction, (dir), (dir)
@top Gitto

This is the manual for gitto. Gitto helps you keep track of the various
git repositories you have stored on your hard-drive(s).

@insertcopying
@end ifnottex

@c Generate the nodes for this menu with `C-c C-u C-m'.
@menu
* Introduction::
* Usage::
* Configuration::
* Copying This Manual::
* Index::
@end menu

@c Update all node entries with `C-c C-u C-n'.
@c Insert new nodes with `C-c C-c n'.
@node Introduction, Usage, Top, Top
@chapter Introduction

This chapter offers a few introductory sections that will explain why
you might want to use gitto and how to get it running.

@menu
* Features::
* Installation::
@end menu

@node Features, Installation, Introduction, Introduction
@section Features

gitto was started as a way to view the status of the repositories that
were registered with it. It has since also gained somewhat of a
management function.

@itemize @bullet
@item
First, it allows you to see an overview of the status of your git
repositories. For each registered repository it will show you the
following information:

@itemize @bullet
@item
The name of the repository. This is the directory name in which the
repository is located.

@item
The state of the worktree, clean or dirty. Dirty meaning that there are
uncommitted changes in the worktree.

@item
It shows the following information for each branch:

@itemize
@item
The name of the branch.

@item
How many commits the local repository has that have not been pushed to
the branch's upstream remote.

@item
How many commits the branch's upstream remote has that have not been
merged into the local repository.

@item
How long ago the last known commit pushed to the branch's upstream
remote was. If the branch has no upstream remote this will always be
@dfn{Never}.
@end itemize
@end itemize

@item
It allows the user to specify a template of settings which can be merged
with the registered repository's setting. This makes it easy to
generalize your configuration.

@item
Along with specifying a template for configuration settings the user can
also specify a list of repository names which should be excluded from
the merging of settings. This is useful when you have a few repositories
that you don't push to the same remotes or that have different needs for
configuration, perhaps because they are forks or clones of someone
else's project.

@item
It allows the user to specify a list of hooks which should be installed
in the repositories. This also looks at the exclude list and will not
install any hooks for projects in the exclude list. This is useful when
you have hooks that all your projects use, for example a
@file{commit-msg} hook that ensures correct style, or a
@file{pre-commit} hook that ensures there are no errors being committed.
@end itemize


@node Installation,  , Features, Introduction
@section Installation

There is a package available for gitto in the
@uref{https://aur.archlinux.org,Archlinux User Repository}@footnote{At
https://aur.archlinux.org/packages/gitto-git/}.

If you don't use Archlinux or you prefer installing it manually you
should first grab the source from somewhere and then it is a matter of
using:

@example
make
@end example

@noindent
and then, as root:

@example
make install
@end example

@noindent
or if you wish to install it somewhere other than in the default
location:

@example
make install DESTDIR=/path/to/where/you/want/it
@end example


@node Usage, Configuration, Introduction, Top
@chapter Usage

In order to use gitto you should first register some repositories. To
register a repository you can use the @command{add} command.

@deffn Command add location
This command checks if @var{location} contains a @file{.git} directory,
which indicates it being a git repository, and registers @var{location}
if so. Example:

@example
gitto add /path/to/your/project
@end example
@end deffn

If ever you want to stop keeping track of the status of a repository,
for example if you have given up on a project, you can use the
@command{remove} command.

@deffn Command remove location
Remove @var{location} from the list of registered repositories. This
first checks to see whether or not this repository has even been
registered.

@var{location} may be either an absolute or relative path, or it may
also be the name of a repository as displayed by @command{list}.

In case a name is specified and there are multiple possibilities a
list will be presented to you and you may choose which of the
repositories to remove based on the locations of each repository. The
question will be repeated until a valid answer is given (a number
appearing in the printed list).
@end deffn

In the event you (re)move some of your repositories and don't have the
energy to remove them all, there is also the @command{purge} command.

@deffn Command purge
Goes through all registered repositories and checks if they still exist
in the given place. In the case that they don't they are removed from
the registered repository list. This is useful when you have moved or
deleted a number of repositories.
@end deffn

If you are ever unsure if you have registered a repository or not, you
can always use the @command{check} command.

@deffn Command check location
Checks if @var{location} has been registered. Prints the result.
@end deffn

If you merely wish to know the locations of the repositories that have
been registered you can use @command{list}'s @command{locations}
sub-command.

@deffn Command list
This is the default command, equivalent to calling gitto without any
commands specified. It has one sub-command: @command{locations}.

@deffn Sub-Command locations
This lists the absolute file names of the registered repositories.
@end deffn
@end deffn

If you wish to manage your git configurations in a global way you can
use the various @command{config} commands.

@deffn Command config
This command shows a list of all the configurations of all the
registered repositories. It has a number of sub-commands with which you
can manage your git configurations globally.

@deffn Sub-Command global
Shows the template configuration as it would look in a git configuration
file format. Since it does not operate on any repository no name
substitution is performed.
@end deffn

@deffn Sub-Command update [location]
If @var{location} is specified, operate on it, otherwise operate on
all registered repositories not in the exclusion list.

Merge the template configuration with each repository's existing
configuration. This adds settings and sections that weren't there before
and overwrites settings that were. This is a destructive operation, so
be sure your settings are correct.
@end deffn

@deffn Sub-Command hooks [location]
If @var{location} is specified, operate on it, otherwise operate on
all registered repositories not in the exclusion list.

Install the hooks specified in the configuration file into each
repository. Each hook is a symlink to the configured executable.
@end deffn
@end deffn

In case you can't be bothered to go to whichever location you need to
go to in order to push a repository, or have a bunch of repositories
which all need a push, you can use the @command{push} command.

@deffn Command push [repository]
Pushes all branches of all repositories to their default upstream by
using

@example
git push -all
@end example

@noindent
on each registered repository. If @var{repository} has been specified,
call it only on that repository.
@end deffn

Lastly, if you're confused about gitto, you can use the @command{help}
command, and if you forgot which version of gitto you were using you can
use the @command{version} command.

@deffn Command help
Shows a help message with a quick summary of all the available commands.
@end deffn

@deffn Command version
Shows the version of gitto.
@end deffn


@node Configuration, Copying This Manual, Usage, Top
@chapter Configuration

gitto offers a few configuration options, mostly to do with git
configuration management. The configuration is located at either
@file{@env{XDG_CONFIG_HOME}/gitto/rc.scm} or
@file{@env{HOME}/.config/gitto/rc.scm} depending on the existence of the
@env{XDG_CONFIG_HOME} environment variable.

@defopt global-config
An alist of alists representing sections, variables and values which
will be placed in each git repository's configuration file. It looks
like this:

@lisp
((``@var{section}''
  (``@var{variable}'' . ``@var{value}'')
  (``@var{other-variable}'' ``@var{value1}'' ``@var{value2}'')))
@end lisp

A variable specification can have more than one value, but since gitto
doesn't know or care which variables can and cannot have more than one
value in git, it is up to the user to make sure they only use it with
supported variables.

Each value can have an @samp{~a} format specifier somewhere in their
value, when merging configurations this will be replaced with the name
of the repository for which the settings are being merged.

An example configuration could be:

@lisp
(set! global-config
      '((``remote \''origin\''``
         (``url'' . ``git@@example.com:%a.git'')
         (``pushurl'' ``git@@example.com:%a.git''
                      ``git@@somehost.com:user/%a.git''))
        (``branch \''master\''``
         (``remote'' . ``origin''))))
@end lisp

This example either modifies or creates the @samp{origin} remote in each
repository, setting the @samp{url} and @samp{pushurl} value and then
adding another @samp{pushurl} setting. It also creates or modifies the
@samp{master} branch, setting its @samp{remote} to the @samp{ryuslash}
remote.
@end defopt

@defopt hook-alist
An alist of @dfn{hook} and @dfn{executable} pairs. Each item in the list
specifies a hook's name and the executable it should be linked to. An
example configuration:

@lisp
(set! hook-alist
      '((``commit-msg'' . ``/some/commit-msg/hook'')
        (``pre-commit'' . ``/some/pre-commit/hook'')))
@end lisp

This will create symbolic links in the @file{.git/hooks} directories for
each registered repository when calling @command{config hooks}. gitto
doesn't know or care about which hooks exist, so it is up to the user to
provide the correct names and look for typos.
@end defopt

@defopt config-exclusion-list
A plain list of repository names to skip when merging configurations and
installing hooks.
@end defopt

@defopt show-unchanged-branches?
A boolean. If @code{#t} all branches will be shown no matter their
state, if @code{#f} (the default) only those branches that either have
commits to push or commits to pull will be shown in the output of the
@samp{list} command.
@end defopt


@node Copying This Manual, Index, Configuration, Top
@appendix Copying This Manual

@include fdl.texi

@node Index,  , Copying This Manual, Top
@unnumbered Index

@printindex fn
@printindex vr

@bye

@c gitto.texi ends here