0

In my enterprise we have a Subversion server which host all projects code. I installed Gitlab and Subgit to set up a mirror which synchronize with the remote Subversion server. I'd test this with one project, it was a success. But for this i filled credentials Subversion on subgit/passwd Git repository project , where those credentials are in plain text. Morever, if i understand it well, to synchronize each project on Gitlab<==>Subversion, we have to fill credentials subversion about user in this subgit/passwd.

Is it possible to have the same single user account to synchronize all Git repositoies handled by Gitlab? With hidden credentials? My goal is to have all the git repositories mapped with subversion projects, and each git repositories have proper authors, but all of them have one common single user account to synchronize those, just a synchronization account in fact.

1 Answers1

0

Yes, it's possible to use only one SVN user account for synchronization, but that may require additional settings to be made on SVN side. Namely if SVN server version 1.7.20, 1.8.12 or 1.9.0 or later is used and it’s being accessed over http(s):// protocol or if the SVN server is being accessed over svn:// protocol, then pre-revprop-change hook has to be enabled in the SVN repository. The hook can do nothing, just exit with code 0, like

Linux and OS X:

  #!/bin/sh
  exit 0;

Windows:

  @echo off
  exit 0

That would be enough; but the hook should be present in the SVN repository for SubGit to be able to set authors names correctly. Otherwise all the new revisions will appear in SVN authored by the same user used for synchronization.

Hidden credentials are also possible with use of a credential helper program:

https://subgit.com/documentation/auth-book.html#auth_helpers

SubGit does not provide such a program, but does support it, so it's possible to write a script that would gather credentials from a database, for example.

And don't forget SubGit will need authors mapping to be properly populated to be able to set revisions/commits authors correctly. The easiest way to provide such a mapping is to fulfill the authors file:

https://subgit.com/documentation/authors-mapping.html#authors_file

but it's also possible to use a helper for this task.

bahrep
  • 29,961
  • 12
  • 103
  • 150
ildar.hm
  • 526
  • 2
  • 5
  • All Subversion versions require a pre-revprop-change hook to allow changes to unversioned properties of existing revisions. Therefore, it is unclear what you mean by "... if SVN server version 1.7.20, 1.8.12 or 1.9.0 or later is used ...". If you need to modify svn:author or any other unversioned property via svnserve or Apache (svn:// or http(s)://), then the hook must be in place regardless of the version. – bahrep Jan 23 '22 at 22:46