threads / announce / 9804

[announce] colgit: manage git repository collections

Subject: [announce] colgit: manage git repository collections

## tl;dr

3 messages between Sep 6, 2007 and Oct 22, 2007.

replies: 2people: 1as markdown or json

martin f krafft· Sep 6, 2007, 10:11 UTC · lore

[Ob crosspost: please keep vcs-home on Cc all times. Please remove git mailing list from Cc when the reply isn't enough about git]

Dear colleagues,

Last night, while Andy Roddick was giving his best against bored world champion Roger Federer (and still lost after a game of many crazy shots), I reached what I think is a milestone in my attempt to let git manage my home directory across several machines. I called it colgit, which attempts to hint at "collection of gits", and this is the birth announcement of this shell script.

  http://git.madduck.net/v/bin/colgit.git

The problem I am trying to solve is that I maintain different projects in different repos, including scripts in ~/.bin and configuration files, and that I use multiple computers on a daily basis. Moreover, I might happen upon a new computer which I have to use for a few days and would like to be able to set up my account easily.

With SVN, I'd have a repository for each machine, which existed only of svn:externals references pulling in other repos and thus assembling my home directory. git-submodule isn't quite designed for this sort of stuff, and thus I came up with colgit.

The idea is simple: ~ is a git repository with a .colgit/ directory, which hosts a hierarchy of directories holding a selection of files from .git directories. For instance, ~/.colgit/.etc/mutt/config is the git-config file for the repository that I want to have in ~/.etc/mutt. Since all of ~/.colgit is checked in to the repo in ~, I can easily clone that for another machine, or branch from it and add yet other repositories, or remove some.

Each directory in ~/.colgit can also hold hooks, description, and info/exclude, which are used to seed the repository in the plain ~ hierarchy. Right now, the design requires a central repository and appropriate remote.origin.*/branch.master.merge entries in the config file so that it can initialise repositories on new machines.

colgit currently is still very much a hack, but it already sports the following commands:

  update/init: for each leaf directory in ~/.colgit, create the
  corresponding repository in ~, seed it, and run git-pull. If the
  respository already exists, just pull.
  register: given an existing repository somewhere under ~, obtain
  the relevant config files from its $GIT_DIR and populate the
  corresponding directory under ~/.colgit.
  status: for each leaf directory in ~/.colgit, query the
  corresponding repository in ~ and note to stdout if it has local
  changes
I also envision the following commands:
  add: given a repository URL and a local path, clone the repository
  and run register
  do: run the given git commands over each known repository

The process of initialising an account on a remote machine thus becomes:

  git clone -n ssh://.../machines/base temp && mv temp/.git ~
  cd ~ && git checkout HEAD
  ...
  colgit init

This is release early release often, so it's far from perfect and and probably buggy. But suggestions and patches are welcome!

-- 
martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck
 
# vim:tw=70
 
spamtraps: madduck.bogus@madduck.net
martin f krafft· Sep 6, 2007, 13:15 UTC · re: martin f krafft · lore

Re: [announce] colgit: manage git repository collections

also sprach martin f krafft <madduck@madduck.net> [2007.09.06.1211 +0200]:
> With SVN, I'd have a repository for each machine, which existed only
> of svn:externals references pulling in other repos and thus
> assembling my home directory. git-submodule isn't quite designed for
> this sort of stuff, and thus I came up with colgit.

You might want to read over this short discussion between Peter and I on why git-submodules aren't up for the task:

  http://colabti.de/irclogger/irclogger_log/git?date=2007-09-06,Thu&sel=578#l979
Cheers,
-- 
martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck
 
"'the answer to the great question...'
 'of life, the universe and everything...' said deep thought.
 'is...' said deep thought, and paused.
 'is...'
 'forty-two,' said deep thought, with infinite majesty and calm."
                                 -- hitchhiker's guide to the galaxy
 
spamtraps: madduck.bogus@madduck.net
martin f krafft· Oct 22, 2007, 14:23 UTC · re: martin f krafft · lore

deprecating colgit

Dear list(s),

I would like to deprecate colgit [0] in favour of Joey Hess' mr [1], which does everything colgit did, and much more.

0. http://lists.zerezo.com/git/msg629629.html
1. http://kitenet.net/~joey/code/mr/

If you have not seen mr, well, basically it manages collections of repositories, like colgit aspired to do, but Joey made it vcs-agnostic and much more robust. It's definitely worth checking out.

-- 
martin;              (greetings from the heart of the sun.)
  \____ echo mailto: !#^."<*>"|tr "<*> mailto:" net@madduck
 
"if a man treats life artistically, his brain is his heart."
                                                        -- oscar wilde
 
spamtraps: madduck.bogus@madduck.net

← back to recent threads