Git.alt reference

Справочник_по_Git.alt

This page describes git.alt commands; it is not a manual or a tutorial.

How to use
git.alt 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.
 * ssh:, git:, http: and rsync: provide immediate access to repositories. With git:, rsync: and http: you can only do read-only operations, ssh:</tt> gives read-write access.
 * Web interface. It is located at git.altlinux.org and provides repos navigation and gitweb</tt> for each individual repo.

SSH access to git.alt</tt> is only granted to persons who joined ALT Linux Team.

SSH access
You can use git.alt</tt> via SSH at 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 ~/.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 git.altlinux.org:443</tt>.

To work with git.alt</tt> you should setup your git</tt>, namely user.name</tt>, user.email</tt>, and user.signingkey</tt> global parameters: $ git config --global user.signingkey "<Your GPG key ID to sign tags>" $ git config --global user.email "<your maintainer e-mail>" $ git config --global user.name "FirstName LastName" Example: $ git config --global user.signingkey 0xA26F54C8 $ git config --global user.email dottedmag@altlinux.org $ git config --global user.name "Mikhail Gusarov"

The list of available commands is displayed, when you login to SSH with help</tt> command:

$ ssh git.alt help Available commands: help git-receive-pack git-upload-pack charset [ ] clone [ ] find-package init-db ls [ ] mv-db <path to destination directory> quota rm-db task {list|new|show|drop|add|run} ... build [<binary package repository name>] [ ] acl {--help|<binary package repository 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 [ ]

Similar to UNIX ls, this command lets you see contents of directories at 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 /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 

This command searches repositories with names matching. The only wildcard character allowed in is *</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 [ ]

This command clones a repository, i.e. makes a copy of a repository in the specified directory (or in <tt>packages/</tt> directory, if none specified) so that you can start hacking on it.

$ ssh git.alt clone /people/ldv/packages/glibc.git Initialized empty Git repository in /people/dottedmag/packages/glibc.git/ $

You can also specify a repository name instead of just a destination directory as the second parameter:

$ ssh git.alt clone /people/ldv/packages/glibc.git public Initialized empty Git repository in /people/dottedmag/public/glibc.git/ $ ssh git.alt clone /people/ldv/packages/glibc.git public/test Initialized empty Git repository in /people/dottedmag/public/test.git/ $

You can also clone a repository from outside <tt>git.alt</tt>:

$ ssh git.alt clone http://github.com/dottedmag/madshelf.git public Initialized empty Git repository in /people/dottedmag/packages/public.git/ Getting alternates list for http://github.com/dottedmag/madshelf.git ... walk 03d18e21d85fa30fc3ac8d921eb391e2a7bb242a $

init-db
$ ssh git.alt init-db 

Creates a new Git repo. By default, the repo is created in <tt>packages/</tt> directory. $ ssh git.alt init-db test Initialized empty Git repository in ./ girar-init-db:	/people/dottedmag/packages/test.git

You can also pass a path and a name of the repo as the only parameter: $ 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 destination directory> Allows to move and rename repositories. If only a repository name is given (without path), <tt>packages/</tt> directory is used.

Moving packages/test.git to public/newname.git: $ ssh git.alt mv-db test public/newname $ Moving public/newname.git to packages/test.git: $ ssh git.alt mv-db public/newname test $ Renaming packages/test.git to packages/megatest.git: $ ssh git.alt mv-db test megatest $

rm-db
$ ssh git.alt rm-db  Removes a repository. If only a repository name is given (without path), <tt>packages/</tt> directory is used: $ ssh git.alt rm-db megatest # removes packages/megatest.git $ ssh git.alt rm-db public/test

Managing ACLs
The first parameter of <tt>acl</tt> command should be a binary package repository (do not confuse with a git repository), ACLs of which are managed. At the moment there is the only possible value of this parameter, and it is <tt>sisyphus</tt>.

If there is no subcommand after <tt>acl </tt> in the command-line, then subcommands are expected on standard input, one subcommand per line, with EOF (Control-D) terminating the list. The list of subcommands obtained this way is executed as a transaction, i.e. an error in one subcommand cancels the whole bundle. $ ssh git.alt acl sisyphus keyjnote girar-acl: Go ahead and type your commands keyjnote add peet keyjnote add raorn ^D girar-acl: 2 command(s) queued $

Any command that alters the maintainers group or a package ACL, can only be issued by the leader, the maintainer that is the first in the corresponding list of group members or ACL. All such operations are performed asynchronously, the result is sent to the leader's e-mail.

acl show
$ ssh git.alt acl show Displays the ACL of the specified package.

$ ssh git.alt acl sisyphus bugzilla show bugzilla      @nobody

$ ssh git.alt acl @ show Displays members of the specified maintainers group.

$ ssh git.alt acl sisyphus @python show @python       ns ldv george akhavr bga lav swi at hiddenman sin mithraen kas

acl check
$ ssh git.alt acl check Displays allowed/denied status of the command issuer for the specified package.

$ ssh git.alt acl sisyphus bugzilla check girar-check-perms: access to bugzilla ALLOWED for ldv: project is orphaned

acl add/del
'''$ ssh git.alt acl add|del |@ ... Adds/Deletes the specified login or group to/from the specified package ACL.

$ ssh git.alt acl sisyphus keyjnote add damir girar-acl: 1 command(s) queued $ ssh git.alt acl sisyphus keyjnote del damir girar-acl: 1 command(s) queued

'''$ ssh git.alt acl @ add|del |@ ... Add/Delete members to/from the specified maintainers group.

$ ssh git.alt acl sisyphus ns add @python girar-acl: 1 command(s) queued $ ssh git.alt acl sisyphus ns del @python girar-acl: 1 command(s) queued

acl replace
$ ssh git.alt acl |@ replace |@  |@  Replaces the former record in the package ACL with the latter one. Example: $ ssh git.alt acl sisyphus keyjnote replace dottedmag @python Replaces in the ACL of <tt>keyjnote</tt> the record <tt>dottedmag</tt> with <tt>@python</tt>.

acl leader
'''$ ssh git.alt acl leader |@ Sets the package leader. When the group is specified as the latest parameter, the leader of this group becomes the leader of the package. The person that is set as a leader may or may not be in the ACL prior to execution of this command.

Example: $ ssh git.alt acl sisyphus keyjnote leader @python

'''$ ssh git.alt acl @ leader |@ The same as above, but for a maintainers group instead of a package. Again, it is not a pre-requisite for the user that is set as a leader to be in the ACL prior to the operation.

$ ssh git.alt acl sisyphus @python leader ns

acl nmu
$ ssh git.alt acl nmu add|del [ [ [ ]]] Allows/Denies a non-maintainer upload (NMU) for the specified package.

Parameters:
 * login — the login allowed to perform a NMU. * or ommission of the parameter means "anybody".
 * start date — unixtime, since which NMU is allowed. Omitted parameter means "from now on".
 * end date — unixtime, until which NMU is allowed. Omitted parameter means "forever".

NMU denial needs a login as a parameter; <tt>del *</tt> won't deny all NMUs that were allowed for the package. From the other hand, <tt>del user</tt> denies all NMUs, that were allowed for the specified user.

$ ssh git.alt acl nmu show Displays the list of allowed NMUs, in the following form:

0 in end date means "forever".

Building packages with gear
Building packages is performed in tasks. A user creates a task and specifies packages that should be built in one transaction. After that the user queues the task for execution. Tasks are executed asynchronously. After successful or unsuccessful completion, a report is sent to the user by e-mail.

task
In all commands, omitted <task_id> means the latest user's task; omitted means <tt>sisyphus</tt>.

$ ssh git.alt task ls [--all] Displays the current list of all user's tasks, with their status and short summary.

With <tt>--all</tt> parameter, shows the list of all users' tasks. $ ssh git.alt task show [<task_id>] Displays contents of the specified task. $ ssh git.alt task new [<binary_repository_name>] Creates a new empty task for building or copying packages.

The list of allowed binary repository identifiers can be obtained with <tt>task new --help</tt>.

$ ssh git.alt task add [<task_id>] repo <gear_repo> <gear_tag> Adds a package for building to the task with <task_id>.

The package is identified by two mandatory parameters: path to gear repository of the package and git tag that specifies a certain snapshot in this repository. $ ssh git.alt task add [<task_id>] copy [<binary_repository_name>] Adds to the task with <task_id> a package for copying from the binary repository specified in the command to the repository of the task (the one that was specified in <tt>task new</tt> command). $ ssh git.alt task add [<task_id>] del  Adds to the task a package for deletion from the binary repository of the task. $ ssh git.alt task delsub <task_id> <subtask_id> Removes a subtask (created with <tt>task add</tt>) from the task. Note that all parameters are mandatory. $ ssh git.alt task run [<task_id>] Queues the task for execution. Unlike all other commands, this one is asynchronous. $ ssh git.alt task share [<task_id>] <status|enabled|disabled> Displays/Alters the access mode for the task.

A task with share enabled access can be filled with subtasks by other users (by means of <tt>task add</tt> command). The default access mode for all tasks is share disabled.

$ ssh git.alt task approve <task_id> <subtask_id> Approves a subtask with the specified number. Note that all parameters are mandatory.

This command is used to allow building packages by users who normally don't have the rights for that (non-maintainer uploads, NMU). $ ssh git.alt task rm [<task_id>] Deletes the task along with its subtasks.

An example of a building session follows: $ ssh git.alt task ls girar-task ls: no tasks for ldv $ ssh git.alt task new 1234 new task #1234: owner=ldv repo=sisyphus $ ssh git.alt task ls $ ssh git.alt task show id=1234 locked=no shared=no repo=sisyphus owner=ldv seq= rc= $ ssh git.alt task add repo vitmp 1.0-alt4 task #1234: added #1 build tag 1.0-alt4 from /people/ldv/packages/vitmp.git $ ssh git.alt task show id=1234 locked=no shared=no repo=sisyphus owner=ldv seq= rc= 1:dir=/people/ldv/packages/vitmp.git 1:tag_name=1.0-alt4 1:tag_id=11c24aa6683506efd89b174de8dbea2af1cebf84 1:tag_author=Dmitry V. Levin (for packages) <ldv@altlinux.org> 1:userid=ldv $ ssh git.alt task run task #1234: try=1 queued, result will be emailed to ldv@altlinux.org $ ssh git.alt task ls ...after some time, which may vary from task to task... $ ssh git.alt task ls ...after completion... $ ssh git.alt task ls
 * 1) 1234 NEW sisyphus
 * 1) 1234 AWAITING sisyphus vitmp.git=1.0-alt4
 * 1) 1234 BUILDING [locked] sisyphus vitmp.git=1.0-alt4
 * 1) 1234 DONE sisyphus vitmp.git=1.0-alt4

