From: Eric Wong <normalperson@yhbt.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Michael Lai <myllai@gmail.com>
Subject: Re: [RFC PATCH] git-svn does not support intermediate directories?
Date: Mon, 9 Mar 2009 14:54:48 -0700 [thread overview]
Message-ID: <20090309215447.GA25947@dcvr.yhbt.net> (raw)
In-Reply-To: <21fc26450903091402u60d6cfcepd67ba7510af8f4a3@mail.gmail.com>
Michael Lai <myllai@gmail.com> wrote:
> > Your patch was whitespace damaged and lacked a proposed commit message.
> > Please read Documentation/SubmittingPatches next time.
> Hey Eric,
>
> Sorry, I didn't notice that; I've read through it and hopefully my
> patches should conform from now on.
>
> >
> > Anyhow, I fixed your patch up a bit. Can you sign-off on it
> > if its right to you or let me know if it's broken? Thanks.
>
> I looked through the patch and that would work, but at the same time I
> had another idea which may be a little cleaner. Let me know what you
> think.
Thanks Michael, looks good to me,
Acked and pushed out to git://git.bogomips.org/git-svn
> From ae38acf85cfc86c075578c1c3f3c204d91d1d1f4 Mon Sep 17 00:00:00 2001
> From: Michael Lai <myllai@gmail.com>
> Date: Mon, 9 Mar 2009 11:45:47 -0700
> Subject: [PATCH] git-svn: support intermediate paths when matching tags/branches
>
> For repositories laid out like the following:
>
> [svn-remote "svn"]
> url = http://foo.com/svn/repos/bar
> fetch = myproject/trunk:refs/remotes/trunk
> branches = bar/myproject/branches/*:refs/remotes/*
> tags = bar/myproject/tags/*:refs/remotes/tags/*
>
> The "bar" component above is considered the intermediate path
> and was not handled correctly.
>
> Signed-off-by: Michael Lai <myllai@gmail.com>
> ---
> git-svn.perl | 5 ++++-
> 1 files changed, 4 insertions(+), 1 deletions(-)
>
> diff --git a/git-svn.perl b/git-svn.perl
> index 959eb52..8be6be0 100755
> --- a/git-svn.perl
> +++ b/git-svn.perl
> @@ -2351,7 +2351,10 @@ sub match_paths {
> if (my $path = $paths->{"/$self->{path}"}) {
> return ($path->{action} eq 'D') ? 0 : 1;
> }
> - $self->{path_regex} ||= qr/^\/\Q$self->{path}\E\//;
> + my $repos_root = $self->ra->{repos_root};
> + my $extended_path = $self->{url} . '/' . $self->{path};
> + $extended_path =~ s#^\Q$repos_root\E(/|$)##;
> + $self->{path_regex} ||= qr/^\/\Q$extended_path\E\//;
> if (grep /$self->{path_regex}/, keys %$paths) {
> return 1;
> }
> --
> 1.6.2
prev parent reply other threads:[~2009-03-09 21:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-04 1:43 git-svn does not support intermediate directories? Michael Lai
2009-03-04 4:30 ` Tim Stoakes
2009-03-06 0:12 ` [RFC PATCH] " Michael Lai
2009-03-08 4:43 ` Eric Wong
2009-03-09 21:02 ` Michael Lai
2009-03-09 21:54 ` Eric Wong [this message]
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090309215447.GA25947@dcvr.yhbt.net \
--to=normalperson@yhbt.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=myllai@gmail.com \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).