SVN/Gitlab credentials sync

Hey Guys,
Is there a “smart” way to sync the Gitlab and SVN credentials.
The same user exist on both sides, and I would rather not write the user login and password in the config file for subgit.

Can it be automated somehow ?

  • Christian

Im looking here for the crendetialHelper.sh

https://doc.subgit.com/display/SG/SubGit+configuration+file+reference#SubGitconfigurationfilereference-auth.credentialHelper

Seems like its what I want, but im not successful in getting it working.
Once I remove my credentials from the passwd file it starts failing.

Hi Christian,

I agree, a credentials helper would be helpful if you want to use real users logins, but don’t want to write them in the password file. Credential helper is supposed to be a script or a binary executable that accepts requests and returns credentials, here are little mo detail about the helper:

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

I’m afraid, though, we don’t have any example implementation of a helper but that that little simple snippet in the article.

Yet I’m also wondering why do you intend to set all the logins – it usually enough to have only one “service” SVN account set in the password file for a mirror to run smooth. Of course, having all the SVN usernames and passwords in the SubGit password files makes setting SVN revisions authors a little more easy for SubGit – in this case SubGit can just use an appropriate SVN user and set correct SVN revision author in one transaction – but with a single credentials pair SubGit is also able to set correct authors if pre-revprop-change hook is enabled in the SVN repository:

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

Search for “pre-revprop-change” phrase on the page to go directly to the description.
Did I understood your intend correctly? Or, if not, could you please advise what is the purpose of providing SubGit with all the logins?

Hi @ildar.khusainov,

Lets assume that the passwd file has “user1” credentials
Authers file have mapping for both user1 and user2.
I would like it to be such that gitlab or SVN check-in keeps the author in both repos.
We are 3 users and wanted to keep each user unique.
So a check-in in gitlab as user2 shows up in SVN log as user2.
Currently I keep seeing user1 in the SVN log, when user2 checks into gitlab.

So I dont want to give all the logins to SubGit, just not clear how to avoid it yet :)

  • Christian

Hi Christian,

do I understand correctly that you are committing to a mirrored repository as user2, but the correspondent revision appears in SVN with user1 set as the revision author? If yes, then this is exactly what I was talking about mentioning the pre-revprop-change hook. The matter is that if your setup meets the following conditions:

* if SVN server 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 the pre-revprop-change hook should be enabled in the SVN repository. Otherwise, SubGit is not be able to set correct revision author, which is apparently happening in this case. With the hook enabled in the repository, SubGit will be able to set the correct author according to the authors mapping, so that if you commit as user2, the revision will appear in SVN with user2 set as author. Here are more detail about that:

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

Hi @ildar.khusainov,
Ill check the pre-revprop-change hook status on my side and get back to you.
Hopefully thats just it.
Thanks for your quick help again.

  • Christian

@ildar.khusainov it worked :)
Pre-hook added and no need to have credentials listed inside passwd (except for the service account).

Thank you again!

  • Christian