build
$ ssh git.alt build [-b <binary_repository_name>] <gear_repo_path 1> <gear_tag_name 1> ... This command is a macro for ordinary package building tasks. It creates a task with <tt>task new</tt>, fills it with subtasks with a proper number of <tt>task add</tt> and then invokes a task for execution with <tt>task run</tt>.

is the repository name for <tt>task new</tt> command.

and specify a package (see <tt>task add</tt>).

charset
$ ssh git.alt charset [ ]

Obtain or set the charset used in files of the specified git-repository. This charset is chosen to display diffs in the notification e-mails sent by git.alt.

$ 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

Displays the user's quota and the used space.

$ 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
These commands are used internally by <tt>git-push</tt>, <tt>git-pull</tt> and other utilities. You should not run them explicitly.

Cloning and usage of repositories
Basically, <tt>git.alt</tt> repos are git-repositories, so any command applicable to a git repo can be used with a <tt>git.alt</tt> repo.

<tt>git.alt</tt> repositories can be accessed via the following URLs:
 * git (r/o)
 * <tt>git://git.altlinux.org/people/$USER/(packages|public|private)/$PACKAGE.git</tt>


 * rsync (r/o)
 * <tt>git.altlinux.org::people/$USER/(packages|public|private)/$PACKAGE.git</tt>


 * http (r/o)
 * <tt> http://git.altlinux.org/people/$USER/(packages|public|private)/$PACKAGE.git </tt>


 * ssh (r/w)
 * <tt>ssh://git.altlinux.org/people/$USER/(packages|public|private)/$PACKAGE.git</tt>

