Subgit configure non-interactive mode

Hi guys,

First of all, I want to congratulate you on the great product that You’ve made.
I recently used your tool to sync my SVN with GitLab. But I got lots of them! about 500 repos on the SVN side. after writing a script to automatically create repos on the Gitlab side, I find it cumbersome to use “subgit configure” since it doesn’t support non-interactive mode to enter username and password for SVN authentication.
Is there any way to use it in non-interactive mode?! If not consider this as a suggestion to add this feature to your nice tool. (just like “subgit import” that has options for being non-interactive).

Thanks in advance,
Regards,
Ali

Hi Ali,

thank you for your kind words!

As for the configure command – I’m afraid that no, it does not have any other modes but the regular one and it does require the SVN authentication, indeed. So the command itself has no means to automate the authentication, but it can be possible to automate the authentication other ways so that SubGit does not ask for credentials running configure.

First of all, SubGit only needs SVN credentials for during the configuration phase (subgit configure command) when the layout auto option is in use – in this case, SubGit connects to the SVN server, scans its history and creates the mapping configuration based on what it found in the history. But the configure command also allows layout std (which is default) and layout directory – those two does not need the connection (and thus the credentials), so the configure command can be used in a script. They create a predefined mapping configurations, however – the former creates so-called “standard” mapping with trunk, branches, and tags, and the latter only creates a configuration with one line to translate the whole repository as a single directory. The idea is that the mapping configuration can then (after the configure command) be set right in the configuration file by the script.

Another way is to store the credentials somewhere so that SubGit does not ask for them during the subgit configure stage. The easiest way is to use svn+ssh with key authentication and place the key in the home directory (default ~/.ssh/id_rsa path for *nix systems), in this case SubGit will pick it up automatically, so the command like this:

subgit configure --layout auto --trunk trunk svn+ssh://username@server.domain/svn/repository

won’t ask for the credentials and will configure the repository.

If ssh is not an option and only http is available, then a possible way is to store the username and password in the SVN credentials cache and SubGit will be able to use those cached credentials during the configuration. Here is an article that describes how to create such a cache:

TMate SubGit: SVN authentication options

Note that to store the credentials in clear text (it may be needed in case of unsupported keyring) the SVN client may require some additional configuration.

Hope it will help.