# Migrate from svn to git

9 messages from 2010-05-26 to 2010-06-01. Participants: Matthias Fechner, Ævar Arnfjörð Bjarmason, hasen j, Nazri Ramliy, Michael Witten.
Thread: https://gitlist.dev/t/23915

## Matthias Fechner, 2010-05-26 15:13

Subject: Migrate from svn to git
Message-ID: <4BFD3AAF.4080403@fechner.net>
URL: https://gitlist.dev/e/4BFD3AAF.4080403%40fechner.net

```
Hi,

I hope that is the correct list to ask some questions.
I understood that the idea behind git is completely different and I like 
the idea behind git.

But for the svn repository I want to convert I need some features and 
I'm not sure how / if to implement them in git.

Corrently the svn repo is divided into trunk branches and tags.
In each of this directory like trunk i have directories like hardware, 
software, docu and more.

For each of this subdirectories I have usergroups defined which has no 
access, read access or rw access.

If I understood the manual correctly I can stick on that structure and 
easily work here with the unix-permission to grant access to the folders?
I think I have to test then acl with freebsd to have more then one group 
for each directory.


The second question is, I someone commits some files with svn an email 
is sent to a svn-commit mailinglist so changes can easily be discussed.
The current mail is sent in html format with a colored diff, so it is 
easier to read.

Is something similar possible with git or do you suggest a complete 
approach?

Thanks a lot for answers.

Bye,
Matthias

-- 
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning." -- Rich Cook

```

## Ævar Arnfjörð Bjarmason, 2010-05-26 16:23

Subject: Re: Migrate from svn to git
Message-ID: <AANLkTikD6Op5TO0EtQWLQ0N6zD0Kr-pltW76rY1Dvx5D@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTikD6Op5TO0EtQWLQ0N6zD0Kr-pltW76rY1Dvx5D%40mail.gmail.com
In-Reply-To: <4BFD3AAF.4080403@fechner.net>

```
On Wed, May 26, 2010 at 15:13, Matthias Fechner <idefix@fechner.net> wrote:
> I hope that is the correct list to ask some questions.
> I understood that the idea behind git is completely different and I like the
> idea behind git.
>
> But for the svn repository I want to convert I need some features and I'm
> not sure how / if to implement them in git.
>
> Corrently the svn repo is divided into trunk branches and tags.
> In each of this directory like trunk i have directories like hardware,
> software, docu and more.
>
> For each of this subdirectories I have usergroups defined which has no
> access, read access or rw access.
>
> If I understood the manual correctly I can stick on that structure and
> easily work here with the unix-permission to grant access to the folders?
> I think I have to test then acl with freebsd to have more then one group for
> each directory.

No. Git isn't centralized. Anyone can clone the repo and change
anything the want. You implement control by setting a policy on what
you merge back into your tree, which is considered canonical.

There are several on-commit filtering programs available that can do
that automatically based on paths within the repository.

> The second question is, I someone commits some files with svn an email is
> sent to a svn-commit mailinglist so changes can easily be discussed.
> The current mail is sent in html format with a colored diff, so it is easier
> to read.
>
> Is something similar possible with git or do you suggest a complete
> approach?

There are a lot of these scripts available in contrib and elsewhere.

```

## hasen j, 2010-05-26 16:26

Subject: Re: Migrate from svn to git
Message-ID: <AANLkTinTYWQflbvlWVjDKD3gtOyQxDrSZ7QKhy4eI77_@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTinTYWQflbvlWVjDKD3gtOyQxDrSZ7QKhy4eI77_%40mail.gmail.com
In-Reply-To: <4BFD3AAF.4080403@fechner.net>

```
> Corrently the svn repo is divided into trunk branches and tags.
> In each of this directory like trunk i have directories like hardware,
> software, docu and more.
>
> For each of this subdirectories I have usergroups defined which has no
> access, read access or rw access.
>
> If I understood the manual correctly I can stick on that structure and
> easily work here with the unix-permission to grant access to the folders?
> I think I have to test then acl with freebsd to have more then one group for
> each directory.

As far as I know, git doesn't track permissions (except for the execute bit).

>
>
> The second question is, I someone commits some files with svn an email is
> sent to a svn-commit mailinglist so changes can easily be discussed.
> The current mail is sent in html format with a colored diff, so it is easier
> to read.
>
> Is something similar possible with git or do you suggest a complete
> approach?

I've seen it done, e.g. xfce4-commits mailing list.
http://foo-projects.org/pipermail/xfce4-commits/

```

## Nazri Ramliy, 2010-05-26 17:04

Subject: Re: Migrate from svn to git
Message-ID: <AANLkTilNlttIQxyhMJz8_wiOQX5OaL0UahsE54mv6rQ3@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTilNlttIQxyhMJz8_wiOQX5OaL0UahsE54mv6rQ3%40mail.gmail.com
In-Reply-To: <4BFD3AAF.4080403@fechner.net>

