Archive:Xbmc-git-svn: Difference between revisions

From Official Kodi Wiki
Jump to navigation Jump to search
>Ceros
(→‎Graft points: note graft point for xdmx from linuxport)
mNo edit summary
 
(33 intermediate revisions by 3 users not shown)
Line 1: Line 1:
This page has notes on what is done for the migration from svn to git.
__TOC__
__TOC__
This page has notes on what is done for the migration from svn to git.


= XBMC Main Repo =
= XBMC Main Repo =
Line 6: Line 7:


<source lang="bash">
<source lang="bash">
#!/bin/sh                      
#!/bin/sh                                                                  


set -e
set -e
Line 17: Line 18:


# The xbmc sourceforge git repo to push to.
# The xbmc sourceforge git repo to push to.
XBMC_GIT_SF_REPO="ssh://[email protected]/gitroot/xbmc/xbmc"                                                                            
XBMC_GIT_SF_REPO="ssh://[email protected]/gitroot/xbmc/xbmc"


# The xbmc github repo to push to.
# The xbmc github repo to push to.
Line 23: Line 24:


# The xbmc gitorious repo to push to.
# The xbmc gitorious repo to push to.
XBMC_GITORIOUS_REPO="[email protected]:xbmc/mainline.git"
XBMC_GITORIOUS_REPO="[email protected]:xbmc/xbmc.git"


USAGE="\n\
USAGE="\n\
Line 33: Line 34:
  -h, --help                Display this help message.\n\                     
  -h, --help                Display this help message.\n\                     
  --initial-setup            Only setup the git repo and exit.\n\               
  --initial-setup            Only setup the git repo and exit.\n\               
--initial-checkout        Perform the initial checkout.\n\                 
  --perform-push            Performs a git push after fetching new svn revs.\n\
  --perform-push            Performs a git push after fetching new svn revs.\n\
  --local-git-repo GIT_REPO  Override the default local git repo used, which\n\  
  --local-git-repo GIT_REPO  Override the default local git repo used, which\n\  
Line 44: Line 46:
             shift           
             shift           
             ;;             
             ;;             
         --perform-push)  
        --initial-checkout)   
             PERFORM_PUSH=1  
            INITIAL_CHECKOUT=1
             shift        
            shift             
             ;;            
            ;;               
         --local-git-repo)
         --perform-push)      
             PERFORM_PUSH=1    
             shift            
             ;;                
         --local-git-repo)    
             LOCAL_GIT_REPO="$2"
             LOCAL_GIT_REPO="$2"
             shift; shift       
             shift; shift       
