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

Re: [PATCH/RFC] git-svn: sanitize_remote_name should accept underscores.

From
EWEric Wong <normalperson@yhbt.net>
Date
Jun 25, 2008, 06:44 UTC
Message-ID
<20080625064435.GL21299@hand.yhbt.net>
In-Reply-To
<1214322898-9272-1-git-send-email-apenwarr@gmail.com>
Avery Pennarun <apenwarr@gmail.com> wrote:
Show 12 quoted lines
> 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>
Thanks,
Acked-by: Eric Wong <normalperson@yhbt.net>
Show 5 quoted lines
> ---
> 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.

Weird. It looks like a stupid bug on my part. I'm surprised it took this long to find, since underscore is pretty common...

Show 19 quoted lines
> ---
>  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
Previous: Avery PennarunNext: Eric Wong
Message 2 of 7 in “git-svn: sanitize_remote_name should accept underscores.”
  1. git-svn: sanitize_remote_name should accept underscores.Avery Pennarun, Jun 24, 2008
  2. Eric WongJun 25, 2008
  3. Eric WongJun 25, 2008
  4. Junio C HamanoJun 25, 2008
  5. Eric WongJun 25, 2008
  6. Avery PennarunJun 25, 2008
  7. git-svn: don't sanitize remote names in configEric Wong, Jun 29, 2008

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.