Commit graph

100 commits

Author SHA1 Message Date
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
0b9682ea2b Add --purge
`--purge' deletes all the repositories from gitto that don't exist on
the filesystem (anymore).
2012-09-26 00:21:06 +02:00
0bcd0b9c5a If PATH_MAX is defined, use it 2012-09-18 19:58:32 +02:00
395436103f Check if we know the argument to -R
If we don't, fail in getopt-long.
2012-09-18 19:46:14 +02:00
b66ceb70f7 Don't fail with no-longer existing repos
When a repo is in the repositories list, but not where it should be,
don't care, if we know it, delete it.

Don't require the argument for delete to exist on the filesystem.
2012-09-18 19:38:30 +02:00
963c85b479 Return #f when no path is found
Return `SCM_BOOL_F' when `realpath' can't find the path.
2012-09-18 19:35:54 +02:00
d47e68fe21 Don't fail when a repository can't be found
Report it instead.
2012-09-18 08:47:35 +02:00
2f0fd8d03e Use guile-snarf
Because it looks cooler.

This way its easy to keep all the information about the function in
one place, and it makes it easier/more interesting to add new
functions later.
2012-08-01 21:12:09 +02:00
f7016aea18 Add GPL comments 2012-07-31 02:48:00 +02:00
7ca2408b51 Add relative directory parsing
As of now, when using `-r' or `-R', relative directories can be used.
This *does not* include locations starting with `~', those still need
to be handled by your shell.

Because every repo is treated as a possible relative path, and thus
passed on to `realpath', the paths have become very uniform.  This
means that it will now only register and unregister paths that don't
have a trailing `/'.  This is not true during usage, so those paths
still work, but they can't be removed by gitto, and adding them again
will create a duplicate entry.

* gitto/Makefile (objects): Add `path.scm' and `path.go'.

  (.PHONY): Add `all' as a phony target.

  (all): New target, compiles all `.go' targets.

  ($(filter %.go,$(objects))): Use `env' to run guild so that include
  paths are setup properly.

* gitto/main.scm (gitto): Use new `(gitto path)' module, it contains
  the `realpath' function.

  (register-repository):
  (remove-repository): Always pass REPOSITORY through `realpath' and
  use the result.

* gitto/path.scm: New file. Loads the `libguile-gitto-path' extension
  and exports its `realpath' function.

* src/Makefile (CFLAGS):
  (LDFLAGS): Use `pkg-config' to gather the necessary values for guile.

  (libguile-gitto-path.so): New guile extension, wraps the `readline'
  POSIX function.

* src/gitto-path.c: New file, wraps and exports the `realpath' POSIX
  function from `stdlib.h'.
2012-07-31 02:40:56 +02:00
731fba1dc4 Fix unterminated variable reference 2012-07-31 02:26:34 +02:00
a0fb2ed62c Seperate settings to env
Set environment settings in `env' and have `run-gitto' use it, this
makes it easy for other commands (like make) to utilize this as well.

* env: New file, set environment variables needed to do anything with
  gitto outside of an installed state.

* run-gitto: Move environment settings to `env' and just run it.
2012-07-31 02:21:38 +02:00
124de5657f Update/add docstrings 2012-07-08 23:18:39 +02:00
b836a9b02f Use guild, not guile tools
`guile-tools' only still exists for compatibility with guile-1.8, but
it has been renamed to `guild'.
2012-07-04 22:19:38 +02:00
7c96197cff Compile main.go before installing 2012-07-04 22:11:55 +02:00
cf2ba48313 Add GPL license and necessary comments 2012-07-01 23:23:11 +02:00
c9515188ab Shorten line 2012-07-01 22:42:42 +02:00
984abc17b3 Make installation a bit better
Installation now goes into the official site directories for guile,
both for *.go as *.scm.
2012-07-01 22:41:19 +02:00
884bb23ad3 Handle brand-new repositories better
stderr from the underlying git process was not being
redirected/ignored properly, now somewhat more.  If EOF is encountered
when asking for the last update date it is shown as "never".
2012-07-01 20:47:45 +02:00
6da8b42171 Sort repositories
Upon saving, sort the repositories alphabetically by `basename'.  When
`-l' is provided sort before output by location.
2012-07-01 20:25:03 +02:00
58dcd2fa57 Add Last update to normal output
When viewing the status of your repositories you will now see also
when your last update to the upstream branch was. If you have not
fetched or pulled the latest changes from your upstream, this will not
be accurate.
2012-07-01 20:03:59 +02:00
4bcea9254e Minor style change 2012-07-01 17:49:45 +02:00
4820492a55 Add switch to list saved repository locations 2012-07-01 17:45:46 +02:00
df9ad8f162 It seems github only knows .markdown 2012-07-01 02:21:01 +02:00
ebdd87d212 Update README 2012-07-01 02:19:27 +02:00
ac87cfb21c Reserve 15 columns for names
Align data about a repository at 15 characters, for now. Looks a
little bit cleaner.
2012-07-01 01:50:55 +02:00
d7a622d4ba Add Makefiles, utility
Change the directory structure and add a bunch of Makefiles to make it
easy to install gitto. Also add a utility to run gitto in its current
state.
2012-07-01 01:42:15 +02:00
5e17738e22 Use normal guile executable
My guile-2.0 was located in a somewhat strange place, I've fixed this
now.
2012-06-30 23:29:47 +02:00
968543cd3c Don't force XDG_DATA_HOME
Now, when XGD_DATA_HOME is empty, it should default to `~/.gitto/' for
`data-dir', the old way didn't quite work since the `mkdir' function
doesn't translate `~/' to HOME.
2012-06-30 23:09:37 +02:00
4379c6666d Minor style adjustments 2012-06-30 13:02:55 +02:00
834855c0b3 Add remove function
When using this program it might happen that you have added a
repository that you would like to have removed, now that is possible.
2012-06-30 12:57:30 +02:00
8b7ad95ade Woops, forgot to change that name 2012-06-30 12:33:42 +02:00
923133329a Initial commit 2012-06-30 03:25:33 +02:00