{"thread":{"id":"44755","subject":"Bug-Report: git-svn and backslash in SVN branch name","startedAt":"2016-12-22T10:50:54Z","lastAt":"2017-02-21T06:04:25Z","messageCount":5,"participants":["Michael Fladischer","Eric Wong","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"308245","messageId":"cb8cd9b1-9882-64d2-435d-40d0b2b82d59@fladi.at","threadId":"44755","inReplyTo":null,"subject":"Bug-Report: git-svn and backslash in SVN branch name","fromName":"Michael Fladischer","fromEmail":"michael@fladi.at","sentAt":"2016-12-22T10:12:21Z","receivedAt":"2016-12-22T10:50:54Z","isPatch":false,"sender":{"key":"michael@fladi.at","avatar":null},"body":"Hi,\n\nI'm  trying to clone a SVN repo in order to migrate it to git but i hit\na wall with SVN branch names that contain a backslash, which seems to be\nallowed in SVN but prohibited in git refs:\n\nr289 = c4cb1f0c34e741a07de9673515c853d49c5522b9\n(refs/remotes/origin/dicomBaseClass)\nFound possible branch point: file:///path.repo/trunk/dicomBaseClass =>\nfile:///path.repo/tags/dicomBaseClass%5Cv0.1, 181\nInitializing parent: refs/remotes/origin/tags/dicomBaseClass\\v0.1@181\nW: Ignoring error from SVN, path probably does not exist: (160013):\nFilesystem has no item: File not found: revision 101, path\n'/trunk/dicomBaseClass'\nW: Do not be alarmed at the above message git-svn is just searching\naggressively for old history.\nThis may take a while on large repositories\nFound possible branch point: file:///path.repo/dicomBaseClass =>\nfile:///path.repo/trunk/dicomBaseClass, 172\nInitializing parent: refs/remotes/origin/tags/dicomBaseClass\\v0.1@172\nfatal: update_ref failed for ref\n'refs/remotes/origin/tags/dicomBaseClass\\v0.1@172': refusing to update\nref with bad name\n'refs/remotes/origin/tags/dicomBaseClass\\v0.1@172'\nupdate-ref -m r75 refs/remotes/origin/tags/dicomBaseClass\\v0.1@172\n1fe0cc23e3cd56a1087562f8ca3d2e40cd2b30d4: command returned error: 128\n\nThe tag in case is \"dicomBaseClass\\v0.1@172\".\n\nIs there a way to mangle those names on the fly to get rid of the\nbackslashes or can they be handled in any other way to be compatible\nwith git?\n\nCheers,\n-- \nMichael Fladischer\nFladi.at\n\n"},{"id":"308292","messageId":"20161223014202.GA8327@starla","threadId":"44755","inReplyTo":"cb8cd9b1-9882-64d2-435d-40d0b2b82d59@fladi.at","subject":"[PATCH] git-svn: escape backslashes in refnames","fromName":"Eric Wong","fromEmail":"e@80x24.org","sentAt":"2016-12-23T01:42:02Z","receivedAt":"2016-12-23T01:42:08Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Hi Michael, the patch below should fix things up.\n\nJunio: this should go to 'maint', pull request below.\n\n----------------8<---------------\nSubject: [PATCH] git-svn: escape backslashes in refnames\n\nThis brings git-svn refname escaping up-to-date with\ncommit a4c2e69936df8dd0b071b85664c6cc6a4870dd84\n(\"Disallow '\\' in ref names\") from May 2009.\n\nReported-by: Michael Fladischer <michael@fladi.at>\nMessage-ID: <cb8cd9b1-9882-64d2-435d-40d0b2b82d59@fladi.at>\nSigned-off-by: Eric Wong <e@80x24.org>\n---\n  The following changes since commit a274e0a036ea886a31f8b216564ab1b4a3142f6c:\n\n    Sync with maint-2.10 (2016-12-05 11:25:47 -0800)\n\n  are available in the git repository at:\n\n    git://bogomips.org/git-svn.git svn-escape-backslash\n\n  for you to fetch changes up to 22af6fef9b6538c9e87e147a920be9509acf1ddd:\n\n    git-svn: escape backslashes in refnames (2016-12-23 01:37:36 +0000)\n\n  ----------------------------------------------------------------\n  Eric Wong (1):\n        git-svn: escape backslashes in refnames\n\n   perl/Git/SVN.pm | 2 +-\n   1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm\nindex 711d2687a3..98518f4ddb 100644\n--- a/perl/Git/SVN.pm\n+++ b/perl/Git/SVN.pm\n@@ -490,7 +490,7 @@ sub refname {\n \t#\n \t# Additionally, % must be escaped because it is used for escaping\n \t# and we want our escaped refname to be reversible\n-\t$refname =~ s{([ \\%~\\^:\\?\\*\\[\\t])}{sprintf('%%%02X',ord($1))}eg;\n+\t$refname =~ s{([ \\%~\\^:\\?\\*\\[\\t\\\\])}{sprintf('%%%02X',ord($1))}eg;\n \n \t# no slash-separated component can begin with a dot .\n \t# /.* becomes /%2E*\n-- \nEW\n"},{"id":"308293","messageId":"cb6a6ea2-aaa2-8522-a7e2-44e1bc540338@fladi.at","threadId":"44755","inReplyTo":"20161223014202.GA8327@starla","subject":"Re: [PATCH] git-svn: escape backslashes in refnames","fromName":"Michael Fladischer","fromEmail":"michael@fladi.at","sentAt":"2016-12-23T07:06:01Z","receivedAt":"2016-12-23T07:06:31Z","isPatch":true,"sender":{"key":"michael@fladi.at","avatar":null},"body":"On 2016-12-23 02:42, Eric Wong wrote:\n> Hi Michael, the patch below should fix things up.\n\nThank you Eric, I was able to successfully fetch the SVN tag with your\npatch applied.\n\nCheers,\n-- \nMichael Fladischer\nFladi.at\n\n"},{"id":"312185","messageId":"20170221045420.GA24048@whir","threadId":"44755","inReplyTo":"20161223014202.GA8327@starla","subject":"Re: [PATCH] git-svn: escape backslashes in refnames","fromName":"Eric Wong","fromEmail":"e@80x24.org","sentAt":"2017-02-21T04:54:20Z","receivedAt":"2017-02-21T04:55:47Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Junio: ping?\n\nhttps://public-inbox.org/git/20161223014202.GA8327@starla/raw\n\nThanks.\n"},{"id":"312188","messageId":"xmqq4lzohyij.fsf@gitster.mtv.corp.google.com","threadId":"44755","inReplyTo":"20170221045420.GA24048@whir","subject":"Re: [PATCH] git-svn: escape backslashes in refnames","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-02-21T06:02:44Z","receivedAt":"2017-02-21T06:04:25Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Eric Wong <e@80x24.org> writes:\n\n> Junio: ping?\n>\n> https://public-inbox.org/git/20161223014202.GA8327@starla/raw\n>\n> Thanks.\n\nThanks for reminding.  This indeed fell thru cracks.\n"}]}