Thread (1 message) 1 message, 1 author, 2016-06-15

Re: Trailing spaces in branchname (git-svn)

From: Erik Faye-Lund <hidden>
Date: 2016-06-15 22:51:28
Subsystem: the rest · Maintainer: Linus Torvalds

Possibly related (same subject, not in this thread)

Please don't cull the CC-list.

On Wed, Jun 15, 2011 at 3:38 PM, Barthus [off-list ref] wrote:
quoted
This kind of question is usually better to ask on the main Git mailing
list, as it's not really Windows specific.
I found a similar (older) thread in the git-mailing-list, discussing
the same issue. This led me to try cloning the same repository on a
Linux-machine - with success. Linux (at least my distro - Ubuntu)
handles trailing spaces in directory names.

Isn't this a msysgit-issue? (I just want to make sure that I don't
spend my (and your) time in the wrong place)
If it works on Linux then yes, it's probably a Git for Windows issue.

Some quick testing reveals that paths can have a trailing space on
Linux, but not on Windows. It sounds to me like you need to modify the
refname subroutine in git-svn.perl to escape this. Something like this
seems to work for me:
---8<---
diff --git a/git-svn.perl b/git-svn.perl
index 7849cfc..7a44145 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -2126,6 +2126,9 @@ sub refname {
 	# @{ becomes %40{
 	$refname =~ s{\@\{}{%40\{}g;

+	# trailing space is not not allowed on Windows
+	$refname =~ s{ $}{%20};
+
 	return $refname;
 }


---8<---
If it works for you, I'll submit a proper patch for it.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help