git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Erik Faye-Lund <kusmabite@gmail.com>
To: Barthus <magnus.kallstrom@gmail.com>
Cc: msysGit <msysgit@googlegroups.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: Re: Trailing spaces in branchname (git-svn)
Date: Wed, 15 Jun 2011 16:00:10 +0200	[thread overview]
Message-ID: <BANLkTikaeXxRMJErAYy3-LSrvfNZXAbEEw@mail.gmail.com> (raw)
In-Reply-To: <12ada6de-4345-4259-b832-371a74df9775@l6g2000vbn.googlegroups.com>

Please don't cull the CC-list.

On Wed, Jun 15, 2011 at 3:38 PM, Barthus <magnus.kallstrom@gmail.com> wrote:
>
>> 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.

  parent reply	other threads:[~2011-06-15 14:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <0014af8a-3b24-4398-88aa-7a3e460f2283@s11g2000yqh.googlegroups.com>
2011-03-24 21:26 ` [msysGit] Trailing spaces in branchname (git-svn) Erik Faye-Lund
     [not found]   ` <12ada6de-4345-4259-b832-371a74df9775@l6g2000vbn.googlegroups.com>
2011-06-15 14:00     ` Erik Faye-Lund [this message]
     [not found]       ` <b8767de1-ab2c-4d2a-9024-9ad9b29c614d@j9g2000vbs.googlegroups.com>
2011-06-15 14:38         ` [msysGit] " Erik Faye-Lund
2011-06-15 21:13           ` Magnus Kallström
2011-06-21 22:16             ` Magnus Kallström

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BANLkTikaeXxRMJErAYy3-LSrvfNZXAbEEw@mail.gmail.com \
    --to=kusmabite@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=magnus.kallstrom@gmail.com \
    --cc=msysgit@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).