clean-git creates local branches only to delete them again -- no change in the end

Issue #11 new
Dominik Pich created an issue

clean-git creates local branches only to delete them again -- no change in the end

.... Creating the local branch 'origin/tags/2.1.0T22' for Subversion branch 'refs/remotes/origin/tags/2.1.0T22'. Creating the local branch 'origin/tags/2.1.0T24' for Subversion branch 'refs/remotes/origin/tags/2.1.0T24'. ..... Deleting Git branch 'origin/tags/2.1.0T22' not in Subversion. Deleted branch origin/tags/2.1.0T22 (was 9be49d2). Deleting Git branch 'origin/tags/2.1.0T24' not in Subversion. Deleted branch origin/tags/2.1.0T24 (was 7e13db9). ...

Comments (21)

  1. Gustavo Refosco Account Deactivated

    I was able to maintain the branches by adding the --no-delete option to the command, so I run it as:

    java -Dfile.encoding=utf-8 -jar ~/Downloads/svn-migration-scripts.jar clean-git --force --no-delete
    

    I got the following output:

    # Creating annotated tags...
    # Creating local branches...
    Creating the local branch 'origin/first-branch' for Subversion branch 'refs/remotes/origin/first-branch'.
    Creating the local branch 'origin/trunk' for Subversion branch 'refs/remotes/origin/trunk'.
    # Checking for obsolete tags...
    svn: warning: W160013: URL 'file:///Users/grefosco/Documents/Training/Subversion/path-test/tags' non-existent in revision 6
    svn: E200009: Could not list all targets because some targets don't exist
    No obsolete tags to remove.
    # Checking for obsolete branches...
    Deleting Git branch 'origin/first-branch' not in Subversion.
    Deleting Git branch 'origin/trunk' not in Subversion.
    # Cleaning tag names
    # Cleaning branch names
    

    Ignore the message about the tags - I just don't have the tags directory. Even though it says the branches are being deleted again, they are actually maintained.

  2. Former user Account Deleted

    I actually report the above issue and was wonder what the fine state of the repository should look like after clean-git? If I follow the steps in https://www.atlassian.com/git/tutorials/migrating-overview to the letter my bit bucket repository has no branches from my svn repo.

    Is this stil the recommended approach for moving from SVN to BitBucket or is there a better approach?

    Thank you,

    Scott

  3. Franz van Betteraey

    I don't think that this is a #8 duplicate.

    This is a really painful bug because although --no-delete makes ist possible to remain the local branches the remote branches will not be deleted (I suppose that should be done). Thus no real cleaning happens.

  4. BINT IT

    I confirm the observation off Gustavo Refosco

    But do not really understand what happens Tags whre also not created as expected, but whre organiesed als branches under a tags Folder (sourceTree)

    $ java -Dfile.encoding=utf-8 -jar /d/_sw_rep/dev/atlassian/svn-migration-scripts.jar clean-git --force
    # Creating annotated tags...
    # Creating local branches...
    Creating the local branch 'origin/V1.0-12' for Subversion branch 'refs/remotes/origin/V1.0-12'.
    Creating the local branch 'origin/tags/V1.0-12' for Subversion branch 'refs/remotes/origin/tags/V1.0-12'.
    Creating the local branch 'origin/tags/V1.0-15' for Subversion branch 'refs/remotes/origin/tags/V1.0-15'.
    Creating the local branch 'origin/tags/V1.2-2' for Subversion branch 'refs/remotes/origin/tags/V1.2-2'.
    Creating the local branch 'origin/tags/V2.1-2' for Subversion branch 'refs/remotes/origin/tags/V2.1-2'.
    Creating the local branch 'origin/trunk' for Subversion branch 'refs/remotes/origin/trunk'.
    # Checking for obsolete tags...
    No obsolete tags to remove.
    # Checking for obsolete branches...
    Deleting Git branch 'origin/tags/V1.0-15' not in Subversion.
    Deleted branch origin/tags/V1.0-15 (was abc8c0b).
    Deleting Git branch 'origin/V1.0-12' not in Subversion.
    Deleted branch origin/V1.0-12 (was 321e2e4).
    Deleting Git branch 'origin/trunk' not in Subversion.
    Deleted branch origin/trunk (was 3122e03).
    Deleting Git branch 'origin/tags/V1.2-2' not in Subversion.
    Deleted branch origin/tags/V1.2-2 (was cbfa7ef).
    Deleting Git branch 'origin/tags/V1.0-12' not in Subversion.
    Deleted branch origin/tags/V1.0-12 (was 3744888).
    Deleting Git branch 'origin/tags/V2.1-2' not in Subversion.
    Deleted branch origin/tags/V2.1-2 (was fbd1e5a).
    # Cleaning tag names
    # Cleaning branch names
    
    $ java -Dfile.encoding=utf-8 -jar /d/_sw_rep/dev/atlassian/svn-migration-scripts.jar clean-git --force --no-delete
    # Creating annotated tags...
    # Creating local branches...
    Creating the local branch 'origin/V1.0-12' for Subversion branch 'refs/remotes/origin/V1.0-12'.
    Creating the local branch 'origin/tags/V1.0-12' for Subversion branch 'refs/remotes/origin/tags/V1.0-12'.
    Creating the local branch 'origin/tags/V1.0-15' for Subversion branch 'refs/remotes/origin/tags/V1.0-15'.
    Creating the local branch 'origin/tags/V1.2-2' for Subversion branch 'refs/remotes/origin/tags/V1.2-2'.
    Creating the local branch 'origin/tags/V2.1-2' for Subversion branch 'refs/remotes/origin/tags/V2.1-2'.
    Creating the local branch 'origin/trunk' for Subversion branch 'refs/remotes/origin/trunk'.
    # Checking for obsolete tags...
    No obsolete tags to remove.
    # Checking for obsolete branches...
    Deleting Git branch 'origin/tags/V1.0-15' not in Subversion.
    Deleting Git branch 'origin/V1.0-12' not in Subversion.
    Deleting Git branch 'origin/trunk' not in Subversion.
    Deleting Git branch 'origin/tags/V1.2-2' not in Subversion.
    Deleting Git branch 'origin/tags/V1.0-12' not in Subversion.
    Deleting Git branch 'origin/tags/V2.1-2' not in Subversion.
    # Cleaning tag names
    # Cleaning branch names
    
  5. Renato Elias

    +1 on this issue. After git-cleaning the converted repo, no local branches and tags are created

  6. Kevin Nagurski

    The best option I've found is to switch to svn2git instead. Does the same thing, but seems to be maintained and works well in this scenario.

  7. Giovanni Van Geel

    The svn-migration-scripts.jar work for git versions v1.x . But since v2.x the svn clone command implies the prefix "origin" which was empty by default in the 1.x version. You can specify that origin prefix during the clone with

    git svn clone --prefix="" --authors-file=./authors.txt --stdlayout Remote_SVN_Path  Clone_In_Directory
    

    Now the svn-migration-scripts.jar clean-git command gets the expected format of the remote definitions and thus handles them correctly. In other words svn-migration-scripts.jar does not support the prefix option of "git svn clone" and thus you should force it to be empty until supported. The change in default behavior of git svn resulted in this "bug".

  8. Jozef Vandenmooter

    This issue is still not fixed. Anyone have an update? The --prefix=”” option “fixes” it for git svn clone, but a subsequent git svn fetch still encounters the issue when running a clean-git. Is there a workaround for that too?

  9. Richardson

    So sad, same problem at this date. Thanks Giuseppe for the svn2git suggestion. Wish me luck guys.

  10. Keith Brown

    Here I am in 2020 still hitting the same problem when following the official Atlassian migration guide (which also hasn’t been updated to even note there’s an issue and send people here)…

  11. Anthony Newton

    Just ran into this in 2021 still, with the latest copy of the migration scripts. Apparently not fixed yet…

  12. Log in to comment