ALT Linux Team development discussions
 help / color / mirror / Atom feed
* [devel] git -- backup
@ 2010-08-24 21:16 Денис Смирнов
  2010-08-25  3:41 ` Alexey Tourbin
  2010-08-25 11:41 ` Sergey Vlasov
  0 siblings, 2 replies; 12+ messages in thread
From: Денис Смирнов @ 2010-08-24 21:16 UTC (permalink / raw)
  To: ALT Linux Team development discussions

[-- Attachment #1: Type: text/plain, Size: 369 bytes --]

Как делать локальную копию всех моих репо на git.alt? 

Т.е. набор репозиториев и бранчей в точности совпадающий с содержимым моих
репозиториев git.alt на момент синхронизации. rsync не подходит, ибо
трафик из-за git-repack на git.alt.

-- 
С уважением, Денис

http://mithraen.ru/
----------------------------------------------------------------------------

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [devel] git -- backup
  2010-08-24 21:16 [devel] git -- backup Денис Смирнов
@ 2010-08-25  3:41 ` Alexey Tourbin
  2010-08-25  9:37   ` Dmitry V. Levin
  2010-08-25 11:41 ` Sergey Vlasov
  1 sibling, 1 reply; 12+ messages in thread
From: Alexey Tourbin @ 2010-08-25  3:41 UTC (permalink / raw)
  To: ALT Linux Team development discussions

On Wed, Aug 25, 2010 at 01:16:43AM +0400, Денис Смирнов wrote:
> Как делать локальную копию всех моих репо на git.alt? 
> 
> Т.е. набор репозиториев и бранчей в точности совпадающий с содержимым моих
> репозиториев git.alt на момент синхронизации. rsync не подходит, ибо
> трафик из-за git-repack на git.alt.

А что-то rsync и не работает.-(

$ rsync -va git.alt:packages/ backup/
receiving incremental file list
created directory backup
./
perl-Email-Address-1.889-alt1.src.rpm
tmp/
tmp/libчлен-1.0-alt1.src.rpm
tmp/perl-Class-CGI-0.20-alt2.src.rpm

sent 75 bytes  received 54233 bytes  36205.33 bytes/sec
total size is 53899  speedup is 0.99
$

Блин какой-то libчлен всплыл.

Думаю бекап делать не надо, поскольку git.alt по сути бекапом
и является.  Я думаю что там raid и что это куда-то ещё бекапится.
Короче подвохов от git.alt я не жду.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [devel] git -- backup
  2010-08-25  3:41 ` Alexey Tourbin
@ 2010-08-25  9:37   ` Dmitry V. Levin
  2010-08-25 18:56     ` Alexey Tourbin
  0 siblings, 1 reply; 12+ messages in thread
From: Dmitry V. Levin @ 2010-08-25  9:37 UTC (permalink / raw)
  To: ALT Linux Team development discussions

[-- Attachment #1: Type: text/plain, Size: 567 bytes --]

On Wed, Aug 25, 2010 at 07:41:56AM +0400, Alexey Tourbin wrote:
> On Wed, Aug 25, 2010 at 01:16:43AM +0400, Денис Смирнов wrote:
> > Как делать локальную копию всех моих репо на git.alt? 
> > 
> > Т.е. набор репозиториев и бранчей в точности совпадающий с содержимым моих
> > репозиториев git.alt на момент синхронизации. rsync не подходит, ибо
> > трафик из-за git-repack на git.alt.
> 
> А что-то rsync и не работает.-(
> 
> $ rsync -va git.alt:packages/ backup/

Это разные ресурсы, сравни с
rsync git.altlinux.org::people/at/packages/


-- 
ldv

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [devel] git -- backup
  2010-08-24 21:16 [devel] git -- backup Денис Смирнов
  2010-08-25  3:41 ` Alexey Tourbin
@ 2010-08-25 11:41 ` Sergey Vlasov
  2010-08-25 18:37   ` Денис Смирнов
  1 sibling, 1 reply; 12+ messages in thread
From: Sergey Vlasov @ 2010-08-25 11:41 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 633 bytes --]

On Wed, Aug 25, 2010 at 01:16:43AM +0400, Денис Смирнов wrote:
> Как делать локальную копию всех моих репо на git.alt? 
> 
> Т.е. набор репозиториев и бранчей в точности совпадающий с содержимым моих
> репозиториев git.alt на момент синхронизации. rsync не подходит, ибо
> трафик из-за git-repack на git.alt.

Первоначальное создание:

  git clone --mirror git.alt:packages/xxx.git /my/mirror/xxx.git

Хотя можно подсунуть и существующий репозиторий, сделав там в
.git/config:

  [remote "origin"]
	url = ...
	fetch = +refs/*:refs/*
	mirror = true

Обновление:

  git --git-dir=/my/mirror/xxx.git fetch --prune

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [devel] git -- backup
  2010-08-25 11:41 ` Sergey Vlasov
@ 2010-08-25 18:37   ` Денис Смирнов
  2010-08-25 19:41     ` Kirill A. Shutemov
  2010-08-25 19:48     ` Sergey Vlasov
  0 siblings, 2 replies; 12+ messages in thread
From: Денис Смирнов @ 2010-08-25 18:37 UTC (permalink / raw)
  To: ALT Linux Team development discussions

[-- Attachment #1: Type: text/plain, Size: 336 bytes --]

On Wed, Aug 25, 2010 at 03:41:57PM +0400, Sergey Vlasov wrote:

SV>   git clone --mirror git.alt:packages/xxx.git /my/mirror/xxx.git

А для чего --mirror? Я нашел его упоминание только в контексте push.

-- 
С уважением, Денис

http://mithraen.ru/
----------------------------------------------------------------------------

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [devel] git -- backup
  2010-08-25  9:37   ` Dmitry V. Levin
@ 2010-08-25 18:56     ` Alexey Tourbin
  0 siblings, 0 replies; 12+ messages in thread
From: Alexey Tourbin @ 2010-08-25 18:56 UTC (permalink / raw)
  To: ALT Linux Team development discussions

On Wed, Aug 25, 2010 at 01:37:07PM +0400, Dmitry V. Levin wrote:
> On Wed, Aug 25, 2010 at 07:41:56AM +0400, Alexey Tourbin wrote:
> > On Wed, Aug 25, 2010 at 01:16:43AM +0400, Денис Смирнов wrote:
> > А что-то rsync и не работает.-(
> > $ rsync -va git.alt:packages/ backup/
> 
> Это разные ресурсы, сравни с
> rsync git.altlinux.org::people/at/packages/

I can't see why git.alt:packages/ is not supposed to work.
If it doesn't work, it's a problem.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [devel] git -- backup
  2010-08-25 18:37   ` Денис Смирнов
@ 2010-08-25 19:41     ` Kirill A. Shutemov
  2010-08-25 20:15       ` Денис Смирнов
  2010-08-25 19:48     ` Sergey Vlasov
  1 sibling, 1 reply; 12+ messages in thread
From: Kirill A. Shutemov @ 2010-08-25 19:41 UTC (permalink / raw)
  To: ALT Linux Team development discussions

On Wed, Aug 25, 2010 at 10:37:52PM +0400, Денис Смирнов wrote:
> On Wed, Aug 25, 2010 at 03:41:57PM +0400, Sergey Vlasov wrote:
> 
> SV>   git clone --mirror git.alt:packages/xxx.git /my/mirror/xxx.git
> 
> А для чего --mirror? Я нашел его упоминание только в контексте push.

Учимся читать маны:

       --mirror
           Set up a mirror of the remote repository. This implies --bare

-- 
 Kirill A. Shutemov


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [devel] git -- backup
  2010-08-25 18:37   ` Денис Смирнов
  2010-08-25 19:41     ` Kirill A. Shutemov
@ 2010-08-25 19:48     ` Sergey Vlasov
  2010-08-25 20:33       ` Денис Смирнов
  1 sibling, 1 reply; 12+ messages in thread
From: Sergey Vlasov @ 2010-08-25 19:48 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 497 bytes --]

On Wed, Aug 25, 2010 at 10:37:52PM +0400, Денис Смирнов wrote:
> On Wed, Aug 25, 2010 at 03:41:57PM +0400, Sergey Vlasov wrote:
> 
> SV>   git clone --mirror git.alt:packages/xxx.git /my/mirror/xxx.git
> 
> А для чего --mirror? Я нашел его упоминание только в контексте push.

При использовании с git clone опция --mirror приводит к созданию
remote origin с параметрами

  fetch = +refs/*:refs/*
  mirror = true

в отличие от обычного

  fetch = refs/heads/*:refs/remotes/origin/*

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [devel] git -- backup
  2010-08-25 19:41     ` Kirill A. Shutemov
@ 2010-08-25 20:15       ` Денис Смирнов
  0 siblings, 0 replies; 12+ messages in thread
From: Денис Смирнов @ 2010-08-25 20:15 UTC (permalink / raw)
  To: ALT Linux Team development discussions

[-- Attachment #1: Type: text/plain, Size: 506 bytes --]

On Wed, Aug 25, 2010 at 10:41:44PM +0300, Kirill A. Shutemov wrote:

KAS> Учимся читать маны:
KAS>        --mirror
KAS>            Set up a mirror of the remote repository. This implies --bare

Я это прочитал. Вот теперь уже третий раз прочитал. И все равно не понимаю
чем опция --mirror помогает моей задаче, что конкретно меняется в
поведении git'а при ее включении.

-- 
С уважением, Денис

http://mithraen.ru/
----------------------------------------------------------------------------

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [devel] git -- backup
  2010-08-25 19:48     ` Sergey Vlasov
@ 2010-08-25 20:33       ` Денис Смирнов
  2010-08-26 12:11         ` Sergey Vlasov
  0 siblings, 1 reply; 12+ messages in thread
From: Денис Смирнов @ 2010-08-25 20:33 UTC (permalink / raw)
  To: ALT Linux Team development discussions

[-- Attachment #1: Type: text/plain, Size: 1374 bytes --]

On Wed, Aug 25, 2010 at 11:48:03PM +0400, Sergey Vlasov wrote:

SV> При использовании с git clone опция --mirror приводит к созданию
SV> remote origin с параметрами
SV>   fetch = +refs/*:refs/*
SV>   mirror = true
SV> в отличие от обычного
SV>   fetch = refs/heads/*:refs/remotes/origin/*

Это я понял. Просто обратил внимания на рекомендацию если я создаю
репозиторий ручками (а я так и делаю -- ибо они у меня уже rsync'нуты),
все равно устанавливать mirror=yes. Он действительно действует только на
push, и главные секреты:
1. fetch = +refs/*:refs/*
2. опция --prune у fetch

Я правильно понял?

Вот скрипт который у меня сейчас запущен:

#!/bin/sh
BACKUP_DIR=~/backup/git.alt
find "$BACKUP_DIR" -mindepth 1 -maxdepth 1 -type d | while read dir; do
    n=${dir##*/}
    [ -L "$dir/hooks" ] && rm -f "$dir/hooks"
    mkdir -p "$dir/branches"
    mkdir -p "$dir/hooks"
    echo $n
    git --git-dir="$dir" pack-refs --all
    git --git-dir="$dir" config core.bare true
    git --git-dir="$dir" config remote.origin.url git.alt:packages/$n
    git --git-dir="$dir" config remote.origin.fetch '+refs/*:refs/*'
    git --git-dir="$dir" config remote.origin.mirror true
    git --git-dir="$dir" fetch --prune
done

-- 
С уважением, Денис

http://mithraen.ru/
----------------------------------------------------------------------------

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [devel] git -- backup
  2010-08-25 20:33       ` Денис Смирнов
@ 2010-08-26 12:11         ` Sergey Vlasov
  2010-08-27  5:12           ` Денис Смирнов
  0 siblings, 1 reply; 12+ messages in thread
From: Sergey Vlasov @ 2010-08-26 12:11 UTC (permalink / raw)
  To: devel

[-- Attachment #1: Type: text/plain, Size: 888 bytes --]

On Thu, Aug 26, 2010 at 12:33:04AM +0400, Денис Смирнов wrote:
> On Wed, Aug 25, 2010 at 11:48:03PM +0400, Sergey Vlasov wrote:
> 
> SV> При использовании с git clone опция --mirror приводит к созданию
> SV> remote origin с параметрами
> SV>   fetch = +refs/*:refs/*
> SV>   mirror = true
> SV> в отличие от обычного
> SV>   fetch = refs/heads/*:refs/remotes/origin/*
> 
> Это я понял. Просто обратил внимания на рекомендацию если я создаю
> репозиторий ручками (а я так и делаю -- ибо они у меня уже rsync'нуты),
> все равно устанавливать mirror=yes. Он действительно действует только на
> push, и главные секреты:
> 1. fetch = +refs/*:refs/*
> 2. опция --prune у fetch
> 
> Я правильно понял?

Ещё mirror=true влияет на git remote set-branches (тоже получается
fetch = +refs/%s:refs/%s, причём даже heads/ в таком варианте надо
явно указывать в командной строке).

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [devel] git -- backup
  2010-08-26 12:11         ` Sergey Vlasov
@ 2010-08-27  5:12           ` Денис Смирнов
  0 siblings, 0 replies; 12+ messages in thread
From: Денис Смирнов @ 2010-08-27  5:12 UTC (permalink / raw)
  To: ALT Linux Team development discussions

[-- Attachment #1: Type: text/plain, Size: 398 bytes --]

On Thu, Aug 26, 2010 at 04:11:03PM +0400, Sergey Vlasov wrote:

SV> Ещё mirror=true влияет на git remote set-branches (тоже получается
SV> fetch = +refs/%s:refs/%s, причём даже heads/ в таком варианте надо
SV> явно указывать в командной строке).

Понял, спасибо.

-- 
С уважением, Денис

http://mithraen.ru/
----------------------------------------------------------------------------

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2010-08-27  5:12 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-08-24 21:16 [devel] git -- backup Денис Смирнов
2010-08-25  3:41 ` Alexey Tourbin
2010-08-25  9:37   ` Dmitry V. Levin
2010-08-25 18:56     ` Alexey Tourbin
2010-08-25 11:41 ` Sergey Vlasov
2010-08-25 18:37   ` Денис Смирнов
2010-08-25 19:41     ` Kirill A. Shutemov
2010-08-25 20:15       ` Денис Смирнов
2010-08-25 19:48     ` Sergey Vlasov
2010-08-25 20:33       ` Денис Смирнов
2010-08-26 12:11         ` Sergey Vlasov
2010-08-27  5:12           ` Денис Смирнов

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git