Commit graph

82 commits

Author SHA1 Message Date
3036734e4b Extract hooks init from config 2014-01-28 23:38:07 +01:00
0272a7d17e Give command names less room in help output
So far no command name has gone beyond 15 characters, and the purge help
text was 2 characters too wide.
2013-11-12 00:54:13 +01:00
d1245a3d7f Add docs about new parameters 2013-11-11 00:12:06 +01:00
040ef0d5e0 Makefile: Put path and main in order of dependence
The `main' module depends on `path', not the other way around, just to
be sure to keep away compilation warnings or double compilation compile
`path' first.
2013-11-10 21:34:42 +01:00
442b8f9122 Allow directory specification for config update
Add an optional directory parameter to the `config update' and `config
hooks' commands, which, if specified, will limit any updates to the
given repository.
2013-11-10 21:32:32 +01:00
f81fcc9a8a Make sure to deal with a repository
When checking when a repository is known or not be sure that there is
actually a chance that we are looking at a repository. If the thing to
be checked is neither a `<repository>' instance nor a string it's sure
that it's also not a registered repository.
2013-11-10 21:30:51 +01:00
aab22cbb6e Make gitto.el work with the latest gitto 2013-10-13 00:42:54 +02:00
87a300c389 Add warnings when compiling
They help catch some easy to overlook mistakes.
2013-06-08 01:05:23 +02:00
39b5431da1 Specify usage information in the command 2013-06-08 01:04:45 +02:00
b1a2359036 Only show branches with changes by default
Unless `show-unchanged-branches?' has been set to `#t' in the user's
configuration only branches with pushable or pullable commits are shown.
2013-06-07 22:34:27 +02:00
a936e985a4 Catch wrong number of arguments case
If a command gets the wrong number of arguments, tell the user.
2013-06-05 01:07:56 +02:00
5f3dfee5ac Use a macro to define commands 2013-06-05 00:58:16 +02:00
c00a0ca730 Add some docstrings 2013-05-31 23:41:16 +02:00
62627e6cf6 Properly handle multiple values for settings
Fixes an error that would cause values to be duplicated when specifying
multiple values for a setting.

Prior to this commit specifying multiple values for a setting would
blindly replace one occurrence and add the rest, leaving any possible
other occurrences intact. When starting fresh this would not be a
problem, but using it multiple times would add the same settings
repeatedly.

- gitto/config.scm (merge-setting): If the given value is a of type
  `list', replace the `%a' specifier for each item in it.

- gitto/config.scm (merge-settings): Move the handling of the case of
  `v' being a list into `merge-setting'.

- gitto/config.scm (split-setting): Rename `parse-setting' to
  `split-setting'. Return a cons cell instead of a list.

- gitto/config.scm (read-setting): New function.

- gitto/config.scm (read-config): Remove unused variable. Use
  `read-setting' to get the right value for each line of the config
  file.

- gitto/config.scm (write-setting): In case we're dealing with a list,
  print each value separately.
2013-05-29 23:10:26 +02:00
1027b3c7d6 Add user manual to site 2013-05-27 22:51:54 +02:00
e027f3c7e6 Add clean make target 2013-05-27 22:40:37 +02:00
7f6037855d Add user manual 2013-05-27 22:30:00 +02:00
aa0accc977 Add Makefile for zsh/
Installs the ZSH completion module into
`DESTDIR/shar/zsh/site-functions/_gitto'.
2013-05-26 19:09:07 +02:00
Benjamin Althues
5c0189e9ca Add zsh command completion function
Add completion for gitto (sub)commands and arguments for users
of the Z shell.
2013-05-26 18:20:39 +02:00
dd41bb1272 Update README and other files, add site/ 2013-05-26 14:39:45 +02:00
6c05056f84 Allow multiple values for config settings
Setting a list as a value for `global-config' will instruct gitto to
place that setting in the config more than once. For example:

,----
| (set! global-config
|       '(("remote \"origin\""
|          ("url" . "git@somehost.com:~a.git")
|          ("pushurl" "git@somehost.com:~a.git"
|                     "git@someotherhost.com:user/~a.git"))))
`----

Will produce output similar to:

,----
| [remote "origin"]
|         url = git@somehost.com:repo-name.git
|         pushurl = git@somehost.com:repo-name.git
|         pushurl = git@someotherhost.com:user/repo-name.git
`----

The ordering may vary depending on what was already found in the
`origin' remote's settings.

gitto doesn't know or care which settings can and cannot appear more
than once in a configuration, it is up to the user to provide valid
values.
2013-05-25 20:49:55 +02:00
439a262ec4 Add simple hook management
Introduces a new user configuration variable `hook-alist', which
specifies which hooks to link to which executables, for example:

,----
| (set! hook-alist '(("commit-msg" . "/path/to/my/commit/msg/hook")))
`----

With this setting the command `config hooks' will install
`/path/to/my/commit/msg/hook' to the `commit-msg' hook of each
repository not in the `config-exclusion-list' setting.
2013-05-25 20:29:33 +02:00
8b3f0d16d3 Ask to merge settings when registering repo
The `add' command will ask the user if they would like to merge their
settings with the newly registered repository's if the current input
is a tty and if the user has specified some settings.

