Git development
 help / color / mirror / Atom feed
From: Eric Wong <normalperson@yhbt.net>
To: John Goerzen <jgoerzen@complete.org>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] Fix dcommit, rebase when rewriteRoot is in use
Date: Sat, 8 Mar 2008 14:22:23 -0800	[thread overview]
Message-ID: <20080308222223.GA1950@hand.yhbt.net> (raw)
In-Reply-To: <1205013845-22286-1-git-send-email-jgoerzen@complete.org>

John Goerzen <jgoerzen@complete.org> wrote:
> 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>

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

  reply	other threads:[~2008-03-08 22:23 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-08 22:04 [PATCH] Fix dcommit, rebase when rewriteRoot is in use John Goerzen
2008-03-08 22:22 ` Eric Wong [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-03-08 20:01 John Goerzen
2008-03-08 21:05 ` Junio C Hamano
2008-03-08 21:28   ` John Goerzen
2008-03-08 21:52     ` Eric Wong
2008-03-08 21:32 ` Johannes Schindelin
2008-03-08 22:04   ` John Goerzen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080308222223.GA1950@hand.yhbt.net \
    --to=normalperson@yhbt.net \
    --cc=git@vger.kernel.org \
    --cc=jgoerzen@complete.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox