[plt-dev] usr repositories

From: Eli Barzilay (eli at barzilay.org)
Date: Fri Apr 16 04:25:26 EDT 2010

On Apr 15, Eli Barzilay wrote:
> 
> On Apr 15, Noel Welsh wrote:
> > That's it. This is equivalent to using svn apart from the first
> > step which is slightly simpler in svn (just create a new directory
> > in the existing repo in svn).
> 
> The setup that I'm using will make it as easy as svn.  (A little
> easier, since you'd be able to do it without me being a bottleneck.)

I've made it possible to create user repositories now.  The bottom
line is:

  git clone git at git.racket-lang.org:usr/<you>/path/to/repo

will create a repository.

Here's an commented example:

  winooski:~/tmp eli> git clone git at git:usr/eli/foo
  Initialized empty Git repository in /home/eli/tmp/foo/.git/
  Initialized empty Git repository in /home/git/repos/usr/eli/foo.git/
  warning: You appear to have cloned an empty repository.

`git clone' of a repository that does not exist in a path of usr/<you>
will create it.  (Note that this creates a local repository to receive
the remote clone, then the remote clone is created, and finally git
warns you that it's empty, which is expected here.)  (Note also that
the server name is just `git', since I have an entry in my ssh config
file.)

  winooski:~/tmp eli> cd foo
  winooski:~/tmp/foo eli> echo "Hi" > bleh.txt
  winooski:~/tmp/foo eli> git add .
  winooski:~/tmp/foo eli> git ci -m "random stuff"
  [master (root-commit) 4c6c2f4] random stuff
   1 files changed, 1 insertions(+), 0 deletions(-)
   create mode 100644 bleh.txt

I created and committed a file.

  winooski:~/tmp/foo eli> git push origin master
  Counting objects: 3, done.
  Writing objects: 100% (3/3), 216 bytes, done.
  Total 3 (delta 0), reused 0 (delta 0)
  To git at git:usr/eli/foo
   * [new branch]      master -> master

Now I pushed my master branch to the server.

  winooski:~/tmp/foo eli> ssh git
  hello eli, the gitolite version here is v1.3-32-g813a2a9
  you have the following permissions:
     @ W	play
     @ W	plt
     @ @	testing
   C    	usr/CREATER/.*
  Connection to git.racket-lang.org closed.

Just ssh-ing to the machine (not: this is *not* a git command, it is
intercepted by the gitolite server) shows my permissions.  The last
line shows where I'm allowed to create repositories -- in this case
`CREATER' is where I put my username.

  winooski:~/tmp/foo eli> ssh git expand
     @ W	<gitolite>	play
     @ W	<gitolite>	plt
     @ @	<gitolite>	testing
     R W	(eli)	usr/eli/foo

This server command `expand's the previous pattern, so it shows me the
actual repositories I have access to instead of the pattern --
together with the user that created them.

  winooski:~/tmp/foo eli> ssh git getperms usr/eli/foo

This shows me the current permissions on my new repository.  (Again,
this is a server command.)

  winooski:~/tmp/foo eli> ssh git setperms usr/eli/foo

The `setperms' command is used to set new permissions -- it expects
the permissions on its input, which I now type in:

  RW matthias
  R robby

and it replies with:

  New perms are:
  RW matthias
  R robby

The reason for the reply is that usually you'd just put the
permissions in a file and run `ssh git setperms /usr/eli/foo < perms'.

  winooski:~/tmp/foo eli> ssh git getperms usr/eli/foo
  RW matthias
  R robby

Finally, running `getperms' again shows me what I just set.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!


Posted on the dev mailing list.