📜 ⬆️ ⬇️

Subversion vs. Git: Debunking Myths About Debunking Myths

Subversion vs. Git: Myths and Facts claims to dispel some myths about version control systems. I doubted their “facts” and checked some of them. The result of the test was the undermined authority of the site, and skepticism about the rest of the statements.

A little about why it interested me
I relatively recently changed jobs, got into a company that uses svn, but the transition to git often pops up in discussions.

Once I witnessed a discussion of this topic. Colleagues discussed the same site and came to the conclusion that "we change the awl for soap."
In this dialogue, I was an unwitting listener, but what was there for the site and its arguments interested me. I went to understand.

Let's start with the first statement


Git repositories are significantly smaller than equivalent Subversion ones
False. A myth.

There are several ways to complete the data. Subversion and Git repositories with data. Subversion repositories couldn’t be much smaller than the git ones.

Below is an example where they compare the size of the repository. Conclusion - the difference is not significant.
')
I was embarrassed by a different number of commits, and in fact different primary sources (who knows how they synchronize these repositories there). Also, I was not satisfied with the level of detail describing the process of obtaining these numbers.

So let's start our experiment!

Get svn repository


svnrdump.exe dump https://core.svn.wordpress.org/ > svndump
svnadmin create svn
svnadmin load svn < svndump 

svn. 213 , 79758 88 .

39864 . 1701 160 .


git svn clone -s --prefix "svn/" file:///%path%/svn git_from_svn 

, ( 32 ). git — svn ( , ).

, , .

, git_from_svn/.git: 208 7841 509 . git, , . 2 : “loose” object “packfile".

, :

git count-objects -v -H

:

count: 6826
size: 30.21 MiB
in-pack: 249852
packs: 25
size-pack: 145.51 MiB
prune-packable: 73
garbage: 0
size-garbage: 0 bytes

6826 (30.21 ) .


git gc
git count-objects -v -H

:

count: 0
size: 0 bytes
in-pack: 256605
packs: 1
size-pack: 104.54 MiB
prune-packable: 0
garbage: 0
size-garbage: 0 bytes

".git" 136 (945 , 255 ). .


, svn — bare : 106 M, 19 , 8 .


svn — 213 M (79 758 , 88 )
svn( pack) — 214 M (4 644 , 89 ) ( )
git svn — 208 M (7 841 , 509 )
git svn(pack) — 136 M (945 , 255 )
git bare(pack) — 106 M (19 , 8 )

( ).

, loose , . , . .


Branches are expensive in Subversion
False. A myth.

Branches in Subversion are implemented with Copy-On-Write strategy (referred to as ‘Cheap Copies’ in the svnbook). No matter how large a repository or project is, it takes a constant amount of time and space to make a branch. In fact, Subversion branches are extremely cheap beginning with version 1.0 and you can branch even for small bugfixes in a very busy and large project.

«».

– . , 0,01 . - svn, . , ( svn checkout). , .


svn checkout %local_path%/trunk

TotalSeconds: 14.0737539

git clone %local_path%

TotalSeconds: 21.8173709

Git . , git , svn — .


svn switch <local_path>/branches/4.7

TotalSeconds: 4.3741352

git checkout -B "4.7" "origin/4.7"

TotalSeconds: 1.2700857

, .

. .

PS: , « », , , , .

!

Update:
VBKesha , svnadmin pack.
svnadmin.exe pack svn
214 MB (4,644 Files, 89 Folders)
, .

Source: https://habr.com/ru/post/320704/


All Articles