Keep track of your git repositories
Find a file
Tom Willemsen 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
gitto Add relative directory parsing 2012-07-31 02:40:56 +02:00
src Add relative directory parsing 2012-07-31 02:40:56 +02:00
COPYING Add GPL license and necessary comments 2012-07-01 23:23:11 +02:00
env Seperate settings to env 2012-07-31 02:21:38 +02:00
Makefile Add Makefiles, utility 2012-07-01 01:42:15 +02:00
README.markdown It seems github only knows .markdown 2012-07-01 02:21:01 +02:00
run-gitto Seperate settings to env 2012-07-31 02:21:38 +02:00

Gitto

For lack of a better title.

My simple utility to keep track of all the git repositories I have on my computer(s). Also an experiment in writing scheme.

Written for guile 2.0.x

Installation

Installing gitto is not really necessary, but it is more convenient. In order to install it just run:

# make install

This will install gitto to /usr/local/, if you would like it somewhere else you could use the DESTDIR variable:

# make install DESTDIR=/some/other/place

This will install gitto to /some/other/place/.

Removal

If you're fed up with gitto and want it gone, and I do mean now, you can run:

# make uninstall

This will remove any gitto installed files from /usr/local/, if you used the DESTDIR variable during installation, you should give it the same value here, like:

# make uninstall DESTDIR=/some/other/place

This will remove any gitto installed files from /some/other/place/.

Usage

Usage is, hopefully, simple, first you have to register some repos:

$ gitto -r ~/projects/project1
$ gitto -r ~/projects/project2
$ gitto -r ~/projects/project3

Then you can call gitto without any argument to see a list of your repos and their statuses:

$ gitto
project1:      0 to push, 0 to pull and is dirty
project2:      5 to push, 2 to pull and is not dirty
project3:      0 to push, 1 to pull and is not dirty

If you're done with one of your projects and no longer wish to track their status you can unregister them:

$ gitto -R ~/projects/project1

If you require further assistance:

$ gitto -h

run-gitto

As I mentioned, it is not completely necessary to install gitto, I have added a utility to run it straight from je project directory, although mostly for testing purposes.

Using run-gitto works exactly the same as using gitto when it is installed.