Git.alt: Difference between revisions

From ALT Linux Wiki
(Translated sections about ls and find-package)
(Moved git.alt reference from /Git.alt to /Git.alt_reference, according to changes in the Russian version of the wiki)
Line 1: Line 1:
{{stub}}
[[ru:Git.alt]]
[[ru:Git.alt]]
== What is <tt>git.alt</tt>? ==
== What is <tt>git.alt</tt>? ==


<tt>git.alt</tt> is a hosting for git repositories. Git.alt is integrated with [[Gear|<tt>gear</tt>]]&nbsp;&mdash; the system of packages building and storage.
<tt>git.alt</tt> is a hosting for git repositories designed according to the needs of Sisyphus developers. Git.alt is integrated with [[Gear|<tt>gear</tt>]]&nbsp;&mdash; the system of packages building and storage.


Services similar to Git.alt are [http://github.com/ github] and [http://gitorious.com/ gitorious]. <tt>git.alt</tt> differs from them in its advanced SSH repositories management interface, e-mail notifications of many kinds and relatively simplistic web-interface.
Services similar to Git.alt are [http://github.com/ github] and [http://gitorious.com/ gitorious]. <tt>git.alt</tt> differs from them in its advanced SSH repositories management interface, e-mail notifications of many kinds and relatively simplistic web-interface.


== How to use? ==
== Documentation ==
 
<tt>git.alt</tt> provides the following kinds of access to the repositories:
 
* SSH. Special commands are provided: repos search, cloning, creation, deletion, build invocation and control, and some auxiliary ones.
* <tt>ssh:</tt>, <tt>git:</tt>, <tt>http:</tt> provide immediate access to repositories. With <tt>git:</tt> and <tt>http:</tt> you can only do read-only operations, <tt>ssh:</tt> gives read-write access.
* Web interface. It is located here: http://git.altlinux.org/ and provides repos navigation and <tt>gitweb</tt> for each individual repo.
 
SSH access to <tt>git.alt</tt> is only granted to persons who [[Join|joined]] ALT Linux Team.
 
=== SSH access ===
 
You can use <tt>git.alt</tt> via SSH at <tt>git.altlinux.org:222</tt>. The login name is your ALT Linux Team username with _ (underscores) instead of - (hyphens), if there are any.
 
Here is an example of an entry in your <tt>~/.ssh/config</tt> file:
Host git.alt
  HostName git.altlinux.org
  Port 222
  User git_USERNAME
 
If your are behind a proxy, most ports are blocked etc., you can also access SSH with the address <tt>git.altlinux.org:443</tt>.
 
The list of available commands is displayed, when you login to SSH without commands or with <tt>help</tt> command:
 
$ ssh git.alt help
Available commands:
help
git-receive-pack <directory>
git-upload-pack <directory>
charset <path to git repository> [<charset>]
clone <path to git repository> [<path to directory>]
find-package <pattern>
init-db <path to directory>
ls [<path to directory>]
mv-db <path to source directory> <path to destination directory>
quota
rm-db <path to git repository>
task {list|new|show|drop|add|run} ...
build <path to gear repository> <tag name> [<binary package repository name>] [<project name>]
$
 
In all commands, the .git suffix for repositories is optional and may be omitted; but in the output of commands this suffix is always appended.
 
==== ls ====
 
'''$ ssh git.alt ls [<directory>]'''
 
Similar to UNIX ls, this command lets you see contents of directories at <tt>git.alt</tt>:
 
$ ssh git.alt ls /people/dottedmag/public
total 24
drwxr-sr-x 5 4096 Jun 13 10:22 bugzilla-repo-sync.git
...
drwxr-sr-x 5 4096 Jul  7 18:03 wackoconvert.git
$
 
The command issued without parameters displays the contents of <tt>/people/$USERNAME</tt>:
 
$ ssh git.alt ls
total 16
drwxr-s---  5 4096 May 30 21:27 etc
drwxr-sr-x 14 4096 Aug 13 23:53 packages
drwxr-s--x  2 4096 Feb 13  2007 private
drwxr-sr-x  8 4096 Aug 13 23:57 public
$
 
The same directory is used as a base for relative paths:
 
$ ssh git.alt ls public
total 24
drwxr-sr-x 5 4096 Jun 13 10:22 bugzilla-repo-sync.git
...
drwxr-sr-x 5 4096 Jul  7 18:03 wackoconvert.git
$
 
==== find-package ====
 
'''$ ssh git.alt find-package <pattern>'''
 
This command searches repositories with names matching <pattern>. The only wildcard character allowed in <pattern> is <tt>*</tt> (asterisk). It is assumed that all public <tt>gear</tt>-repos are located in <tt>packages</tt> directories of each user, so repos are only searched in these directories.
 
$ ssh git.alt find-package glibc*
/people/avm/packages/glibc.git 1216320095
...
/people/peet/packages/glibc-kernheaders.git 1177084354
/people/mike/packages/glibc-kvercheck.git 1160664813
$ ssh git.alt find-package glibc
/people/avm/packages/glibc.git 1216320095
...
/people/peet/packages/glibc.git 1177084600
$
 
The second column in tt>find-package</tt> output is a unixtime of the last repo update.
 
<!--==== clone ====
 
'''$ ssh git.alt clone <path to git repository> [<destination directory>]'''
 
Эта команда позволяет склонировать создать в своей директории копию репозитория для начала работы над ним.
 
Без второго аргумента — клонирует в директорию <tt>packages</tt>:
 
$ ssh git.alt clone /people/ldv/glibc.git
Initialized empty Git repository in /people/dottedmag/packages/glibc.git/
$
 
Вторым аргументом можно указать как директорию, в которую нужно поместить клон репозитория, так и название репозитория:
 
$ ssh git.alt clone /people/ldv/glibc.git public
Initialized empty Git repository in /people/dottedmag/public/glibc.git/
$ ssh git.alt clone /people/ldv/glibc.git public/test
Initialized empty Git repository in /people/dottedmag/public/test.git/
$
 
Можно также склонировать репозиторий, находящийся вне <tt>git.alt</tt>:
 
$ ssh git.alt clone <nowiki>http://github.com/dottedmag/madshelf.git</nowiki> public
Initialized empty Git repository in /people/dottedmag/packages/public.git/
Getting alternates list for <nowiki>http://github.com/dottedmag/madshelf.git</nowiki>
...
walk 03d18e21d85fa30fc3ac8d921eb391e2a7bb242a
$
 
==== init-db ====
 
'''$ ssh git.alt init-db <path to directory>'''
Позволяет создать новый git-репозиторий. По умолчанию репозиторий создаётся в директории <tt>packages</tt>:
$ ssh git.alt init-db test
Initialized empty Git repository in ./
girar-init-db: /people/dottedmag/packages/test.git
При указании пути создаёт репозиторий по указанному пути:
$ ssh git.alt init-db public/test
Initialized empty Git repository in ./
girar-init-db: /people/dottedmag/public/test.git
 
==== mv-db ====
 
'''$ ssh git.alt mv-db <path to source directory> <path to destination directory>'''
Позволяет перемещать и переименовывать свои репозитории. При указании только имени репозитория подразумевается директория <tt>packages</tt>.
 
Перемещение packages/test.git в public/newname.git:
$ ssh git.alt mv-db test public/newname
$
Перемещение public/newname.git в packages/test.git:
$ ssh git.alt mv-db public/newname test
$
Переименовывание packages/test.git в packages/megatest.git:
$ ssh git.alt mv-db test megatest
$
 
==== rm-db ====
 
'''$ ssh git.alt rm-db <path to git repository>'''
Позволяет удалять свои репозитории. При указании только имени репозитория подразумевается директория <tt>packages</tt>:
$ ssh git.alt rm-db megatest # удаляет packages/megatest.git
$ ssh git.alt rm-db public/test
 
==== Вспомогательные команды ====
 
===== charset =====
 
'''$ ssh git.alt charset <path to git repository> [<charset>]'''
 
Позволяет узнать или установить кодировку, отдаваемую web-сервером при отдаче raw-файлов указанного git-репозитория:
 
$ ssh git.alt charset packages/glibc
utf-8
$ ssh git.alt charset packages/glibc cp1252
$ ssh git.alt charset packages/glibc
cp1252
$
 
===== quota =====
 
'''$ ssh git.alt quota'''
 
Позволяет узнать квоту и занимаемое пользователем дисковое пространство.
 
$ ssh git.alt quota
      Filesystem  blocks  quota  limit  grace  files  quota  limit  grace
      /dev/simfs  16932    977M  1465M            555    100k    150k       
$
 
==== git-receive-pack, git-upload-pack, task, build ====
 
TODO
 
=== Клонирование и работа с репозиториями ===
 
=== Web-интерфейс ===
 
== Структура репозиториев ==
 
<tt>git.alt</tt> содержит два дерева репозиториев:
 
* репозитории <tt>/people/$USERNAME</tt> для каждого зарегистрированного пользователя
* репозитории <tt>/archive</tt> для пакетов Sisyphus
 
=== /people ===
 
Каждому зарегистрированному на git.alt разработчику предоставляется место для git-репозиториев, начинающееся с <tt>/people/$USERNAME</tt>. Структура для хранения репозиториев жёстко определена:
 
==== /people/$USERNAME/etc ====
 
Содержит репозитории <tt>packages.git</tt>, <tt>private.git</tt>, <tt>public.git</tt>, с помощью которых можно управлять [[#Почтовая подписка|почтовой подпиской]].
 
==== /people/$USERNAME/packages ====
 
Директория предназначена для хранения gear-репозиториев для пакетов Сизифа. Публично доступна.
 
git-репозитории в этой директории будут искаться при выполнении команды <tt>find-package</tt>, и эта директория будет использоваться по умолчанию в командах <tt>init-db</tt>, <tt>clone</tt>, <tt>build</tt>.
 
==== /people/$USERNAME/private ====
 
Директория предназначена для хранения приватных репозиториев, о существовании и содержании которых должно быть известно только самому разработчику.
 
Для удобства работают прямые http-ссылки на файлы репозиториев, размещённых в этой директории.
 
==== /people/$USERNAME/public ====
 
Директория предназначен для хранения публичных git-репозиториев, не являющихся gear-репозиториями для пакетов Сизифа.
 
=== /archive ===
 
В этой директории размещаются gear-репозитории пакетов Sisyphus. Поскольку репозиторий для каждого пакета создаётся с помощью утилиты <tt>gear-srpmimport</tt> на основе прошедших <tt>incoming</tt> <tt>src.rpm</tt>-пакетов, а не на основе <tt>gear</tt>-репозитория, из которых были собраны <tt>src.rpm</tt>, то репозиторий /archive следует использовать для разработки только в том случае, когда <tt>gear</tt>-репозиторий для пакета отсутствует.
 
== Почтовая подписка ==
 
== Сборка пакетов в Sisyphus ==
 
== Работает от ==


<tt>git.alt</tt> работает при помощи комплекса утилит <tt>girar</tt>, исходный код которых можно найти [http://git.altlinux.org/people/ldv/packages/?p=girar.git;a=summary здесь].
* [[Git.alt reference]]
-->
* [http://www.altlinux.org/Git Unsorted articles on Git.alt, Gear and Git (in Russian)]

Revision as of 06:56, 16 August 2008

What is git.alt?

git.alt is a hosting for git repositories designed according to the needs of Sisyphus developers. Git.alt is integrated with gear — the system of packages building and storage.

Services similar to Git.alt are github and gitorious. git.alt differs from them in its advanced SSH repositories management interface, e-mail notifications of many kinds and relatively simplistic web-interface.

Documentation