Line 62: Line 68:
initialize_repo () {                                                           
initialize_repo () {                                                           
     # Setup the repo with standard layout and prefix of svn/                   
     # Setup the repo with standard layout and prefix of svn/                   
     git svn init "$XBMC_SVN_REPO" --stdlayout --prefix=svn/                  
     git svn init --stdlayout --prefix=origin/ "$XBMC_SVN_REPO"               


     # Make tags go into refs/remotes/svn-tags instead of refs/remotes/svn
     # Make tags go into refs/remotes/svn-tags instead of refs/remotes/svn
     git config svn-remote.svn.tags tags/*:refs/remotes/svn-tags/*      
     git config svn-remote.svn.tags tags/*:refs/tags/*                  


     # Don't follow parents when cloning the svn. This greatly decreases the
     # Settings we apply to keep memory usage sane only on the xbmc.org
     # time needed to clone the svn repo. We'll graft any development history
     # servers                                                       
     # as needed later.
    git config core.packedGitWindowSize 32m                         
     git config svn-remote.svn.followparent false
     git config core.packedGitLimit 64m                               
     git config pack.threads 2                                       
    git config pack.windowMemory 64m


     # Settings we apply to keep memory usage sane on the xbmc.org servers
     # The remote repositories to push to. Sourceforge git repo will be labeled
    git config core.packedGitWindowSize 32m                             
     # as 'origin'.
     git config core.packedGitLimit 64m                                 
     git remote add origin "$XBMC_GIT_SF_REPO"
    git config pack.threads 2                                           
    git config pack.windowMemory 64m                                   
 
    # The remote repositories to push to
     git remote add xbmc-git-sf "$XBMC_GIT_SF_REPO"
     git remote add xbmc-github "$XBMC_GITHUB_REPO"
     git remote add xbmc-github "$XBMC_GITHUB_REPO"
     git remote add xbmc-gitorious "$XBMC_GITORIOUS_REPO"
     git remote add xbmc-gitorious "$XBMC_GITORIOUS_REPO"
Line 88: Line 91:


# Do all git commands in git repo
# Do all git commands in git repo
test -d "$LOCAL_GIT_REPO" || mkdir -p "$LOCAL_GIT_REPO"
cd "$LOCAL_GIT_REPO"
cd "$LOCAL_GIT_REPO"
do_initial_checkout () {
    # This should only be run once.
    if git log 545fb262092af486f386c7540455da47245ddc4e >/dev/null 2>&1; then
        echo "Initial checkout has already been done."
        exit 1
    fi
    git svn fetch
    echo "928c8da7f7cd9dc734e7fd7c4b0f6842c0e3fa81 a2c7102f3b29b8a36c2aaf1e2362a94632443707" > .git/info/grafts
    git filter-branch -- --all
    git for-each-ref --format='%(refname)' refs/original | while read ref; do git update-ref -d "$ref"; done
    git gc --expire=now
    # Immediately exit after initial checkout
    exit 0
}


if [ "$INITIAL_SETUP" ]; then
if [ "$INITIAL_SETUP" ]; then
     initialize_repo
     initialize_repo
elif [ "$INITIAL_CHECKOUT" ]; then
    do_initial_checkout
fi
fi


# This fetches new changes from svn and always reset the master branch to
# This fetches new changes from svn
# linuxport
git svn fetch
git svn fetch
git svn rebase


# This pushes to the remote git repos. master and all svn branches end up in
# This pushes to the remote git repos. master and all svn branches end up in
Line 103: Line 123:
# simply do 'git clone $URL xbmc' to grab all branches and tags
# simply do 'git clone $URL xbmc' to grab all branches and tags
if [ "$PERFORM_PUSH" ]; then
if [ "$PERFORM_PUSH" ]; then
     git push xbmc-git-sf master
     git push origin master refs/remotes/origin/*:refs/heads/* refs/tags/*:refs/tags/*
    git push xbmc-git-sf refs/remotes/svn/*:refs/heads/*
     git push xbmc-github master refs/remotes/origin/*:refs/heads/* refs/tags/*:refs/tags/*
    git push xbmc-git-sf refs/remotes/svn-tags/*:refs/tags/*
     git push xbmc-gitorious master refs/remotes/origin/*:refs/heads/* refs/tags/*:refs/tags/*
#     git push xbmc-github master
#    git push xbmc-github refs/remotes/svn/*:refs/heads/*
#    git push xbmc-github refs/remotes/svn-tags/*:refs/tags/*
#     git push xbmc-gitorious master
#    git push xbmc-gitorious refs/remotes/svn/*:refs/heads/*
#    git push xbmc-gitorious refs/remotes/svn-tags/*:refs/tags/*
fi
fi
</source>
</source>


== Graft points ==
= Vendor Branches =
Here is a list of graft points we had to use to fix the development history in our git repo.
All vendor sources are being recloned from their respective upstream VCS repositories. We're keeping each vendor source as it's own repository on sourceforge. The "current" branch in the repos is the branch we pin ourselves to make modifications. They are the specific tags or revisions we modify from the respective upstream for xbmc. The "master" branch contains those modifications made from the "current" branch.
 
linuxport switched to trunk at rev 23097. Have child rev (23097) follow parent rev (23094) which was last change made to linuxport before the move.
<pre>b35077e53e80b7f707b2b3c4f72a19f4fd55fa57 cc7bfb716f6c2986b1074dd99bfe45462c1f8c75</pre>
 
Here is the graft points for the xbox branch. The xbox branch was created from trunk before the move (r23095). It's parent should be the last change from trunk before the move (r23073).
<pre>5692c65551cc915c2a1d4400f06e0e4831bc553d fd899ba70e579fa9049f8b6b612970a2f12fecf1</pre>


This is the graft point for when the linuxport branch was created from trunk. The revisions are r8638 (child) and r8637 (parent).
== faad2 ==
<pre>9364c718f19787944aa07f5bb3b6eaf885762ac6 3473363e3ad856c5ad48536d947d80aba6fc1f82</pre>


This is the graft point for branch prettylights from linuxport (r22888 from r22886).
cvs from sourceforge
<pre>abb7ef866645079f01142f60dbc491c93fd893e7 40181a51c8b53b038036c1bbfbc325d263d4f7bf</pre>
 
This is the graft point for branch xdmx from linuxport (r21840 from r21839).
<pre>1f8744a36fd28e08128f6682c1581bed3c87de5d 15a2b8d2aeff9f668bb724e1178649617b026eab</pre>
 
= Vendor Branches =
All vendor sources are being recloned from their respective upstream VCS repositories. We're keeping each vendor source as it's own repository on sourceforge. The "current" branch in the repos is the branch we pin ourselves to make modifications. They are the specific tags or revisions we modify from the respective upstream for xbmc. The "master" branch contains those modifications made from the "current" branch.


== FFmpeg and libswscale ==
== FFmpeg and libswscale ==
Line 228: Line 228:
</source>
</source>


== Python ==
== liba52 ==
We're currently fetching from svn for now. We'll switch to using the hg-git plugin or hg-fast-export once the Python migration to mercurial is complete.


Python has a standard layout for their svn repo (branches, tags, and trunk). We want to change where tags gets placed, so here we start by creating a directory for python, then doing a 'git svn init'.
svn from videolan
<source lang="bash">
$ mkdir python
$ cd python
$ git svn init -s --prefix=svn/ http://svn.python.org/projects/python
</source>


Next we modify where the tags will go.
== libcdio ==
Development for libcdio is done with a git repository so this one is really simple.
<source lang="bash">
<source lang="bash">
$ git config svn-remote.svn.tags python/tags/*:refs/remotes/svn-tags/*
$ git clone git://git.sv.gnu.org/libcdio.git libcdio
</source>
</source>


Now we start fetching.
We pin ourselves to release 0.80 and create the "current" branch.
<source lang="bash">
<source lang="bash">
$ git svn fetch
$ cd libcdio
</source>
$ git reset --hard release_0_80
 
We pin ourselves to release 2.4.6 and create a "current" branch.
<source lang="bash">
$ git reset --hard svn-tags/r246
$ git branch current
$ git branch current
</source>
</source>
Line 256: Line 247:
Now we push to sourceforge.
Now we push to sourceforge.
<source lang="bash">
<source lang="bash">
$ git remote add sf ssh://[email protected]/gitroot/xbmc/python
$ git remote add sf ssh://[email protected]/gitroot/xbmc/libcdio
$ git push sf master
$ git push sf master
$ git push sf current
$ git push sf current
$ git push sf refs/remotes/svn/*:refs/heads/svn/*
$ git push sf refs/tags/release_0_80:refs/tags/upstream/release_0_80
$ git push sf refs/remotes/svn-tags/*:refs/tags/svn-tags/*
</source>
</source>


=== Fetch after git clone ===
Here we didn't push the branches or all tags from the libcdio upstream git since they're using a git repository anyway. Instead, anyone wanting to track changes from upstream can simply do the following in the libcdio repository cloned from xbmc.
If you cloned the python repo, either directly or via git submodule within the xbmc git repo (once it's up), you may setup the python repo to fetch from python. Here we do the initial setup, then change the locations for the tags.
<source lang="bash">
<source lang="bash">
$ git svn init -s --prefix=origin/svn/ http://svn.python.org/projects/python
$ git remote add upstream git://git.sv.gnu.org/libcdio.git
$ git config svn-remote.svn.tags python/tags/*:refs/tags/svn-tags/*
$ git fetch upstream
</source>
 
Then you push in a similar manner as if you had cloned the python svn repo directly. Just supply the correct refspec for the branches and tags.
<source lang="bash">
$ git push master
$ git push current
$ git push origin refs/remotes/origin/svn/*:refs/heads/svn/*
$ git push origin refs/tags/svn-tags/*:refs/tags/svn-tags/*
</source>
</source>


Line 311: Line 292:
</source>
</source>


== libdvdread ==
== libdvdnav ==
There's no branches or tags for libdvdread, so it's just a simple clone.
There's no branches or tags for libdvdnav either, so it's just a simple clone.
<source lang="bash">
<source lang="bash">
$ git svn clone svn://svn.mplayerhq.hu/dvdnav/trunk/libdvdread libdvdread
$ git svn clone svn://svn.mplayerhq.hu/dvdnav/trunk/libdvdnav libdvdnav
</source>
</source>


We reset to a particular commit made back in Feb. 15, 2009 (revision 1168). Then we create the "current" branch.
We reset to a particular commit made back in Feb. 2, 2009 (revision 1167). Then we create the "current" branch.
<source lang="bash">
<source lang="bash">
$ cd libdvdread
$ cd libdvdread
$ git reset --hard 3a2808d6556a7fa3123bdc1b2ea767fe3a6002a8
$ git reset --hard 2674174be71aea34a6a52c02d0f494245255fd60
$ git branch current
$ git branch current
</source>
</source>
Line 326: Line 307:
Now we push everything to sourceforge.
Now we push everything to sourceforge.
<source lang="bash">
<source lang="bash">
$ git remote add sf ssh://[email protected]/gitroot/xbmc/libdvdread
$ git remote add sf ssh://[email protected]/gitroot/xbmc/libdvdnav
$ git push sf master
$ git push sf master
$ git push sf current
$ git push sf current
Line 332: Line 313:
</source>
</source>


== libdvdnav ==
== libdvdread ==
There's no branches or tags for libdvdnav either, so it's just a simple clone.
There's no branches or tags for libdvdread, so it's just a simple clone.
<source lang="bash">
<source lang="bash">
$ git svn clone svn://svn.mplayerhq.hu/dvdnav/trunk/libdvdnav libdvdnav
$ git svn clone svn://svn.mplayerhq.hu/dvdnav/trunk/libdvdread libdvdread
</source>
</source>


We reset to a particular commit made back in Feb. 2, 2009 (revision 1167). Then we create the "current" branch.
We reset to a particular commit made back in Feb. 15, 2009 (revision 1168). Then we create the "current" branch.
<source lang="bash">
<source lang="bash">
$ cd libdvdread
$ cd libdvdread
$ git reset --hard 2674174be71aea34a6a52c02d0f494245255fd60
$ git reset --hard 3a2808d6556a7fa3123bdc1b2ea767fe3a6002a8
$ git branch current
$ git branch current
</source>
</source>
Line 347: Line 328:
Now we push everything to sourceforge.
Now we push everything to sourceforge.
<source lang="bash">
<source lang="bash">
$ git remote add sf ssh://[email protected]/gitroot/xbmc/libdvdnav
$ git remote add sf ssh://[email protected]/gitroot/xbmc/libdvdread
$ git push sf master
$ git push sf master
$ git push sf current
$ git push sf current
Line 353: Line 334:
</source>
</source>


== libcdio ==
== libmpeg2 ==
Development for libcdio is done with a git repository so this one is really simple.
 
<source lang="bash">
svn from videolan
$ git clone git://git.sv.gnu.org/libcdio.git libcdio
 
</source>
== libprojectm ==


We pin ourselves to release 0.80 and create the "current" branch.
svn from sourceforge
<source lang="bash">
$ cd libcdio
$ git reset --hard release_0_80
$ git branch current
</source>


Now we push to sourceforge.
== libsquish ==
<source lang="bash">
$ git remote add sf ssh://[email protected]/gitroot/xbmc/libcdio
$ git push sf master
$ git push sf current
$ git push sf refs/tags/release_0_80:refs/tags/upstream/release_0_80
</source>


Here we didn't push the branches or all tags from the libcdio upstream git since they're using a git repository anyway. Instead, anyone wanting to track changes from upstream can simply do the following in the libcdio repository cloned from xbmc.
svn from googlecode
<source lang="bash">
$ git remote add upstream git://git.sv.gnu.org/libcdio.git
$ git fetch upstream
</source>


== ogg ==
== ogg ==
Line 413: Line 379:
$ git push sf refs/remotes/svn-tags/*:refs/tags/svn-tags/*
$ git push sf refs/remotes/svn-tags/*:refs/tags/svn-tags/*
</source>
</source>
== Python ==
We're currently fetching from svn for now. We'll switch to using the hg-git plugin or hg-fast-export once the Python migration to mercurial is complete.
Python has a standard layout for their svn repo (branches, tags, and trunk). We want to change where tags gets placed, so here we start by creating a directory for python, then doing a 'git svn init'.
<source lang="bash">
$ mkdir python
$ cd python
$ git svn init -s --prefix=svn/ http://svn.python.org/projects/python
</source>
Next we modify where the tags will go.
<source lang="bash">
$ git config svn-remote.svn.tags python/tags/*:refs/remotes/svn-tags/*
</source>
Now we start fetching.
<source lang="bash">
$ git svn fetch
</source>
We pin ourselves to release 2.4.6 and create a "current" branch.
<source lang="bash">
$ git reset --hard svn-tags/r246
$ git branch current
</source>
Now we push to sourceforge.
<source lang="bash">
$ git remote add sf ssh://[email protected]/gitroot/xbmc/python
$ git push sf master
$ git push sf current
$ git push sf refs/remotes/svn/*:refs/heads/svn/*
$ git push sf refs/remotes/svn-tags/*:refs/tags/svn-tags/*
</source>
=== Fetch after git clone ===
If you cloned the python repo, either directly or via git submodule within the xbmc git repo (once it's up), you may setup the python repo to fetch from python. Here we do the initial setup, then change the locations for the tags.
<source lang="bash">
$ git svn init -s --prefix=origin/svn/ http://svn.python.org/projects/python
$ git config svn-remote.svn.tags python/tags/*:refs/tags/svn-tags/*
</source>
Then you push in a similar manner as if you had cloned the python svn repo directly. Just supply the correct refspec for the branches and tags.
<source lang="bash">
$ git push master
$ git push current
$ git push origin refs/remotes/origin/svn/*:refs/heads/svn/*
$ git push origin refs/tags/svn-tags/*:refs/tags/svn-tags/*
</source>
== timidity ==
cvs from sourceforge


== vorbis ==
== vorbis ==
Line 433: Line 453:
</source>
</source>


More instructions to follow.
We pin ourselves to tag 1.2.0 and create the "current" branch.
<source lang="bash">
$ git reset --hard svn-tags/libvorbis-1.2.0
$ git branch current
</source>
 
Now we push to sourceforge.
<source lang="bash">
$ git remote add sf ssh://[email protected]/gitroot/xbmc/vorbis
$ git push sf master
$ git push sf current
$ git push sf refs/remotes/svn/*:refs/heads/svn/*
$ git push sf refs/remotes/svn-tags/*:refs/tags/svn-tags/*
</source>
 
== zlib ==
 
unknown VCS
 
[[Category:Development-Archived]]

Latest revision as of 04:47, 4 August 2020

This page has notes on what is done for the migration from svn to git.

XBMC Main Repo

This is the script used to sync the xbmc git repository from the svn repository.

#!/bin/sh                                                                   

set -e

# The xbmc svn repo to pull from.
XBMC_SVN_REPO="https://xbmc.svn.sourceforge.net/svnroot/xbmc"

# local git shared repo for xbmc we clone to.
LOCAL_GIT_REPO="$HOME/git-repos/xbmc"        

# The xbmc sourceforge git repo to push to.
XBMC_GIT_SF_REPO="ssh://[email protected]/gitroot/xbmc/xbmc"

# The xbmc github repo to push to.
XBMC_GITHUB_REPO="[email protected]:ceros/xbmc.git"

# The xbmc gitorious repo to push to.
XBMC_GITORIOUS_REPO="[email protected]:xbmc/xbmc.git"

USAGE="\n\
This script is used to setup a git shared repo to clone an XBMC svn repo.\n\
Once setup, this script can also be used to continually fetch new revisions\n\
and can be used to push to another shared git repo.                           
Usage: xbmc-git-svn [OPTION]\n\                                               
\n\                                                                           
 -h, --help                 Display this help message.\n\                     
 --initial-setup            Only setup the git repo and exit.\n\              
 --initial-checkout         Perform the initial checkout.\n\                  
 --perform-push             Performs a git push after fetching new svn revs.\n\
 --local-git-repo GIT_REPO  Override the default local git repo used, which\n\ 
                            is $LOCAL_GIT_REPO\n"                              

while [ "$#" -gt "0" ]
do                    
    case "$1" in      
        --initial-setup)
            INITIAL_SETUP=1
            shift          
            ;;             
        --initial-checkout)    
            INITIAL_CHECKOUT=1 
            shift              
            ;;                 
        --perform-push)        
            PERFORM_PUSH=1     
            shift              
            ;;                 
        --local-git-repo)      
            LOCAL_GIT_REPO="$2"
            shift; shift       
            ;;                 
        -h|--help|*)           
            printf "${USAGE}"  
            exit 1             
            ;;                 
    esac                       
done                           

# This sets up the local git repo to pull from svn and push into the git repo.
initialize_repo () {                                                          
    # Setup the repo with standard layout and prefix of svn/                  
    git svn init --stdlayout --prefix=origin/ "$XBMC_SVN_REPO"                

    # Make tags go into refs/remotes/svn-tags instead of refs/remotes/svn
    git config svn-remote.svn.tags tags/*:refs/tags/*                    

    # Settings we apply to keep memory usage sane only on the xbmc.org
    # servers                                                         
    git config core.packedGitWindowSize 32m                           
    git config core.packedGitLimit 64m                                
    git config pack.threads 2                                         
    git config pack.windowMemory 64m

    # The remote repositories to push to. Sourceforge git repo will be labeled
    # as 'origin'.
    git remote add origin "$XBMC_GIT_SF_REPO"
    git remote add xbmc-github "$XBMC_GITHUB_REPO"
    git remote add xbmc-gitorious "$XBMC_GITORIOUS_REPO"

    # Immediately exit after initialization
    exit 0
}

# Do all git commands in git repo
cd "$LOCAL_GIT_REPO"

do_initial_checkout () {
    # This should only be run once.
    if git log 545fb262092af486f386c7540455da47245ddc4e >/dev/null 2>&1; then
        echo "Initial checkout has already been done."
        exit 1
    fi
    git svn fetch
    echo "928c8da7f7cd9dc734e7fd7c4b0f6842c0e3fa81 a2c7102f3b29b8a36c2aaf1e2362a94632443707" > .git/info/grafts
    git filter-branch -- --all
    git for-each-ref --format='%(refname)' refs/original | while read ref; do git update-ref -d "$ref"; done
    git gc --expire=now

    # Immediately exit after initial checkout
    exit 0
}

if [ "$INITIAL_SETUP" ]; then
    initialize_repo
elif [ "$INITIAL_CHECKOUT" ]; then
    do_initial_checkout
fi

# This fetches new changes from svn
git svn fetch
git svn rebase

# This pushes to the remote git repos. master and all svn branches end up in
# refs/heads. All svn tags end up in refs/tags. This will make it possible to
# simply do 'git clone $URL xbmc' to grab all branches and tags
if [ "$PERFORM_PUSH" ]; then
    git push origin master refs/remotes/origin/*:refs/heads/* refs/tags/*:refs/tags/*
    git push xbmc-github master refs/remotes/origin/*:refs/heads/* refs/tags/*:refs/tags/*
    git push xbmc-gitorious master refs/remotes/origin/*:refs/heads/* refs/tags/*:refs/tags/*
fi

Vendor Branches

All vendor sources are being recloned from their respective upstream VCS repositories. We're keeping each vendor source as it's own repository on sourceforge. The "current" branch in the repos is the branch we pin ourselves to make modifications. They are the specific tags or revisions we modify from the respective upstream for xbmc. The "master" branch contains those modifications made from the "current" branch.

faad2

cvs from sourceforge

FFmpeg and libswscale

Setting up a repo for FFmpeg with libswscale included was somewhat tricky due to libswscale residing in a different location than FFmpeg. We made use of git-submodule to make this work.

libswscale

First we start off by setting up libswscale. Cloning and pushing libswscale is relatively easy. There's no branches or tags to worry about.

$ git svn clone svn://svn.ffmpeg.org/mplayer/trunk/libswscale
$ cd libswscale

We pin ourselves to a particular revision, namely r29464. XBMC svn repo has it as we pinned ourselves to r29476, but the last change made to libswscale was actually r29464.

$ git reset --hard 1e352e2131331e2f5207384702b3f2b57738dcff

Afterwards we create our "current" branch, then push the "master" and "current" branches to reside in refs/heads on our remote branch in sourceforge. The branch used to track libswscale svn, "git-svn", is also pushed to refs/heads.

$ git branch current
$ git remote add sf ssh://[email protected]/gitroot/xbmc/libswscale
$ git push sf master
$ git push sf current
$ git push sf refs/remotes/git-svn:refs/heads/git-svn

FFmpeg

Next we setup FFmpeg. FFmpeg has branches and the trunk branch in svn, but no tags. Here is what's done for our vendor repository of ffmpeg

$ git svn clone  -Ttrunk -bbranches --prefix=svn/ svn://svn.ffmpeg.org/ffmpeg

Next is pinning down what revision we're working with. Here we pin ourselves to r19851

$ cd ffmpeg
$ git reset --hard 237f339e69bac75bfce0ba686d8c1aec40025b65

Now we create the current branch, push master and current to sf, then push the branches used to track ffmpeg svn up to sf.

$ git branch current
$ git remote add sf ssh://[email protected]/gitroot/xbmc/ffmpeg
$ git push sf master
$ git push sf current
$ git push sf refs/remotes/svn/*:refs/heads/svn/*

libswscale as submodule

Now we want to add libswscale into our ffmpeg repo as a submodule. This is simple enough.

$ git submodule add git://xbmc.git.sourceforge.net/gitroot/xbmc/libswscale libswscale

We check that it was written correctly.

$ git status    
# On branch master                                                              
# Changes to be committed:                                                      
#   (use "git reset HEAD <file>..." to unstage)                                 
#                                                                               
#       new file:   .gitmodules                                                 
#       new file:   libswscale                                                  
#                                                                               
$ cat .gitmodules
[submodule "libswscale"]
        path = libswscale
        url = git://xbmc.git.sourceforge.net/gitroot/xbmc/libswscale
$ ls libswscale
bfin               options.c  rgb2rgb_template.c  swscale.h           yuv2rgb.c
colorspace-test.c  ppc        sparc               swscale_internal.h
Makefile           rgb2rgb.c  swscale.c           swscale_template.c
mlib               rgb2rgb.h  swscale-example.c   x86

Then we commit via our ffmpeg repo (the superproject) and push.

$ git commit
$ git push sf master

Finally, we want the submodule added for the "current" branch as well. We checkout current and ignore the warning saying that libswscale couldn't be removed (it shouldn't be). Then we simply merge with master and push current to sf.

$ git checkout current
$ git merge master
$ git push sf current

Now for anyone wanting to checkout the vendor repo for FFmpeg with libswscale as a submodule, it's a matter of using these four commands.

$ git clone git://xbmc.git.sourceforge.net/gitroot/xbmc/ffmpeg ffmpeg
$ cd ffmpeg
$ git submodule init
$ git submodule update

liba52

svn from videolan

libcdio

Development for libcdio is done with a git repository so this one is really simple.

$ git clone git://git.sv.gnu.org/libcdio.git libcdio

We pin ourselves to release 0.80 and create the "current" branch.

$ cd libcdio
$ git reset --hard release_0_80
$ git branch current

Now we push to sourceforge.

$ git remote add sf ssh://[email protected]/gitroot/xbmc/libcdio
$ git push sf master
$ git push sf current
$ git push sf refs/tags/release_0_80:refs/tags/upstream/release_0_80

Here we didn't push the branches or all tags from the libcdio upstream git since they're using a git repository anyway. Instead, anyone wanting to track changes from upstream can simply do the following in the libcdio repository cloned from xbmc.

$ git remote add upstream git://git.sv.gnu.org/libcdio.git
$ git fetch upstream

libdvdcss

Fetching libdvdcss is rather simple.

$ mkdir libdvdcss
$ cd libdvdcss
$ git svn init -s --prefix=svn/ svn://svn.videolan.org/libdvdcss

We always change the default location where tags get placed.

$ git config svn-remote.svn.tags tags/*:refs/remotes/svn-tags/*

Now we fetch.

$ git svn fetch

Now we pin ourselves to the 1.2.10 tag and create the "current" branch.

$ git reset --hard svn-tags/1.2.10
$ git branch current

Finally we push to sourceforge.

$ git remote add sf ssh://[email protected]/gitroot/xbmc/libdvdcss
$ git push sf master
$ git push sf current
$ git push sf refs/remotes/svn/*:refs/heads/svn/*
$ git push sf refs/remotes/svn-tags/*:refs/tags/svn-tags/*

libdvdnav

There's no branches or tags for libdvdnav either, so it's just a simple clone.

$ git svn clone svn://svn.mplayerhq.hu/dvdnav/trunk/libdvdnav libdvdnav

We reset to a particular commit made back in Feb. 2, 2009 (revision 1167). Then we create the "current" branch.

$ cd libdvdread
$ git reset --hard 2674174be71aea34a6a52c02d0f494245255fd60
$ git branch current

Now we push everything to sourceforge.

$ git remote add sf ssh://[email protected]/gitroot/xbmc/libdvdnav
$ git push sf master
$ git push sf current
$ git push sf refs/remotes/git-svn:refs/heads/git-svn

libdvdread

There's no branches or tags for libdvdread, so it's just a simple clone.

$ git svn clone svn://svn.mplayerhq.hu/dvdnav/trunk/libdvdread libdvdread

We reset to a particular commit made back in Feb. 15, 2009 (revision 1168). Then we create the "current" branch.

$ cd libdvdread
$ git reset --hard 3a2808d6556a7fa3123bdc1b2ea767fe3a6002a8
$ git branch current

Now we push everything to sourceforge.

$ git remote add sf ssh://[email protected]/gitroot/xbmc/libdvdread
$ git push sf master
$ git push sf current
$ git push sf refs/remotes/git-svn:refs/heads/git-svn

libmpeg2

svn from videolan

libprojectm

svn from sourceforge

libsquish

svn from googlecode

ogg

ogg development is done in an svn repository with a non standard layout. There's no branches to track.

$ mkdir ogg
$ cd ogg
$ git svn init -Ttrunk/ogg -ttags/ogg --prefix=svn/ http://svn.xiph.org

We modify where the trunk and tags get stored in the git repo.

$ git config svn-remote.svn.fetch trunk/ogg:refs/remotes/svn/ogg
$ git config svn-remote.svn.tags tags/ogg/*:refs/remotes/svn-tags/*

Now we fetch

$ git svn fetch

We track the 1.1.3 release of ogg and create the "current" branch.

$ git reset --hard svn-tags/libogg-1.1.3
$ git branch current

Now we push to sourceforge.

$ git remote add sf ssh://[email protected]/gitroot/xbmc/ogg
$ git push sf master
$ git push sf current
$ git push sf refs/remotes/svn/*:refs/heads/svn/*
$ git push sf refs/remotes/svn-tags/*:refs/tags/svn-tags/*

Python

We're currently fetching from svn for now. We'll switch to using the hg-git plugin or hg-fast-export once the Python migration to mercurial is complete.

Python has a standard layout for their svn repo (branches, tags, and trunk). We want to change where tags gets placed, so here we start by creating a directory for python, then doing a 'git svn init'.

$ mkdir python
$ cd python
$ git svn init -s --prefix=svn/ http://svn.python.org/projects/python

Next we modify where the tags will go.

$ git config svn-remote.svn.tags python/tags/*:refs/remotes/svn-tags/*

Now we start fetching.

$ git svn fetch

We pin ourselves to release 2.4.6 and create a "current" branch.

$ git reset --hard svn-tags/r246
$ git branch current

Now we push to sourceforge.

$ git remote add sf ssh://[email protected]/gitroot/xbmc/python
$ git push sf master
$ git push sf current
$ git push sf refs/remotes/svn/*:refs/heads/svn/*
$ git push sf refs/remotes/svn-tags/*:refs/tags/svn-tags/*

Fetch after git clone

If you cloned the python repo, either directly or via git submodule within the xbmc git repo (once it's up), you may setup the python repo to fetch from python. Here we do the initial setup, then change the locations for the tags.

$ git svn init -s --prefix=origin/svn/ http://svn.python.org/projects/python
$ git config svn-remote.svn.tags python/tags/*:refs/tags/svn-tags/*

Then you push in a similar manner as if you had cloned the python svn repo directly. Just supply the correct refspec for the branches and tags.

$ git push master
$ git push current
$ git push origin refs/remotes/origin/svn/*:refs/heads/svn/*
$ git push origin refs/tags/svn-tags/*:refs/tags/svn-tags/*

timidity

cvs from sourceforge

vorbis

vorbis development is done in an svn repository with a non standard layout. There's no branches to track. This is pretty much the same way to clone as ogg.

$ mkdir vorbis
$ cd vorbis
$ git svn init -Ttrunk/vorbis -ttags/vorbis --prefix=svn/ http://svn.xiph.org

We modify where the trunk and tags get stored in the git repo.

$ git config svn-remote.svn.fetch trunk/vorbis:refs/remotes/svn/vorbis
$ git config svn-remote.svn.tags tags/vorbis/*:refs/remotes/svn-tags/*

Now we fetch

$ git svn fetch

We pin ourselves to tag 1.2.0 and create the "current" branch.

$ git reset --hard svn-tags/libvorbis-1.2.0
$ git branch current

Now we push to sourceforge.

$ git remote add sf ssh://[email protected]/gitroot/xbmc/vorbis
$ git push sf master
$ git push sf current
$ git push sf refs/remotes/svn/*:refs/heads/svn/*
$ git push sf refs/remotes/svn-tags/*:refs/tags/svn-tags/*

zlib

unknown VCS