A user requests us to add a configuration option that will tell SubGit to not to change “+” signs in branches/tags names to %2B, so that Git branches with “+” in names had the same names as they counterparts on SVN side.
Hello, any news on when this will be added to a new subgit release? We really need this feature!
Hello Rafael,
At the moment ‘+’ is used as a replacement of ’ ’ character which is allowed (and commonly used) in SVN branch names but not in Git branch names. So
’ ’ in SVN is translated to ‘+’ in Git;
‘+’ in SVN is translated to ‘%2B’ in Git.
After discussing with colleagues we think that we could introduce special option: where to translate spaces. We think about alternatives:
’ ’ in SVN is translated to ‘%20’ in Git;
‘+’ in SVN is translated to ‘+’ in Git.
OR
’ ’ in SVN is translated to ‘’ in Git;
'’ in SVN is translated to ‘%5F’ in Git.
OR
’ ’ in SVN is translated to ‘.’ in Git;
‘.’ in SVN is translated to ‘%2E’ in Git.
So I wonder whether you have spaces, ‘_’, ‘.’ in branch names? Because the solution for ‘+’ could introduce problems for other characters.
Is this something that we would be able to specify in configuration? Can we have, say, ‘’ in SVN translate to ‘…’ in Git?
At the moment, no, but I’m working on the feature I described above right now. I’m thinking about a limited set of legitimate values: “+”, “_”, “.”, and “%20”. I hope these four are broad enough to cover any real life requirements.
But I don’t understand your question fully, you have an empty line in quotes or it is displayed incorrectly. And two dots would be a poor replacement as they are not distinguishable from 2 dots one after another. Also “…” is a bad filename (and Git references are stored as files on the filesystem). Could you elaborate on that? What do you want to replace and why would that be “…”?
Oops, I meant to have a space in there, in the same context as ’ ’ <=> ‘.’. Is it allowed in SVN to have a branch name that is only a single space and nothing else? ‘%20’ seems least likely to conflict but also somewhat obtrusive, while . and _ are both characters that people would naturally use to separate words, while … seems much less common, so I was just wondering if the customization is in a form that would permit ’ ’ <=> ‘…’
I think yes, ’ ’ is a valid SVN branch name.
{code}
$ git co -b ‘a…b’
fatal: ‘a…b’ is not a valid branch name.
$ git co -b ‘a__b’
Switched to a new branch ‘a__b’
$ git co -b ‘a++b’
Switched to a new branch ‘a++b’
{code}
I like this idea, but I’ll discuss it with colleagues first. So far I’ll implement only those 4 values but maybe we will extend them to double-something.
We do have _ and . in package names. However, we don’t use empty spaces. So, at least for our use case the conversion from ’ ’ to ‘%20’ would be the only one which wouldn’t cause issues.
Hello, any news on this issue?
Hello Rafael
the feature is implemented, we are now testing the next SubGit version. Hopefully, it will be available in a matter of days.
The fix is now included into SubGit 3.3.5. I’m closing the issue as “Fixed”.