```
On Wed, May 26, 2010 at 11:13 PM, Matthias Fechner <idefix@fechner.net> wrote:
> For each of this subdirectories I have usergroups defined which has no
> access, read access or rw access.
>
> If I understood the manual correctly I can stick on that structure and
> easily work here with the unix-permission to grant access to the folders?
> I think I have to test then acl with freebsd to have more then one group for
> each directory.

Dealing with acl sounds like a lot of work and complications to me.
Have a look at gitolite. It is covered quite nice in the progit book [1]

> The second question is, I someone commits some files with svn an email is
> sent to a svn-commit mailinglist so changes can easily be discussed.
> The current mail is sent in html format with a colored diff, so it is easier
> to read.
>
> Is something similar possible with git or do you suggest a complete
> approach?

For this you might want to look at Gerrit [2]. It's a web-based code
review. Although it is not email based (AFAIK).

nazri.


[1] http://progit.org/book/ch4-8.html
[2] http://code.google.com/p/gerrit/

```

## Matthias Fechner, 2010-05-27 06:19

Subject: Re: Migrate from svn to git
Message-ID: <4BFE0F0A.301@fechner.net>
URL: https://gitlist.dev/e/4BFE0F0A.301%40fechner.net
In-Reply-To: <AANLkTilNlttIQxyhMJz8_wiOQX5OaL0UahsE54mv6rQ3@mail.gmail.com>

```
Am 26.05.10 19:04, schrieb Nazri Ramliy:
>
> Dealing with acl sounds like a lot of work and complications to me.
> Have a look at gitolite. It is covered quite nice in the progit book [1]
>    

thanks for the link i will read the documentation to get more 
information about it, but the first look is very promising.

Matthias

-- 
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning." -- Rich Cook

```

## Matthias Fechner, 2010-05-27 06:22

Subject: Re: Migrate from svn to git
Message-ID: <4BFE0F93.4050600@fechner.net>
URL: https://gitlist.dev/e/4BFE0F93.4050600%40fechner.net
In-Reply-To: <AANLkTikD6Op5TO0EtQWLQ0N6zD0Kr-pltW76rY1Dvx5D@mail.gmail.com>

```
Am 26.05.10 18:23, schrieb Ævar Arnfjörð Bjarmason:
>
> There are a lot of these scripts available in contrib and elsewhere.
>    

thanks, i will start then in the contrib folder.
Is it possible in git to attach script like hooks in svn if someone pull 
content to the repo?

Matthias

-- 
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning." -- Rich Cook

```

## Michael Witten, 2010-05-31 12:01

Subject: Re: Migrate from svn to git
Message-ID: <AANLkTinKsGPo0-ETmVOSH6fY64GLLwVm2dNBGyjAvrin@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTinKsGPo0-ETmVOSH6fY64GLLwVm2dNBGyjAvrin%40mail.gmail.com
In-Reply-To: <4BFD3AAF.4080403@fechner.net>

```
On Wed, May 26, 2010 at 10:13, Matthias Fechner <idefix@fechner.net> wrote:
> The second question is, I someone commits
> some files with svn an email is sent to a
> svn-commit mailinglist so changes can easily
> be discussed.

Shouldn't the discussion happen before the commit?

> The current mail is sent in html format with
> a colored diff, so it is easier to read.

I would rather receive the raw diff and let my own preferred tools
display the information in way that I personally like.

Keep in mind that `git diff' is capable of displaying the diff with color.

Michael Witten

```

## Matthias Fechner, 2010-06-01 06:51

Subject: Re: Migrate from svn to git
Message-ID: <4C04ADFC.9020309@fechner.net>
URL: https://gitlist.dev/e/4C04ADFC.9020309%40fechner.net
In-Reply-To: <AANLkTinKsGPo0-ETmVOSH6fY64GLLwVm2dNBGyjAvrin@mail.gmail.com>

```
Hi Michael,

Am 31.05.10 14:01, schrieb Michael Witten:
> Shouldn't the discussion happen before the commit?
>    

in most of the cases it is not necessary, but the diff mails are used as 
an additional review step and sometimes additional changes follow.
But it is a way to do it and people are used to do it.

I'm thinking more and more about it and I think the best solution is to 
keep svn as the central repo and do a git svn clone from there, so I 
have the advantage of the existing infrastructure and will get the nice 
features from git.

Matthias

-- 
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning." -- Rich Cook

```

## Michael Witten, 2010-06-01 14:23

Subject: Re: Migrate from svn to git
Message-ID: <AANLkTimRzqeffooPPHEVE9_ccZojmZG-SudKTx_6M7ho@mail.gmail.com>
URL: https://gitlist.dev/e/AANLkTimRzqeffooPPHEVE9_ccZojmZG-SudKTx_6M7ho%40mail.gmail.com
In-Reply-To: <4C04ADFC.9020309@fechner.net>

```
On Tue, Jun 1, 2010 at 01:51, Matthias Fechner <idefix@fechner.net> wrote:
> I'm thinking more and more about it and I think the best solution is to keep
> svn as the central repo and do a git svn clone from there, so I have the
> advantage of the existing infrastructure and will get the nice features from
> git.

That's probably a good way to get people started with git.

However, git hooks SEEM like they should be enough for your purposes.

For permissions, see contrib/hooks/update-paranoid:

  http://git.kernel.org/?p=git/git.git;h=d18b317b2f018d1d1a5a9677a7bdaf8956d65186

and for emails, see see contrib/hooks/post-receive-email:

  http://git.kernel.org/?p=git/git.git;h=30ae63d74da065a31cced0b161708680f39c04c0

(Sorry if gmail mangles those urls).

Sincerely,
Michael Witten

```