The default for this is `#t', so pressing <RET> when presented with
this question will merge the settings, however if the user is never
asked (because the input is not a tty) no merge will happen.
2013-05-23 23:11:10 +02:00
cd8a7c310c Add DESTDIR as prefix to extension destination
The `pkg-config' program needs to know about the prefix DESTDIR to
determine where the files in `src/' should be installed. If this
option is not passed along to `pkg-config' it will always try to
install in `/usr/'.
2013-05-23 22:05:50 +02:00
1be9047b00 Update help message 2013-05-21 03:00:56 +02:00
7cf38f5121 Change name 2013-05-20 23:42:31 +02:00
70eca89c39 Add simplistic command structure
Now instead of using `gitto --register' or `gitto -r' one would use
`gitto add'. Here is the list of what was and what is:

--version, -v      => version
--help, -h         => help
--register, -r     => add
--remove, -R       => remove
--repositories, -l => list locations
--purge, -p        => purge
--check, -c        => check
--config, -C       => config
--global-config    => config global
--update-config    => config update

Running gitto without arguments keeps the same functionality, though
it can also be called as `gitto list'.
2013-05-20 22:27:20 +02:00
e293a71f9c Remove docstring from config-exclusion-list
Apparently that is not the right place for a docstring, I must have
been thinking about emacs lisp.
2013-05-20 20:39:56 +02:00
e2c303c420 Add exclusion list
The variable `config-exclusion-list' can be used to specify project
names that should not have their configuration overwritten by
`gitto --update-config'. It is a normal list of strings which name the
repositories that should be left alone, like so:

    (set! config-exclusion-list '("repo1" "repo2" "repo3"))
2013-05-19 23:05:31 +02:00
d2db2dfb53 Add config management commands
These commands parse the git configuration file and, merge settings
defined in the rc.scm and print out the resulting configuration.
2013-05-17 01:02:39 +02:00
964756b730 Split git function into separate module 2013-05-12 20:37:54 +02:00
a3d1cc969f Fix some bugs
- The `register-repository' procedure was using a non-existent
  procedure `repository-name', this should be `repo-name'.

- The `purge' procedure was working on a collection of `<repository>'
  objects, but assuming they were file names, the `repo-location'
  should first be extracted before calling `file-exists?'.
2013-05-12 15:03:00 +02:00
addf53abed Fix error when XDG_*_HOME is specified
Unlike some other lisps scheme's `unless' returns `#<unspecified>'
instead of nil, and `string-append' doesn't accept this as a valid
argument. So use an empty string if XDG_*_HOME has been specified and
FALLBACK otherwise.
2013-05-10 21:58:31 +02:00
87217e9858 Show status per branch
Instead of looking at the current HEAD, look at each branch
separately. This also means that if you customize the `print' method
in your init file you should also go over all the branches. You can
now also customize the `print' method for the `<branch>' type.
2013-05-05 19:27:36 +02:00
387e3f1c67 Turn format function into a generic method
This changes the way formatting functions can be customized in the init
file to:

,----
| (define-method (print (repo <repository>))
|   (format #t "~a: ~d up; ~d down; ~a. Updated ~a~%"
|           (repo-name repo) (repo-pushable repo) (repo-pullable repo)
|           (if (repo-clean? repo) "clean" "dirty") (repo-updated repo)))
`----

Note that it is possible that REPO doesn't exist, so you should always
check for that first.
2013-05-05 18:18:18 +02:00
3ddbd6c743 Use lazy evaluation to speed-up startup
Before using goops the relevant information was gathered when it was
needed, but now with goops everything is gathered at startup. So use
lazy evaluation to defer that gathering until it is needed.
2013-05-05 16:31:16 +02:00
fb61517ac1 Use goops to encapsulate repositories 2013-05-05 14:50:46 +02:00
fc17fbd0e0 Separate repository line formatting into format-repository
This way people can override this function in their RC files, and
specify what information they would like to see where.

They would do this with, for example:

,----
| (set! format-repository
|       (lambda (name pushable pullable clean? updated)
|         (format #t "~a: ~d up; ~d down; ~a. Updated ~a\n"
|                 name pushable pullable (if clean? "clean" "dirty")
|                 updated)))
`----

To turn each line into the like of:

,----
| gitto: 1 up; 0 down; dirty. Updated 4 months ago
`----
2013-05-05 03:04:47 +02:00
77513487aa Load an initialization file at startup
This file is located either in XDG_CONFIG_HOME or, in case
XDG_CONFIG_HOME is empty, in HOME/.config/gitto.
2013-05-05 02:51:36 +02:00
c688bfb73e Try : instead of #+BEGIN_EXAMPLE
It might be parsed better by some parsers, let's see.
2013-01-20 13:24:48 +01:00
09ace1bc4b Replace README.markdown with README.org
And add .0 to version
2013-01-20 13:20:52 +01:00
6246b977c3 Add -p option to help and fix typo
The `-p' option was already implemented, but it wasn't yet explained
in the help output.
2013-01-20 13:03:58 +01:00
f64b974f27 Bump version 2012-10-17 23:56:46 +02:00
86c81c89ab Checkdoc-suggested changes 2012-10-17 23:48:20 +02:00
944001ce94 Add unregister command to emacs interface
* emacs/gitto.el (gitto-registered-p): New function.
  (gitto-unregister): New command
  (gitto-register): Add docstring.
2012-10-17 23:46:31 +02:00
8e71888602 Doc update 2012-10-17 01:45:16 +02:00
3c81ade7bf Tiny style cleanup 2012-10-17 01:41:21 +02:00
aedb4491bd Add check command
Checks to see if the specified directory has been registered.
2012-10-17 01:40:01 +02:00
8866cc66c3 Add emacs interface
Only has a `gitto-register' function for now.  Just a start.
2012-10-16 22:47:48 +02:00
b585ff11d0 Use ? for bool values 2012-09-26 00:22:32 +02:00