SlideShare a Scribd company logo
Subversion Day
Using Subversion and Git Together




        June 14th 2012, Berlin
About Us
●
    TMate Software
●
    We create VCS tools since year 2003
●
    Products at pre-release stage
    ●
        SubGit (RC, self-hosting for 6 months)
    ●
        HG4J (Beta)
●
    Our mature products:
    ●
        SvnKit (1.7.4, 30% of the ASF requests)
    ●
        SqlJet (1.1.2)
Subversion and Git
●
    Subversion:
    ●
        Mature, well known and widely used
    ●
        Centralized
    ●
        Manager-friendly
●
    Git:
    ●
        Fast growing VCS
    ●
        Distributed
    ●
        Geek-friendly
Subversion and Git

                 server




●
    Single repository at         ●
                                     Many repositories
    shared centralized server
                                 ●
                                     Forks
●
    All branches and forks are
    in the same repository       ●
                                     Delayed commits
Subversion and Git



How is it possible to use both?!
Two Approaches


Git-Svn
   or SubGit
Git-Svn Approach
         overview

server              server
Git-Svn Approach
client-side, partisan deployment


                    server




               User 1        User 2
Git-Svn Approach
double translation, resulting in data loss


                           server




2. pull:                                     1. push:
  Svn to Git                                   Git to Svn



                  User 1            User 2
Git-Svn Approach
  custom non-Git workflow
             Git-Svn commands:
    server   ●  fetch
             ● dcommit

             ● rebase

             ● branch

              ...



User 1
Git-Svn Approach
               custom non-Git workflow

Standard Git push:
                                                       - local commit


                                                       - remote commit




 local state    git pull,              git push,
                merge commit created   new commits pushed
Git-Svn Approach
               custom non-Git workflow

Git-Svn dcommit:




 local state    git svn dcommit,        git svn dcommit,   git svn dcommit,
                requires rebase first   (commit)           (fetchback, sign)
Git-Svn Approach
                    summary
●
    Client side
●
    Each user needs to translate at least part of
    the repository
●
    Non-standard workflow
●
    Part of standard Git package, but...
●
    …git-svn is 5000 lines script of perl code
SubGit
         overview

                    subgit


server
SubGit
                approach details
●
    Installed into repository
●
    Uses hooks
●
    Translation is performed in the background
    to minimize overhead
SubGit
                  default installation
Server



         Subversion                       svn pre-commit hook

                      SubGit
                      translation
                      daemon
                                               git pre-receive hook




                                               git post-receive hook


                                    Git
SubGit
     Apache configuration example
<Location /svn>
   # http://repos.host.com/svn/project
   DAV Svn
   SVNParentPath /var/svn/repos
   Require valid-user
   AuthType Basic
   AuthUserFile /var/svn/repos/passwords
</Location>
<Location /git>
   # http://repos.host.com/git/project
   ScriptAlias /git/ …
   …
   Require valid-user
   AuthType Basic
   AuthUserFile /var/svn/repos/passwords
</Location>
SubGit
       asynchronous translation
                     svn      subgit                       git


    data transfer


                                   translation scheduled
     pre-commit

revision installed
                                   revision added to
    post-commit                    SubGit translation queue




                                                     git commit created
SubGit
         asynchronous translation
                      git      subgit                       svn


      data transfer


                                    translation scheduled
       pre-receive

references updated

      post-receive                  commit(s) added to
                                    SubGit translation queue




                                                    svn revision created
SubGit
asynchronous translation
  git      subgit     svn
SubGit
                   summary
●
    Server side
●
    One-time centralized deployment
●
    Reuse of existing infrastructure
●
    Pure Git/Subversion experience
●
    Safe and smooth migration
●
    Commercial quality tool
SubGit
         safe migration

subgit
SubGit
                   smooth migration
VCS transparency




                      “Clean cut”     Git adoption   t
                      migration
VCS transparency




                      SubGit smooth                  t
                      migration
Subversion<=>Git Translation

●
    Branches and Tags     ●
                              References
●
    Deltas                ●
                              Trees
●
    Special properties    ●
                              Special files
●
    Merge tracking info   ●
                              Commit parents
Branches and Tags
                  overview
                    master   1.1.x   1.0.x
/trunk
/branches
/branches/1.0.x
/branches/1.1.x
/tags
/tags/1.0.0
                                             1.0.0



--- r10
M /branches/1.0.x/file.txt
Branches and Tags
            mapping

