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

Re: [PATCH] Fix dcommit, rebase when rewriteRoot is in use

From
EWEric Wong <normalperson@yhbt.net>
Date
Mar 8, 2008, 22:22 UTC
Message-ID
<20080308222223.GA1950@hand.yhbt.net>
In-Reply-To
<1205013845-22286-1-git-send-email-jgoerzen@complete.org>
John Goerzen <jgoerzen@complete.org> wrote:
Show 22 quoted lines
> When the rewriteRoot setting is used with git-svn, it causes the svn
> IDs added to commit messages to bear a different URL than is actually
> used to retrieve Subversion data.
> 
> It is common for Subversion repositories to be available multiple
> ways: for instance, HTTP to the public, and svn+ssh to people with
> commit access.  The need to switch URLs for access is fairly common as
> well -- perhaps someone was just given commit access.  To switch URLs
> without having to rewrite history, one can use the old url as a
> rewriteRoot, and use the new one in the svn-remote url setting.
> 
> This works well for svn fetching and general git commands.
> 
> However, git-svn dcommit, rebase, and perhaps other commands do not
> work in this scenario.  They scan the svn ID lines in commit messages
> and attempt to match them up with url lines in [svn-remote] sections
> in the git config.
> 
> This patch allows them to match rewriteRoot options, if such options
> are present.
> 
> Signed-off-by: John Goerzen <jgoerzen@complete.org>
Thanks again, patch + commit message
Acked-by: Eric Wong <normalperson@yhbt.net>
Show 27 quoted lines
> ---
>  git-svn.perl |    7 ++++++-
>  1 files changed, 6 insertions(+), 1 deletions(-)
> 
> diff --git a/git-svn.perl b/git-svn.perl
> index 9e2faf9..1195569 100755
> --- a/git-svn.perl
> +++ b/git-svn.perl
> @@ -1540,9 +1540,14 @@ sub find_by_url { # repos_root and, path are optional
>  			                    $remotes->{$repo_id}->{$_});
>  		}
>  		my $p = $path;
> +		my $rwr = rewrite_root({repo_id => $repo_id});
>  		unless (defined $p) {
>  			$p = $full_url;
> -			$p =~ s#^\Q$u\E(?:/|$)## or next;
> +			my $z = $u;
> +			if ($rwr) {
> +				$z = $rwr;
> +			}
> +			$p =~ s#^\Q$z\E(?:/|$)## or next;
>  		}
>  		foreach my $f (keys %$fetch) {
>  			next if $f ne $p;
> -- 
> 1.5.4.2
> 
-- 
Eric Wong
Previous: John Goerzen
Message 2 of 2 in “Fix dcommit, rebase when rewriteRoot is in use”
  1. Fix dcommit, rebase when rewriteRoot is in useJohn Goerzen, Mar 8, 2008
  2. Eric WongMar 8, 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.