Commit Graph

100 Commits

Author SHA1 Message Date
Tom Willemse 987a6137a7 Merge remote-tracking branch 'babab/tippo' 2015-07-12 12:31:54 +02:00
Benjamin Althues 7804cc2af1 Small typofix: je -> the 2015-07-12 10:55:45 +02:00
Tom Willemse b8dc0c68b7 Add documentation for the push command 2014-03-04 21:41:30 +01:00
Tom Willemse 420b55c52c Add push command 2014-03-04 21:35:36 +01:00
Tom Willemse 3c831f9381 Allow a name to be used to remove a repository
Allow users to specify a name instead of a path to remove a repository
from the repository list. Paths may also still be used.
2014-03-04 00:06:51 +01:00
Tom Willemse 53db54e71d Extract RC loading from main 2014-03-02 00:12:58 +01:00
Tom Willemse 7a0c947c10 Simplify the remove command 2014-03-02 00:01:07 +01:00
Tom Willemse bc4555b0dd Simplify purge command 2014-03-01 21:18:39 +01:00
Tom Willemse dba15ac990 Promote hookwrapper to procedure 2014-03-01 21:18:39 +01:00
Tom Willemse aacc242fb3 Extract print-config 2014-03-01 21:18:39 +01:00
Tom Willemse 9df3b848e0 Simplify save-repositories-list
Simplify `save-repositories-list' by extracting some of the
functionality into its own procedures.

Since there is now a `repository-name<?' procedure the `repository<?'
procedure is renamed to `repository-location<?' for clarity and
accuracy, since that is what it really checks.
2014-03-01 21:18:39 +01:00
Tom Willemse 95125d682c Simplify list-repository-locations
Simplify `list-repository-location' by extracting the lambda's used and
defining them as separate procedures.
2014-03-01 20:30:08 +01:00
Tom Willemse ea945c83fa Reorder variables and procedures 2014-03-01 20:09:47 +01:00
Tom Willemse 2dd972c770 Reorder commands 2014-03-01 20:06:12 +01:00
Tom Willemse e72c093057 Split known? into a couple of functions 2014-03-01 20:00:02 +01:00
Tom Willemse d5f38b4f6d Move help command to its own module 2014-03-01 19:59:46 +01:00
Tom Willemse 78b63229f6 Separate command operations into module
Separate and encapsulate operations on commands in their own module.
This gives a more clearly defined API to the commands and will allow
other modules to specify commands as well.
2014-03-01 14:08:23 +01:00
Tom Willemse 73961321ff Extract some functions from the help command
Simplify the `help' command by extracting the code into separate
functions.
2014-03-01 13:24:58 +01:00
Tom Willemse 3036734e4b Extract hooks init from config 2014-01-28 23:38:07 +01:00
Tom Willemse 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
Tom Willemse d1245a3d7f Add docs about new parameters 2013-11-11 00:12:06 +01:00
Tom Willemse 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
Tom Willemse 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
Tom Willemse 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
Tom Willemse aab22cbb6e Make gitto.el work with the latest gitto 2013-10-13 00:42:54 +02:00
Tom Willemse 87a300c389 Add warnings when compiling
They help catch some easy to overlook mistakes.
2013-06-08 01:05:23 +02:00
Tom Willemse 39b5431da1 Specify usage information in the command 2013-06-08 01:04:45 +02:00
Tom Willemse 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
Tom Willemse 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
Tom Willemse 5f3dfee5ac Use a macro to define commands 2013-06-05 00:58:16 +02:00
Tom Willemse c00a0ca730 Add some docstrings 2013-05-31 23:41:16 +02:00
Tom Willemse 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
Tom Willemse 1027b3c7d6 Add user manual to site 2013-05-27 22:51:54 +02:00
Tom Willemse e027f3c7e6 Add clean make target 2013-05-27 22:40:37 +02:00
Tom Willemse 7f6037855d Add user manual 2013-05-27 22:30:00 +02:00
Tom Willemse 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
Tom Willemse dd41bb1272 Update README and other files, add site/ 2013-05-26 14:39:45 +02:00
Tom Willemse 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
Tom Willemse 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
Tom Willemse 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
Tom Willemse 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
Tom Willemse 1be9047b00 Update help message 2013-05-21 03:00:56 +02:00
Tom Willemse 7cf38f5121 Change name 2013-05-20 23:42:31 +02:00
Tom Willemse 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
Tom Willemse 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
Tom Willemse 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
Tom Willemse 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
Tom Willemse 964756b730 Split git function into separate module 2013-05-12 20:37:54 +02:00
Tom Willemse 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