git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH/RFC] git-svn: sanitize_remote_name should accept underscores.
@ 2008-06-24 15:54 Avery Pennarun
  2008-06-25  6:44 ` Eric Wong
  0 siblings, 1 reply; 7+ messages in thread
From: Avery Pennarun @ 2008-06-24 15:54 UTC (permalink / raw)
  To: git, normalperson, gitster; +Cc: Avery Pennarun

Without this patch, git-svn failed with the error:
 config --get svn-remote.D2007.Win32.url: command returned error: 1

...upon trying to automatically follow a link from a child branch back to
its parent branch D2007_Win32 (note the underscore, not dot, separating the
two words).

Note that I have each of my branches defined (by hand) as separate
svn-remote entries in .git/config since my svn repository layout is
nonstandard.

Signed-off-by: Avery Pennarun <apenwarr@gmail.com>

---
I'm not sure why sanitize_remote_name is so picky about allowed characters,
but underscore should certainly be allowed.  I'm worried that this has
revealed a more serious problem, since presumably sanitizing the name
shouldn't break anything in any case.

---
 git-svn.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/git-svn.perl b/git-svn.perl
index 4c9c59b..263d66c 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1465,7 +1465,7 @@ sub verify_remotes_sanity {
 # we allow more chars than remotes2config.sh...
 sub sanitize_remote_name {
 	my ($name) = @_;
-	$name =~ tr{A-Za-z0-9:,/+-}{.}c;
+	$name =~ tr{A-Za-z0-9:,_/+-}{.}c;
 	$name;
 }
 
-- 
1.5.6.56.g29b0d

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-06-29  3:41 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-24 15:54 [PATCH/RFC] git-svn: sanitize_remote_name should accept underscores Avery Pennarun
2008-06-25  6:44 ` Eric Wong
2008-06-25  6:55   ` Eric Wong
2008-06-25  7:11     ` Junio C Hamano
2008-06-25  7:45       ` Eric Wong
2008-06-25 15:01         ` Avery Pennarun
2008-06-29  3:40           ` [PATCH] git-svn: don't sanitize remote names in config Eric Wong

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).