trunk = trunk:refs/heads/master
branches = branches/*:refs/heads/*
tags = tags/*:refs/tags/*

shelves = shelves/*:refs/shelves/*
Branches and Tags
master

            Which history line is a trunk?

            And which is a branch?


            Heuristics help!
Branches and Tags
               shelves
master


             Unnamed Git branch

                   /shelves/author[_date]



                   --- r20
                   M /shelves/alex/file.txt
Branches and Tags
                  attic references
master   branch      master          master

                                              attic/
                                              branch
Braches and Tags
●
    From Subversion to Git
    ●
      Single Subversion revision might be
      translated to multiple Git commits
●
    From Git to Subversion
    ●
        Heuristics help to detect target
        branch in complex cases
    ●
        /shelves directory is used to store
        anonymous branches
Deltas and Trees
●
    Subversion revision is a delta:
      --- r20
      A /trunk/file.txt
      M /trunk/dir/file.txt
      A /trunk/dir/copy.txt
             from /trunk/file.txt@r10
      D /trunk/dir/old_file.txt
●
    Delta tracks copies
●
    Git commit is always a full file tree
Deltas and Trees
●
    From Subversion to Git
    ●
        Relevant part of the delta is applied
        to the parent commit tree

●
    From Git to Subversion
    ●
        Renames and copies are detected at
        translation time
    ●
        Branches and tags creation uses
        copy operation
Special Properties
●
    properties:            ●
                               files:
    ●
        svn:ignore             ●
                                   .gitignore

    ●
        svn:eol-style          ●
                                   .gitattributes
    ●
        svn:mime-type

file.txt                       .gitattributes
    svn:eol-style=native           * text=auto !eol
Special Properties
●
    From Subversion to Git
    ●
      svn:ignore; svn:mime-type and
      svn:eol-style are translated
●
    From Git to Subversion
    ●
        .gitignore and relevant values set
        in .gitattributes are translated
Merge Tracking
Git merge commits:

                     In Git merges are tracked by:

                     ●
                         Natural history

                     ●
                         Merge commits parents

                     ●
                         Merge unit is commit
Merge Tracking
●
    Subversion tracks merges by
    ●
        Natural history
    ●
        Revisions ranges (including cherry-picks)

●
    Merge unit is file or a directory
        /trunk@r100
          svn:mergeinfo=/branches/1.0.x:1-100,105

        /trunk/file.txt@r100
          svn:mergeinfo=/branches/1.0.x/file.txt:102
Merge Tracking
●
    From Subversion to Git
    ●
        Branch-level merges are translated
        to merge commits

●
    From Git to Subversion
    ●
        Merge commits are represented with
        svn:mergeinfo
Not Yet Translated
             (in SubGit 1.0)
●
    Empty directories
●
    Arbitrary properties
●
    Revision properties
●
    Externals references
It Works!
$ svnadmin create repos
....
$ subgit install repos
$ git clone repos git-clone
....
$ svn co svn://host/repos wc
....
SubGit Target Audience
●
    Managers who listen to their Geeks
●
    Hosting providers
●
    Safe and smooth migration



●
    Java 1.5 or newer is needed
●
    Linux, OS X, Windows Server 2003
On SubGit Availabilty
●
    SubGit 1.0 release: June 2012
●
    SubGit is free for Open Source
    and Start-Up Projects
●
    Closed-source projects will have to register
    SubGit (purchase a registration key)

●
    Dedicated technical support for SubGit
Thank you!
●
    SubGit on Web: http://subgit.com/
●
    SubGit on Twitter: @subgit
●
    Page on Google+ (SubGit)
●
    Blog: http://blog.subgit.com/
    ●
        Using Gerrit with Subversion

●
    Thank you! :)

More Related Content

What's hot

From svn to git
From svn to gitFrom svn to git
From svn to git
Nehal Shah
 
Git Introduction Tutorial
Git Introduction TutorialGit Introduction Tutorial
Git Introduction Tutorial
Thomas Rausch
 
Git vs svn
Git vs svnGit vs svn
Git vs svn
Rupesh Kumar
 
Advanced Git Presentation By Swawibe
Advanced Git Presentation By SwawibeAdvanced Git Presentation By Swawibe
Advanced Git Presentation By Swawibe
Md Swawibe Ul Alam
 
Smalltalk on Git
Smalltalk on GitSmalltalk on Git
Smalltalk on Git
mattmatt
 
Git advanced
Git advancedGit advanced
Git advanced
Peter Vandenabeele
 
Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github
Max Claus Nunes
 
Git introduction
Git introductionGit introduction
Git introduction
satyendrajaladi
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
Pham Quy (Jack)
 
Version Control Systems with git (and github) as an example
Version Control Systems with git (and github) as an exampleVersion Control Systems with git (and github) as an example
Version Control Systems with git (and github) as an example
Gaurav Kumar Garg
 
Git
GitGit
The Source Control Landscape
The Source Control LandscapeThe Source Control Landscape
The Source Control LandscapeLorna Mitchell
 
Git 入门与实践
Git 入门与实践Git 入门与实践
Git 入门与实践Terry Wang
 
Version Control with Git
Version Control with GitVersion Control with Git
Version Control with Git
Luigi De Russis
 
Git the fast version control system
Git the fast version control systemGit the fast version control system
Git the fast version control system
Jeroen Rosenberg
 
Presentacion git
Presentacion gitPresentacion git
Presentacion git
Ignacio Martín
 
Git for a newbie
Git for a newbieGit for a newbie
Git for a newbie
Anuj Sharma
 

What's hot (19)

Effective Git
Effective GitEffective Git
Effective Git
 
From svn to git
From svn to gitFrom svn to git
From svn to git
 
Git Introduction Tutorial
Git Introduction TutorialGit Introduction Tutorial
Git Introduction Tutorial
 
Git vs svn
Git vs svnGit vs svn
Git vs svn
 
Advanced Git Presentation By Swawibe
Advanced Git Presentation By SwawibeAdvanced Git Presentation By Swawibe
Advanced Git Presentation By Swawibe
 
Smalltalk on Git
Smalltalk on GitSmalltalk on Git
Smalltalk on Git
 
Git advanced
Git advancedGit advanced
Git advanced
 
Introduction to Git and Github
Introduction to Git and Github Introduction to Git and Github
Introduction to Git and Github
 
Git introduction
Git introductionGit introduction
Git introduction
 
Git tutorial
Git tutorialGit tutorial
Git tutorial
 
Version Control Systems with git (and github) as an example
Version Control Systems with git (and github) as an exampleVersion Control Systems with git (and github) as an example
Version Control Systems with git (and github) as an example
 
Git
GitGit
Git
 
The Source Control Landscape
The Source Control LandscapeThe Source Control Landscape
The Source Control Landscape
 
Git 入门与实践
Git 入门与实践Git 入门与实践
Git 入门与实践
 
Version Control with Git
Version Control with GitVersion Control with Git
Version Control with Git
 
Git the fast version control system
Git the fast version control systemGit the fast version control system
Git the fast version control system
 
Git in 5 Minutes
Git in 5 MinutesGit in 5 Minutes
Git in 5 Minutes
 
Presentacion git
Presentacion gitPresentacion git
Presentacion git
 
Git for a newbie
Git for a newbieGit for a newbie
Git for a newbie
 

Similar to Using Subversion and Git Together

Git
GitGit
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
Sage Sharp
 
Git Beginner Preso
Git Beginner PresoGit Beginner Preso
Git Beginner PresoGaurav Giri
 
Git basic
Git basicGit basic
Git basic
Emran Ul Hadi
 
Git basics
Git basicsGit basics
Git basics
terencechia88
 
Git
GitGit
Subversion to Git Migration
Subversion to Git MigrationSubversion to Git Migration
Subversion to Git Migration
Manish Chakravarty
 
Git and Github - A primer
Git and Github - A primerGit and Github - A primer
Git and Github - A primer
Suryakumar Sudar
 
git Technologies
git Technologiesgit Technologies
git Technologies
Hirantha Pradeep
 
Git basics
Git basicsGit basics
Git basics
glitchdata
 
Git Tech Talk
Git  Tech TalkGit  Tech Talk
Git Tech Talk
Chris Johnson
 
The Fundamentals of Git
The Fundamentals of GitThe Fundamentals of Git
The Fundamentals of Git
DivineOmega
 
GIT.pptx
GIT.pptxGIT.pptx
GIT.pptx
Soumen Debgupta
 
Git.odp 0
Git.odp 0Git.odp 0
Git.odp 0
Mannu Malhotra
 
Lets git to it
Lets git to itLets git to it
Lets git to it
Yoram Michaeli
 

Similar to Using Subversion and Git Together (20)

Git
GitGit
Git
 
Git
GitGit
Git
 
Advanced Git Tutorial
Advanced Git TutorialAdvanced Git Tutorial
Advanced Git Tutorial
 
Git Beginner Preso
Git Beginner PresoGit Beginner Preso
Git Beginner Preso
 
Git basic
Git basicGit basic
Git basic
 
Git basics
Git basicsGit basics
Git basics
 
Git
GitGit
Git
 
Git
GitGit
Git
 
Subversion to Git Migration
Subversion to Git MigrationSubversion to Git Migration
Subversion to Git Migration
 
Git and Github - A primer
Git and Github - A primerGit and Github - A primer
Git and Github - A primer
 
git Technologies
git Technologiesgit Technologies
git Technologies
 
Git in Eclipse
Git in EclipseGit in Eclipse
Git in Eclipse
 
Git basics
Git basicsGit basics
Git basics
 
Git Tech Talk
Git  Tech TalkGit  Tech Talk
Git Tech Talk
 
The Fundamentals of Git
The Fundamentals of GitThe Fundamentals of Git
The Fundamentals of Git
 
Git
GitGit
Git
 
GIT.pptx
GIT.pptxGIT.pptx
GIT.pptx
 
Git.odp 0
Git.odp 0Git.odp 0
Git.odp 0
 
Git+jenkins+rex presentation
Git+jenkins+rex presentationGit+jenkins+rex presentation
Git+jenkins+rex presentation
 
Lets git to it
Lets git to itLets git to it
Lets git to it
 

Recently uploaded

Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
Kari Kakkonen
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
Dorra BARTAGUIZ
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
DianaGray10
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
Laura Byrne
 

Recently uploaded (20)

Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdfFIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
FIDO Alliance Osaka Seminar: Passkeys and the Road Ahead.pdf
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
Climate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing DaysClimate Impact of Software Testing at Nordic Testing Days
Climate Impact of Software Testing at Nordic Testing Days
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Elevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object CalisthenicsElevating Tactical DDD Patterns Through Object Calisthenics
Elevating Tactical DDD Patterns Through Object Calisthenics
 
UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4UiPath Test Automation using UiPath Test Suite series, part 4
UiPath Test Automation using UiPath Test Suite series, part 4
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
The Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and SalesThe Art of the Pitch: WordPress Relationships and Sales
The Art of the Pitch: WordPress Relationships and Sales
 

Using Subversion and Git Together

  • 1. Subversion Day Using Subversion and Git Together June 14th 2012, Berlin
  • 2. About Us ● TMate Software ● We create VCS tools since year 2003 ● Products at pre-release stage ● SubGit (RC, self-hosting for 6 months) ● HG4J (Beta) ● Our mature products: ● SvnKit (1.7.4, 30% of the ASF requests) ● SqlJet (1.1.2)
  • 3. Subversion and Git ● Subversion: ● Mature, well known and widely used ● Centralized ● Manager-friendly ● Git: ● Fast growing VCS ● Distributed ● Geek-friendly
  • 4. Subversion and Git server ● Single repository at ● Many repositories shared centralized server ● Forks ● All branches and forks are in the same repository ● Delayed commits
  • 5. Subversion and Git How is it possible to use both?!
  • 7. Git-Svn Approach overview server server
  • 8. Git-Svn Approach client-side, partisan deployment server User 1 User 2
  • 9. Git-Svn Approach double translation, resulting in data loss server 2. pull: 1. push: Svn to Git Git to Svn User 1 User 2
  • 10. Git-Svn Approach custom non-Git workflow Git-Svn commands: server ● fetch ● dcommit ● rebase ● branch ... User 1
  • 11. Git-Svn Approach custom non-Git workflow Standard Git push: - local commit - remote commit local state git pull, git push, merge commit created new commits pushed
  • 12. Git-Svn Approach custom non-Git workflow Git-Svn dcommit: local state git svn dcommit, git svn dcommit, git svn dcommit, requires rebase first (commit) (fetchback, sign)
  • 13. Git-Svn Approach summary ● Client side ● Each user needs to translate at least part of the repository ● Non-standard workflow ● Part of standard Git package, but... ● …git-svn is 5000 lines script of perl code
  • 14. SubGit overview subgit server
  • 15. SubGit approach details ● Installed into repository ● Uses hooks ● Translation is performed in the background to minimize overhead
  • 16. SubGit default installation Server Subversion svn pre-commit hook SubGit translation daemon git pre-receive hook git post-receive hook Git
  • 17. SubGit Apache configuration example <Location /svn> # http://repos.host.com/svn/project DAV Svn SVNParentPath /var/svn/repos Require valid-user AuthType Basic AuthUserFile /var/svn/repos/passwords </Location> <Location /git> # http://repos.host.com/git/project ScriptAlias /git/ … … Require valid-user AuthType Basic AuthUserFile /var/svn/repos/passwords </Location>
  • 18. SubGit asynchronous translation svn subgit git data transfer translation scheduled pre-commit revision installed revision added to post-commit SubGit translation queue git commit created
  • 19. SubGit asynchronous translation git subgit svn data transfer translation scheduled pre-receive references updated post-receive commit(s) added to SubGit translation queue svn revision created
  • 21. SubGit summary ● Server side ● One-time centralized deployment ● Reuse of existing infrastructure ● Pure Git/Subversion experience ● Safe and smooth migration ● Commercial quality tool
  • 22. SubGit safe migration subgit
  • 23. SubGit smooth migration VCS transparency “Clean cut” Git adoption t migration VCS transparency SubGit smooth t migration
  • 24. Subversion<=>Git Translation ● Branches and Tags ● References ● Deltas ● Trees ● Special properties ● Special files ● Merge tracking info ● Commit parents
  • 25. Branches and Tags overview master 1.1.x 1.0.x /trunk /branches /branches/1.0.x /branches/1.1.x /tags /tags/1.0.0 1.0.0 --- r10 M /branches/1.0.x/file.txt
  • 26. Branches and Tags mapping trunk = trunk:refs/heads/master branches = branches/*:refs/heads/* tags = tags/*:refs/tags/* shelves = shelves/*:refs/shelves/*
  • 27. Branches and Tags master Which history line is a trunk? And which is a branch? Heuristics help!
  • 28. Branches and Tags shelves master Unnamed Git branch /shelves/author[_date] --- r20 M /shelves/alex/file.txt
  • 29. Branches and Tags attic references master branch master master attic/ branch
  • 30. Braches and Tags ● From Subversion to Git ● Single Subversion revision might be translated to multiple Git commits ● From Git to Subversion ● Heuristics help to detect target branch in complex cases ● /shelves directory is used to store anonymous branches
  • 31. Deltas and Trees ● Subversion revision is a delta: --- r20 A /trunk/file.txt M /trunk/dir/file.txt A /trunk/dir/copy.txt from /trunk/file.txt@r10 D /trunk/dir/old_file.txt ● Delta tracks copies ● Git commit is always a full file tree
  • 32. Deltas and Trees ● From Subversion to Git ● Relevant part of the delta is applied to the parent commit tree ● From Git to Subversion ● Renames and copies are detected at translation time ● Branches and tags creation uses copy operation
  • 33. Special Properties ● properties: ● files: ● svn:ignore ● .gitignore ● svn:eol-style ● .gitattributes ● svn:mime-type file.txt .gitattributes svn:eol-style=native * text=auto !eol
  • 34. Special Properties ● From Subversion to Git ● svn:ignore; svn:mime-type and svn:eol-style are translated ● From Git to Subversion ● .gitignore and relevant values set in .gitattributes are translated
  • 35. Merge Tracking Git merge commits: In Git merges are tracked by: ● Natural history ● Merge commits parents ● Merge unit is commit
  • 36. Merge Tracking ● Subversion tracks merges by ● Natural history ● Revisions ranges (including cherry-picks) ● Merge unit is file or a directory /trunk@r100 svn:mergeinfo=/branches/1.0.x:1-100,105 /trunk/file.txt@r100 svn:mergeinfo=/branches/1.0.x/file.txt:102
  • 37. Merge Tracking ● From Subversion to Git ● Branch-level merges are translated to merge commits ● From Git to Subversion ● Merge commits are represented with svn:mergeinfo
  • 38. Not Yet Translated (in SubGit 1.0) ● Empty directories ● Arbitrary properties ● Revision properties ● Externals references
  • 39. It Works! $ svnadmin create repos .... $ subgit install repos $ git clone repos git-clone .... $ svn co svn://host/repos wc ....
  • 40. SubGit Target Audience ● Managers who listen to their Geeks ● Hosting providers ● Safe and smooth migration ● Java 1.5 or newer is needed ● Linux, OS X, Windows Server 2003
  • 41. On SubGit Availabilty ● SubGit 1.0 release: June 2012 ● SubGit is free for Open Source and Start-Up Projects ● Closed-source projects will have to register SubGit (purchase a registration key) ● Dedicated technical support for SubGit
  • 42. Thank you! ● SubGit on Web: http://subgit.com/ ● SubGit on Twitter: @subgit ● Page on Google+ (SubGit) ● Blog: http://blog.subgit.com/ ● Using Gerrit with Subversion ● Thank you! :)