git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Re: Trailing spaces in branchname (git-svn)

From
MKMagnus Kallström <magnus.kallstrom@gmail.com>
Date
Jun 21, 2011, 22:16 UTC
Message-ID
<BANLkTinmmk2KRTBy8rZLhpksK_wqM49_aw@mail.gmail.com>
In-Reply-To
<58D5F1F8-CC94-4629-B476-91512ED35E0E@gmail.com>
2011/6/15 Magnus Kallström <magnus.kallstrom@gmail.com>
Show 18 quoted lines
> (I hope I get it right now - previously I used Googles web-interface, and I
> just couldn't find a way to respond to all. Trying from my email client
> instead now... I have even read the 'Welcome post' again :) )
>
> Unfortunately, the patch didn't work.
>
> This is the error I get when it aborts:
> Found branch parent: (refs/remotes/CR3533 sökning på fakturabelopp )
> be4dd98d152d82f098b90089f4df6a2d411d84e1
> fatal: Unable to create 'd:/Dev/GIT/svk/KOB/.git/svn/refs/remotes/CR3533
> sökning på fakturabelopp /index.lock': No such file or directory
> read-tree be4dd98d152d82f098b90089f4df6a2d411d84e1: command returned error:
> 128
>
> The patch itself is probably working for other parts, and I even tried a
> similar patch back in March. I never managed to figure out where the call to
> the locking-function got it's path though.
>
Hi again!

I have now successfully cloned "my" repository with the following changes in git-svn.perl. I'm not sure if the change in "sub refname" is needed, but I will try to reproduce the error when I find the time for it (the full clone fails after 2-3 days).

I can't tell if it breaks anything else, but as far as I can tell, the clone is working.

Does it look as if the modification is done in the right place?
/Magnus
---8<---
diff --git a/git-svn.perl b/git-svn.perl
index 7849cfc..c5e2d23 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;
 }

@@ -3883,6 +3886,7 @@ sub _new {
     }

     $_[3] = $path = '' unless (defined $path);
+    $dir =~ s{ (?=/|\\|$)}{%20}g;
     mkpath([$dir]);
     bless {
         ref_id => $ref_id, dir => $dir, index => "$dir/index",
---8<---
Previous: Magnus Kallström
Message 5 of 5 in “Re: [msysGit] Trailing spaces in branchname (git-svn)”
  1. Erik Faye-LundMar 24, 2011
  2. Erik Faye-LundJun 15, 2011
  3. Erik Faye-LundJun 15, 2011
  4. Magnus KallströmJun 15, 2011
  5. Magnus KallströmJun 21, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.