Changes between Initial Version and Version 1 of WorkingWithGitSVN


Ignore:
Timestamp:
Oct 15, 2015, 1:31:11 PM (9 years ago)
Author:
raimue (Rainer Müller)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • WorkingWithGitSVN

    v1 v1  
     1{{{
     2#!comment
     3#!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%;"
     4This page is a draft! Please feel free to add additional problems or possible solutions.
     5}}}
     6
     7This page is intended to discuss changes required to make it possible to work on the MacPorts base and ports using git-svn.
     8
     9Most of this comes from [https://lists.macosforge.org/pipermail/macports-dev/2014-March/026151.html a mail on macports-dev from March, 2014]:
     10
     11== Getting the initial git svn clone ==
     12
     13The Subversion repository is mirrored in three parts:
     14
     15||=Subversion URL                                                  =||=Git URL                                    =||
     16|| [http://svn.macports.org/repository/macports/trunk/ ^/trunk]     || git://git.macports.org/macports/trunk.git   ||
     17|| [http://svn.macports.org/repository/macports/contrib/ ^/contrib] || git://git.macports.org/macports/contrib.git ||
     18|| [http://svn.macports.org/repository/macports/users/ ^/users]     || git://git.macports.org/macports/users.git   ||
     19
     20The (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.
     21
     22Getting your initial clone with git-svn:
     23{{{
     24git clone git://git.macports.org/macports/trunk.git macports-trunk
     25cd macports-trunk
     26git svn init https://svn.macports.org/repository/macports/trunk --username=<username>@macports.org
     27git config svn-remote.svn.fetch :refs/remotes/origin/master
     28}}}
     29
     30Since the upstream repository is in Subversion, a `git pull` should create a linear history locally by defaulting to `git pull --rebase`:
     31{{{
     32git config branch.master.rebase true
     33}}}
     34
     35
     36== Ignoring files with both svn:ignore and .gitignore ==
     37
     38Git uses `.gitignore` instead of the `svn:ignore` property of Subversion.
     39
     40{{{
     41git svn create-ignore
     42}}}
     43
     44This creates a `.gitignore` file in each directory that has an equivalent `svn:ignore` property.
     45
     46There 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:
     47
     48{{{
     49svn pe svn:ignore $(git svn info --url <PATH>)
     50}}}
     51
     52
     53== Known Problems ==
     54
     55=== No support for svn:keywords property ===
     56
     57The `$Id$` keyword can no longer be used.
     58
     59=== No support for svn:eol-style property ===
     60
     61TODO: do we really need this?
     62
     63=== Mapping author names ===
     64
     65Git 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.
     66
     67{{{
     68curl https://trac.macports.org/wiki/MacPortsDevelopers?format=txt | gawk -F'\\|\\|' \
     69'/^\|\|[^=]\s*/ {
     70    handle = gensub(/\[wiki:([a-z0-9._-]*)\]/, "\\1", 1, gensub(/\s/, "", "g", $2));
     71    email = handle "@macports.org";
     72    name = gensub(/^\s*|\s*$/, "", "g", $3);
     73    if (!match(handle,"nomaintainer|openmaintainer|portmgr")) {
     74        printf "%s = %s <%s>\n", email, name, email;
     75    }
     76}' > AUTHORS.git-svn.txt
     77}}}
     78
     79TODO: This has to be applied when updating the Git mirror, as it will be hardcoded in the Git commit object?