{{{ #!comment #!div style="clear:both; display:block; width: 75%; margin:0 auto; background-color: lightyellow; border: 2pt solid; font-weight:bold; text-align: center; font-size:120%;" This page is a draft! Please feel free to add additional problems or possible solutions. }}} This page is intended to discuss changes required to make it possible to work on the MacPorts base and ports using git-svn. Most of this comes from [https://lists.macosforge.org/pipermail/macports-dev/2014-March/026151.html a mail on macports-dev from March, 2014]: == Getting the initial git svn clone == The Subversion repository is mirrored in three parts: ||=Subversion URL =||=Git URL =|| || [http://svn.macports.org/repository/macports/trunk/ ^/trunk] || git://git.macports.org/macports/trunk.git || || [http://svn.macports.org/repository/macports/contrib/ ^/contrib] || git://git.macports.org/macports/contrib.git || || [http://svn.macports.org/repository/macports/users/ ^/users] || git://git.macports.org/macports/users.git || The (release) branches for base are not mirrored at all and you cannot work against them with git-svn unless you create your own mirror. The following will cover examples for trunk, but you can use them in the same way for the other mirrored directories. Getting your initial clone with git-svn: {{{ git clone git://git.macports.org/macports/trunk.git macports-trunk cd macports-trunk git svn init https://svn.macports.org/repository/macports/trunk --username=@macports.org git config svn-remote.svn.fetch :refs/remotes/origin/master }}} Since the upstream repository is in Subversion, a `git pull` should create a linear history locally by defaulting to `git pull --rebase`: {{{ git config branch.master.rebase true }}} == Ignoring files with both svn:ignore and .gitignore == Git uses `.gitignore` instead of the `svn:ignore` property of Subversion. {{{ git svn create-ignore }}} This creates a `.gitignore` file in each directory that has an equivalent `svn:ignore` property. There is currently no way to synchronize changes to `.gitignore` to the `svn:ignore` properties. The preferred way should be to update `svn:ignore` and then re-generate the `.gitignore` files as shown above. Changes can be made directly on the Subversion repository with this command: {{{ svn pe svn:ignore $(git svn info --url ) }}} == Known Problems == === Editing svn:log revision property needs to be forbidden === As git(-svn) cannot deal with history changes after the revision was synchronized, revision properties may no longer be edited on the Subversion server. === No support for svn:keywords property === The `$Id$` keyword can no longer be used. === No support for svn:eol-style property === TODO: do we really need this? === Mapping author names === Git usually displays real names with email addresses instead of plain usernames. A file with that mapping can be used, but has to be generated from MacPortsDevelopers. {{{ curl https://trac.macports.org/wiki/MacPortsDevelopers?format=txt | gawk -F'\\|\\|' \ '/^\|\|[^=]\s*/ { handle = gensub(/\[wiki:([a-z0-9._-]*)\]/, "\\1", 1, gensub(/\s/, "", "g", $2)); email = handle "@macports.org"; name = gensub(/^\s*|\s*$/, "", "g", $3); if (!match(handle,"nomaintainer|openmaintainer|portmgr")) { printf "%s = %s <%s>\n", handle, name, email; printf "%s = %s <%s>\n", email, name, email; } }' | sort > AUTHORS.git-svn.txt }}} The following names in the svn repository are not mapped by the results of this query. Note that this is list is not exhaustive, and the conversions are best guesses. {{{ akira@macports.org = Akira Kitada anddam@macports.org = Andrea D'Amore andrea.damore@macports.org = Andrea D'Amore jkh@apple.com = Jordan K. Hubbard kvv@apple.com = Kevin Van Vechten macsforever2000@macports.org = Frank Schima n3npq@mac.com = Jeff Johnson nobody = CVS2SVN pguyot@kallisys.net = Paul Guyot portindex@macports.org = PortIndex Generator rmsfisher@macports.org = Ryan Stonecipher root = Mac OS Forge Admin royliu@macports.org = Roy Liu torrey = Torrey Lyons uid50019 = Markus W. Weißmann uid50030 = Toby Peterson wsanchez@apple.com = Wilfredo Sánchez Vega wsiegrist@apple.com = William Siegrist }}} TODO: This has to be applied when updating the Git mirror, as it will be hardcoded in the Git commit object? === TODO: Split base, doc, www, and ports tree === With the current git mirror everyone interested in base is also required to fetch the trees for dports/, doc/ and doc-new/, and www/. Also, all branches for base are missing. For disk space and usability reasons, a separate repository might be easier to handle, especially when you can just add that to sources.conf. Note we already have contrib/ and users/ as separate repositories. Given your Git repository, you can use `git filter-branch(1)` to remove all history but that in a subdirectory. Note that you should do this on a copy of your repository. For example, to split www from the rest of the repository, use {{{ git filter-branch --subdirectory-filter www --prune-empty -- --all }}}