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: [msysGit] Re: Trailing spaces in branchname (git-svn)
Date: Wed, 15 Jun 2011 16:38:15 +0200 [thread overview]
Message-ID: <BANLkTikgF53tKbUsJJznENAiW8Smm5ePPA@mail.gmail.com> (raw)
In-Reply-To: <b8767de1-ab2c-4d2a-9024-9ad9b29c614d@j9g2000vbs.googlegroups.com>
Again, please don't cull the CC-list. When replying, hit "reply all"
in your e-mail client.
Also, please don't top-post either. It makes it harder for others to
follow the discussion. I've corrected the quoting this time.
On Wed, Jun 15, 2011 at 4:12 PM, Barthus <magnus.kallstrom@gmail.com> wrote:
> On 15 Juni, 16:00, Erik Faye-Lund <kusmab...@gmail.com> wrote:
>> Please don't cull the CC-list.
>>
>> On Wed, Jun 15, 2011 at 3:38 PM, Barthus <magnus.kallst...@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.
>
> Ok, thanks. I'll try as soon as possible (will be away for a few
> days...)
>
You might want to try this patch instead, as it deals with refnames
like "foo /bar" and "foo \bar" also:
diff --git a/git-svn.perl b/git-svn.perl
index 7849cfc..54894e4 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}g;
+
return $refname;
}
next prev parent reply other threads:[~2011-06-15 14:39 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
[not found] ` <b8767de1-ab2c-4d2a-9024-9ad9b29c614d@j9g2000vbs.googlegroups.com>
2011-06-15 14:38 ` Erik Faye-Lund [this message]
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=BANLkTikgF53tKbUsJJznENAiW8Smm5ePPA@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).