You can find HTTP- and git-URLs of repos in the <tt>git.alt</tt> web interface.

Git.alt web interface
The address is http://git.altlinux.org/

The web interface allows to navigate public repos of all users (i.e. <tt>/people/$USERNAME/{packages,public}</tt> directories) and includes <tt>gitweb</tt> interface for those repos.

Aside from that, the web interface displays <tt>/archive</tt> repositories (with no <tt>gitweb</tt>, you can only clone them) and a file <tt>people-packages-list</tt> &mdash; this file contains all repos from <tt>/people/$USERNAME/packages/</tt> directories along with unixtimes of their last change.

<!--== Структура репозиториев ==

<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> на основе прошедших incoming <tt>src.rpm</tt>-пакетов, а не на основе <tt>gear</tt>-репозитория, из которых были собраны <tt>src.rpm</tt>, поэтому репозиторий /archive следует использовать для разработки только в том случае, когда <tt>gear</tt>-репозиторий для пакета отсутствует.

Почтовая подписка
На <tt>git.alt</tt> реализовано два вида почтовой подписки на события:
 * Пользователь подписывается на события, происходящие в репозиториях <tt>public</tt> и <tt>packages</tt>.
 * Пользователь подписывает кого-то на события, происходящие в его репозиториях <tt>public</tt>, <tt>packages</tt> и <tt>private</tt>.

Для подписки используются репозитории из директории <tt>etc</tt>: <tt>packages.git</tt>, <tt>public.git</tt>, <tt>private.git</tt>. Схема работы с подписками напоминает работу с <tt>CVSROOT</tt> из CVS: пользователь клонирует нужный репозиторий, коммтит изменения в него и push-ит обратно на сервер, после чего изменения вступают в силу.

В каждом из трёх репозиториев находится два файла: <tt>email-subscription</tt> и <tt>email-distribution</tt> (точнее, в <tt>private.git</tt> - только <tt>email-distribution</tt>). <tt>git.alt</tt> использует бранч <tt>master</tt> и не обращает внимания на остальные бранчи в этих репозиториях.

email-subscription
Этот файл позволяет подписаться на события в публичных репозиториях <tt>git.alt</tt>. Формат файла - последовательность строк следующего вида: $USER $PACKAGE $REFTYPE $REFNAME где
 * $USER - имя пользователя <tt>git.alt</tt>,
 * $PACKAGE - имя пакета,
 * $REFTYPE - вид изменения: <tt>head</tt> - новые/удалённые коммиты, <tt>tag</tt> - новые/удалённые тэги (техническая подробность: второй компонент из изменяемой ссылки <tt>refs/*/*</tt>)