* Bug-Report: git-svn and backslash in SVN branch name
@ 2016-12-22 10:12 Michael Fladischer
2016-12-23 1:42 ` [PATCH] git-svn: escape backslashes in refnames Eric Wong
0 siblings, 1 reply; 5+ messages in thread
From: Michael Fladischer @ 2016-12-22 10:12 UTC (permalink / raw)
To: git
[-- Attachment #1.1: Type: text/plain, Size: 1525 bytes --]
Hi,
I'm trying to clone a SVN repo in order to migrate it to git but i hit
a wall with SVN branch names that contain a backslash, which seems to be
allowed in SVN but prohibited in git refs:
r289 = c4cb1f0c34e741a07de9673515c853d49c5522b9
(refs/remotes/origin/dicomBaseClass)
Found possible branch point: file:///path.repo/trunk/dicomBaseClass =>
file:///path.repo/tags/dicomBaseClass%5Cv0.1, 181
Initializing parent: refs/remotes/origin/tags/dicomBaseClass\v0.1@181
W: Ignoring error from SVN, path probably does not exist: (160013):
Filesystem has no item: File not found: revision 101, path
'/trunk/dicomBaseClass'
W: Do not be alarmed at the above message git-svn is just searching
aggressively for old history.
This may take a while on large repositories
Found possible branch point: file:///path.repo/dicomBaseClass =>
file:///path.repo/trunk/dicomBaseClass, 172
Initializing parent: refs/remotes/origin/tags/dicomBaseClass\v0.1@172
fatal: update_ref failed for ref
'refs/remotes/origin/tags/dicomBaseClass\v0.1@172': refusing to update
ref with bad name
'refs/remotes/origin/tags/dicomBaseClass\v0.1@172'
update-ref -m r75 refs/remotes/origin/tags/dicomBaseClass\v0.1@172
1fe0cc23e3cd56a1087562f8ca3d2e40cd2b30d4: command returned error: 128
The tag in case is "dicomBaseClass\v0.1@172".
Is there a way to mangle those names on the fly to get rid of the
backslashes or can they be handled in any other way to be compatible
with git?
Cheers,
--
Michael Fladischer
Fladi.at
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] git-svn: escape backslashes in refnames
2016-12-22 10:12 Bug-Report: git-svn and backslash in SVN branch name Michael Fladischer
@ 2016-12-23 1:42 ` Eric Wong
2016-12-23 7:06 ` Michael Fladischer
2017-02-21 4:54 ` Eric Wong
0 siblings, 2 replies; 5+ messages in thread
From: Eric Wong @ 2016-12-23 1:42 UTC (permalink / raw)
To: Michael Fladischer; +Cc: git, Junio C Hamano
Hi Michael, the patch below should fix things up.
Junio: this should go to 'maint', pull request below.
----------------8<---------------
Subject: [PATCH] git-svn: escape backslashes in refnames
This brings git-svn refname escaping up-to-date with
commit a4c2e69936df8dd0b071b85664c6cc6a4870dd84
("Disallow '\' in ref names") from May 2009.
Reported-by: Michael Fladischer <michael@fladi.at>
Message-ID: <cb8cd9b1-9882-64d2-435d-40d0b2b82d59@fladi.at>
Signed-off-by: Eric Wong <e@80x24.org>
---
The following changes since commit a274e0a036ea886a31f8b216564ab1b4a3142f6c:
Sync with maint-2.10 (2016-12-05 11:25:47 -0800)
are available in the git repository at:
git://bogomips.org/git-svn.git svn-escape-backslash
for you to fetch changes up to 22af6fef9b6538c9e87e147a920be9509acf1ddd:
git-svn: escape backslashes in refnames (2016-12-23 01:37:36 +0000)
----------------------------------------------------------------
Eric Wong (1):
git-svn: escape backslashes in refnames
perl/Git/SVN.pm | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm
index 711d2687a3..98518f4ddb 100644
--- a/perl/Git/SVN.pm
+++ b/perl/Git/SVN.pm
@@ -490,7 +490,7 @@ sub refname {
#
# Additionally, % must be escaped because it is used for escaping
# and we want our escaped refname to be reversible
- $refname =~ s{([ \%~\^:\?\*\[\t])}{sprintf('%%%02X',ord($1))}eg;
+ $refname =~ s{([ \%~\^:\?\*\[\t\\])}{sprintf('%%%02X',ord($1))}eg;
# no slash-separated component can begin with a dot .
# /.* becomes /%2E*
--
EW
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] git-svn: escape backslashes in refnames
2016-12-23 1:42 ` [PATCH] git-svn: escape backslashes in refnames Eric Wong
@ 2016-12-23 7:06 ` Michael Fladischer
2017-02-21 4:54 ` Eric Wong
1 sibling, 0 replies; 5+ messages in thread
From: Michael Fladischer @ 2016-12-23 7:06 UTC (permalink / raw)
To: Eric Wong; +Cc: git, Junio C Hamano
[-- Attachment #1.1: Type: text/plain, Size: 230 bytes --]
On 2016-12-23 02:42, Eric Wong wrote:
> Hi Michael, the patch below should fix things up.
Thank you Eric, I was able to successfully fetch the SVN tag with your
patch applied.
Cheers,
--
Michael Fladischer
Fladi.at
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] git-svn: escape backslashes in refnames
2016-12-23 1:42 ` [PATCH] git-svn: escape backslashes in refnames Eric Wong
2016-12-23 7:06 ` Michael Fladischer
@ 2017-02-21 4:54 ` Eric Wong
2017-02-21 6:02 ` Junio C Hamano
1 sibling, 1 reply; 5+ messages in thread
From: Eric Wong @ 2017-02-21 4:54 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Michael Fladischer
Junio: ping?
https://public-inbox.org/git/20161223014202.GA8327@starla/raw
Thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] git-svn: escape backslashes in refnames
2017-02-21 4:54 ` Eric Wong
@ 2017-02-21 6:02 ` Junio C Hamano
0 siblings, 0 replies; 5+ messages in thread
From: Junio C Hamano @ 2017-02-21 6:02 UTC (permalink / raw)
To: Eric Wong; +Cc: git, Michael Fladischer
Eric Wong <e@80x24.org> writes:
> Junio: ping?
>
> https://public-inbox.org/git/20161223014202.GA8327@starla/raw
>
> Thanks.
Thanks for reminding. This indeed fell thru cracks.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-02-21 6:04 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-22 10:12 Bug-Report: git-svn and backslash in SVN branch name Michael Fladischer
2016-12-23 1:42 ` [PATCH] git-svn: escape backslashes in refnames Eric Wong
2016-12-23 7:06 ` Michael Fladischer
2017-02-21 4:54 ` Eric Wong
2017-02-21 6:02 ` Junio C Hamano
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.