1

In our company we are working currently on svn, and were wondering if it's possible to switch to git, but of course it's not so trivial.

First of all we are actively using svn revisioning to identify current build, and svn revision numbering is much easier to use than git hashes. There actually exists a mixed approach - but those are available only on github:

git hash to svn number generation scheme

With git it's possible to use git hash to identify commit number, and even to perform tagging, but it most probably will require manual tagging for each commit, which sounds bit difficult.

Besides this we have not one svn repository, but multiple svn repositories, cross referencing to each other via external references. As you might guess, in git this is not so trivial either - there exists sub-modules, but committing to sub-module requires commit to it's parent git repository.

Anyway... I think git still could be taken into use, but I was starting to wondering if there actually exists helper build systems, which can fully abstract svn and git.

I guess that helper build system:

  • must be open source code
  • it must abstract git and svn, and work identically on both of them.
  • it should support external repositories, potentially branching, potentially automatic commit numbering similar to svn.
  • it could use "svn" or "git" command line tools to perform necessary operations.

I have found at least SvnClient:

https://sharpsvn.open.collab.net/servlets/ProjectProcess?pageID=3797&freeformpage=Samples

But by quickly glancing that code - it's managed C++, heavy, and I suspect non-trivial to change. Not easy to modify into correct direction. Also does not support git.

I would prefer that as programming language would be C# or C++. (but not managed C++)

Can you recommend me something ?

And of course if such helper functions does not exists, maybe someone can recommend from where to start (either svn client or git client, open source code alternatives)

TarmoPikaro
  • 4,723
  • 2
  • 50
  • 62

1 Answers1

0

In general, you can not use git and svn commands for the same repo. Also as the tool you linked, it only execute some svn commands.

Even it’s possible to develop the tool which can execute both git and svn commands, but for a certain repo, it can only use the svn or git repo.

SVN and Git are different VCS, and the local repo for SVN and Git VCS are quite different. In check working copy of a SVN repo, there has the .svn folder to manages the versions. And in local git repo, there has the .git folder to manage the versions for local git repo.

  • Assume if you checkout SVN repo in a directory, and the svn commands can only be used. If you try to use git commands, it will show the message not a git repository.
  • Assume if you clone a Git repo in a local directory, the git commands can only be used. If you try to use svn commands, it will show the message not a working copy.
Marina Liu
  • 36,876
  • 5
  • 61
  • 74
  • Main idea is that I want to abstract git & svn so after transferring all data from one repository to another, I would have same kind of toolset's for using both repositories. So helper tools (C# script for example) would make transition smooth for me. – TarmoPikaro Nov 22 '17 at 09:15
  • Since you just need to use a kind of VCS commands for a certain repo, it's not make a big difference to developer the tool to merge the two kinds of VCS commands together. – Marina Liu Nov 23 '17 at 08:11