git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Olson <mwolson@gnu.org>
To: git@vger.kernel.org
Cc: Eric Wong <normalperson@yhbt.net>,
	Michael J Gruber <git@drmicha.warpmail.net>,
	Tim Stoakes <tim@stoakes.net>
Subject: [PATCH/RFC 0/2] git-svn: Allow certain refs to be ignored
Date: Tue, 20 Apr 2010 14:30:09 -0700	[thread overview]
Message-ID: <o2xc8b3bef91004201430m10bbe060q7d8ebd3a1ac4c3bd@mail.gmail.com> (raw)

This change allows certain refs to be ignored while importing svn
history.  This is useful for:

 - Performing overlapping transforms from svn's branch namespace into
   git's namespace.  The overlapping refs can be ignored.  It might
   potentially be a better idea in this case to make git-svn assign
   precedence according to the order in which the branch patterns are
   specified, perhaps with an option to trigger that behavior (which
   is out of scope for this patch series).

 - Avoiding some refs that represent bad svn operations which cause
   git-svn to take a very long time.  Example: copying one module
   accidentally into another module's branch namespace.

A new config directive called "ignore-refs" implements this feature by
means of a regex of refs to ignore.  I haven't written the necessary
git-svn documentation updates for it yet.

In addition, I ran across a problem where git-svn would die if a
parent ref did not exist.  This might possibly have been exposed as a
result of the first patch.  I threw an eval around the offending code,
and that seems to work, though some review would be appreciated.

Here is an example ~/.git/config file which works with these changes.
The example upstream svn repository has branches in tags in 2
different namespaces.  Originally all tags/branches were directly
under /root/mod/branches and /root/mod/tags.  Later on, they created
new branches and tags in subdirectories such as
/root/mod/branches/myorg/bugs/BUGID.  This config file forces
old-style branches and tags into the "old/" namespace in git, and puts
new-style branches and tags into (for example) "myorg/bugs/BUGID".
The "ignore-refs" directive prevents the first level of the new
namespace ("myorg", in particular) from being replicated underneath
"old/" in git.

[core]
       repositoryformatversion = 0
       filemode = true
       bare = false
       logallrefupdates = true
[svn-remote "svn"]
       url = https://svn.my.org/svn/root
       fetch = mod/trunk:refs/remotes/trunk
       branches = mod/branches/*:refs/remotes/old/*
       tags = mod/tags/*:refs/remotes/tags/old/*
       branches = mod/branches/myorg/bugs/*:refs/remotes/myorg/bugs/*
       tags = mod/tags/myorg/bugs/*:refs/remotes/tags/myorg/bugs/*
       branches = mod/branches/myorg/projects/*:refs/remotes/myorg/projects/*
       tags = mod/tags/myorg/projects/*:refs/remotes/tags/myorg/projects/*
       branches = mod/branches/myorg/releases/*:refs/remotes/myorg/releases/*
       tags = mod/tags/myorg/releases/*:refs/remotes/tags/myorg/releases/*
       ignore-refs = ^refs/remotes/(tags/)?old/myorg

Michael Olson (2):
  git-svn: Allow certain refs to be ignored
  git-svn: Don't allow missing commit parent to stop git-svn

 git-svn.perl |   40 ++++++++++++++++++++++++++++++++++------
 1 files changed, 34 insertions(+), 6 deletions(-)

             reply	other threads:[~2010-04-20 21:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-20 21:30 Michael Olson [this message]
2010-04-20 23:58 ` [PATCH/RFC 0/2] git-svn: Allow certain refs to be ignored Junio C Hamano
2010-04-21  7:15   ` Eric Wong
2010-04-21 16:31   ` Michael Olson
2010-04-21 16:54     ` Eric Wong
2010-04-21 17:02       ` Michael Olson
2010-04-21  7:18 ` Eric Wong

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=o2xc8b3bef91004201430m10bbe060q7d8ebd3a1ac4c3bd@mail.gmail.com \
    --to=mwolson@gnu.org \
    --cc=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    --cc=normalperson@yhbt.net \
    --cc=tim@stoakes.net \
    /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;
as well as URLs for NNTP newsgroup(s).