Custom alias or regex transform for ${name} in replication config

56 views
Skip to first unread message

Eric

unread,
Apr 17, 2014, 4:51:59 PM4/17/14
to repo-d...@googlegroups.com

Has anyone attempted to replicate Gerrit repositories to BitBucket while their Gerrit project names have a "/" in the name?  Bitbucket will not allow slashes in the project name and replaces them with dashes "-".  I'm currently at loss as to how to use BitBucket with automatic Gerrit replication.  We have other servers configured to use the projects with slashes in the name and it would take days to migrate everything to new names.

Is there something that I missed in the Gerrit replication documentation in terms of variables or special functions to modify the value of ${name} in order to accommodate a service like BitBucket that does not support characters like "/" in the project name? 

(Gerrit Code Review v2.6.1 running on FreeBSD)

Thank you in advance for your help.

David Pursehouse

unread,
Apr 18, 2014, 2:08:23 AM4/18/14
to Eric, repo-d...@googlegroups.com
On 04/18/2014 05:51 AM, Eric wrote:
> Has anyone attempted to replicate Gerrit repositories to BitBucket while
> their Gerrit project names have a "/" in the name? Bitbucket will not
> allow slashes in the project name and replaces them with dashes
> "-". I'm currently at loss as to how to use BitBucket with automatic
> Gerrit replication. We have other servers configured to use the
> projects with slashes in the name and it would take days to migrate
> everything to new names.
>
> Is there something that I missed in the Gerrit replication documentation
> in terms of variables or special functions to modify the value of
> ${name} in order to accommodate a service like BitBucket that does not
> support characters like "/" in the project name?
>

The "remoteNameStyle" option can be used for this:

"dash" - replace slashes with hypnen
"underscore" - replace slashes with underscore
"baseNameOnly" - drop everything before the last slash

> (Gerrit Code Review v2.6.1 running on FreeBSD)
>

The "dash" and "underscore" options should be available in 2.6. The
"baseNameOnly" was added later and IIRC not in 2.6
Reply all
Reply to author
Forward
0 new messages