{"thread":{"id":"23540","subject":"[PATCH/RFC 0/2] git-svn: Allow certain refs to be ignored","startedAt":"2010-04-20T21:30:09Z","lastAt":"2010-04-21T17:02:50Z","messageCount":7,"participants":["Michael Olson","Junio C Hamano","Eric Wong"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"139997","messageId":"o2xc8b3bef91004201430m10bbe060q7d8ebd3a1ac4c3bd@mail.gmail.com","threadId":"23540","inReplyTo":null,"subject":"[PATCH/RFC 0/2] git-svn: Allow certain refs to be ignored","fromName":"Michael Olson","fromEmail":"mwolson@gnu.org","sentAt":"2010-04-20T21:30:09Z","receivedAt":"2010-04-20T21:30:09Z","isPatch":true,"sender":{"key":"mwolson@gnu.org","avatar":"https://avatars.githubusercontent.com/u/1510193?v=4"},"body":"This change allows certain refs to be ignored while importing svn\nhistory.  This is useful for:\n\n - Performing overlapping transforms from svn's branch namespace into\n   git's namespace.  The overlapping refs can be ignored.  It might\n   potentially be a better idea in this case to make git-svn assign\n   precedence according to the order in which the branch patterns are\n   specified, perhaps with an option to trigger that behavior (which\n   is out of scope for this patch series).\n\n - Avoiding some refs that represent bad svn operations which cause\n   git-svn to take a very long time.  Example: copying one module\n   accidentally into another module's branch namespace.\n\nA new config directive called \"ignore-refs\" implements this feature by\nmeans of a regex of refs to ignore.  I haven't written the necessary\ngit-svn documentation updates for it yet.\n\nIn addition, I ran across a problem where git-svn would die if a\nparent ref did not exist.  This might possibly have been exposed as a\nresult of the first patch.  I threw an eval around the offending code,\nand that seems to work, though some review would be appreciated.\n\nHere is an example ~/.git/config file which works with these changes.\nThe example upstream svn repository has branches in tags in 2\ndifferent namespaces.  Originally all tags/branches were directly\nunder /root/mod/branches and /root/mod/tags.  Later on, they created\nnew branches and tags in subdirectories such as\n/root/mod/branches/myorg/bugs/BUGID.  This config file forces\nold-style branches and tags into the \"old/\" namespace in git, and puts\nnew-style branches and tags into (for example) \"myorg/bugs/BUGID\".\nThe \"ignore-refs\" directive prevents the first level of the new\nnamespace (\"myorg\", in particular) from being replicated underneath\n\"old/\" in git.\n\n[core]\n       repositoryformatversion = 0\n       filemode = true\n       bare = false\n       logallrefupdates = true\n[svn-remote \"svn\"]\n       url = https://svn.my.org/svn/root\n       fetch = mod/trunk:refs/remotes/trunk\n       branches = mod/branches/*:refs/remotes/old/*\n       tags = mod/tags/*:refs/remotes/tags/old/*\n       branches = mod/branches/myorg/bugs/*:refs/remotes/myorg/bugs/*\n       tags = mod/tags/myorg/bugs/*:refs/remotes/tags/myorg/bugs/*\n       branches = mod/branches/myorg/projects/*:refs/remotes/myorg/projects/*\n       tags = mod/tags/myorg/projects/*:refs/remotes/tags/myorg/projects/*\n       branches = mod/branches/myorg/releases/*:refs/remotes/myorg/releases/*\n       tags = mod/tags/myorg/releases/*:refs/remotes/tags/myorg/releases/*\n       ignore-refs = ^refs/remotes/(tags/)?old/myorg\n\nMichael Olson (2):\n  git-svn: Allow certain refs to be ignored\n  git-svn: Don't allow missing commit parent to stop git-svn\n\n git-svn.perl |   40 ++++++++++++++++++++++++++++++++++------\n 1 files changed, 34 insertions(+), 6 deletions(-)\n"},{"id":"140001","messageId":"7vbpddekwk.fsf@alter.siamese.dyndns.org","threadId":"23540","inReplyTo":"o2xc8b3bef91004201430m10bbe060q7d8ebd3a1ac4c3bd@mail.gmail.com","subject":"Re: [PATCH/RFC 0/2] git-svn: Allow certain refs to be ignored","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2010-04-20T23:58:35Z","receivedAt":"2010-04-20T23:58:35Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Michael Olson <mwolson@gnu.org> writes:\n\n> [svn-remote \"svn\"]\n>        url = https://svn.my.org/svn/root\n> ...\n>        ignore-refs = ^refs/remotes/(tags/)?old/myorg\n\nTraditionally configuration variable names are spelled camelCase without\ndashes.  You probably would want to be consistent.\n\nAlso \"refs\" and any pathname-like things are traditionally matched using\nglobs and not regexes.  It is Ok to deviate if you have a strong reason to\n(and I suspect it would make it easier to write \"exclude\" patterns like\nthe above example to allow a regex here), but that needs to be prominently\ndocumented (e.g. \"Unlike any other ref-matching configuration variable,\nthis alone uses regex, not glob\") to avoid end user confusion.\n"},{"id":"140010","messageId":"20100421071505.GA11339@dcvr.yhbt.net","threadId":"23540","inReplyTo":"7vbpddekwk.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH/RFC 0/2] git-svn: Allow certain refs to be ignored","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2010-04-21T07:15:05Z","receivedAt":"2010-04-21T07:15:05Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Junio C Hamano <gitster@pobox.com> wrote:\n> Michael Olson <mwolson@gnu.org> writes:\n> \n> > [svn-remote \"svn\"]\n> >        url = https://svn.my.org/svn/root\n> > ...\n> >        ignore-refs = ^refs/remotes/(tags/)?old/myorg\n> \n> Traditionally configuration variable names are spelled camelCase without\n> dashes.  You probably would want to be consistent.\n\nConfiguration variables should definitely be camelCase in\nexamples/documentation (and I even dislike camelCase).  No dashes or\nunderscores here.\n\n> Also \"refs\" and any pathname-like things are traditionally matched using\n> globs and not regexes.  It is Ok to deviate if you have a strong reason to\n> (and I suspect it would make it easier to write \"exclude\" patterns like\n> the above example to allow a regex here), but that needs to be prominently\n> documented (e.g. \"Unlike any other ref-matching configuration variable,\n> this alone uses regex, not glob\") to avoid end user confusion.\n\nI favor globs for more consistent/natural for path matching.\n\nAnother thing to keep in mind is that these would be Perl regular\nexpressions exposed to a user interface.  If git-svn were ever be\nreimplemented in something other than Perl, PCRE (or similar) would be\nrequired to interpret them consistently.\n\n-- \nEric Wong\n"},{"id":"140011","messageId":"20100421071759.GA15680@dcvr.yhbt.net","threadId":"23540","inReplyTo":"o2xc8b3bef91004201430m10bbe060q7d8ebd3a1ac4c3bd@mail.gmail.com","subject":"Re: [PATCH/RFC 0/2] git-svn: Allow certain refs to be ignored","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2010-04-21T07:18:00Z","receivedAt":"2010-04-21T07:18:00Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Michael Olson <mwolson@gnu.org> wrote:\n> This change allows certain refs to be ignored while importing svn\n> history.  This is useful for:\n> \n>  - Performing overlapping transforms from svn's branch namespace into\n>    git's namespace.  The overlapping refs can be ignored.  It might\n>    potentially be a better idea in this case to make git-svn assign\n>    precedence according to the order in which the branch patterns are\n>    specified, perhaps with an option to trigger that behavior (which\n>    is out of scope for this patch series).\n> \n>  - Avoiding some refs that represent bad svn operations which cause\n>    git-svn to take a very long time.  Example: copying one module\n>    accidentally into another module's branch namespace.\n\nHi Michael, these are definitely good things to have.  Thanks!\n\n> A new config directive called \"ignore-refs\" implements this feature by\n> means of a regex of refs to ignore.  I haven't written the necessary\n> git-svn documentation updates for it yet.\n\nSee Junio's and my other email.\n\n> In addition, I ran across a problem where git-svn would die if a\n> parent ref did not exist.  This might possibly have been exposed as a\n> result of the first patch.  I threw an eval around the offending code,\n> and that seems to work, though some review would be appreciated.\n\nI'm cc-ing Sam for this one.  It looks good to me given the first patch\nwould cause more refs to not exist.\n\n-- \nEric Wong\n"},{"id":"140039","messageId":"m2wc8b3bef91004210931xc0a7ec58ycbf18dd37d5e98f0@mail.gmail.com","threadId":"23540","inReplyTo":"7vbpddekwk.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH/RFC 0/2] git-svn: Allow certain refs to be ignored","fromName":"Michael Olson","fromEmail":"mwolson@gnu.org","sentAt":"2010-04-21T16:31:09Z","receivedAt":"2010-04-21T16:31:09Z","isPatch":true,"sender":{"key":"mwolson@gnu.org","avatar":"https://avatars.githubusercontent.com/u/1510193?v=4"},"body":"On Tue, Apr 20, 2010 at 4:58 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> Michael Olson <mwolson@gnu.org> writes:\n>\n>> [svn-remote \"svn\"]\n>>        url = https://svn.my.org/svn/root\n>> ...\n>>        ignore-refs = ^refs/remotes/(tags/)?old/myorg\n>\n> Traditionally configuration variable names are spelled camelCase without\n> dashes.  You probably would want to be consistent.\n\nI was looking at the existing syntax for \"ignore-paths\", which uses\ndashes.  Should that be changed as well?\n\n> Also \"refs\" and any pathname-like things are traditionally matched using\n> globs and not regexes.  It is Ok to deviate if you have a strong reason to\n> (and I suspect it would make it easier to write \"exclude\" patterns like\n> the above example to allow a regex here), but that needs to be prominently\n> documented (e.g. \"Unlike any other ref-matching configuration variable,\n> this alone uses regex, not glob\") to avoid end user confusion.\n\nignore-paths also uses a regex.  I'm concerned that using globs will\nnot be expressive enough to represent a regex like (a combination of\nthe 2 use cases I posted initially):\n\n^refs/remotes/((tags/)?old/myorg|old/bad_branch|old/unlabeled[^/]*|tags/(old/bad_tag|releases/another_tag))$\n\n-- \nMichael Olson  |  http://mwolson.org/\n"},{"id":"140040","messageId":"20100421165451.GA14004@dcvr.yhbt.net","threadId":"23540","inReplyTo":"m2wc8b3bef91004210931xc0a7ec58ycbf18dd37d5e98f0@mail.gmail.com","subject":"Re: [PATCH/RFC 0/2] git-svn: Allow certain refs to be ignored","fromName":"Eric Wong","fromEmail":"normalperson@yhbt.net","sentAt":"2010-04-21T16:54:52Z","receivedAt":"2010-04-21T16:54:52Z","isPatch":true,"sender":{"key":"e@80x24.org","avatar":null},"body":"Michael Olson <mwolson@gnu.org> wrote:\n> On Tue, Apr 20, 2010 at 4:58 PM, Junio C Hamano <gitster@pobox.com> wrote:\n> > Michael Olson <mwolson@gnu.org> writes:\n> >\n> >> [svn-remote \"svn\"]\n> >>        url = https://svn.my.org/svn/root\n> >> ...\n> >>        ignore-refs = ^refs/remotes/(tags/)?old/myorg\n> >\n> > Traditionally configuration variable names are spelled camelCase without\n> > dashes.  You probably would want to be consistent.\n> \n> I was looking at the existing syntax for \"ignore-paths\", which uses\n> dashes.  Should that be changed as well?\n\nYes, I missed that the first time around :x\n\nI suppose that should be changed to work both ways.\n\n> > Also \"refs\" and any pathname-like things are traditionally matched using\n> > globs and not regexes.  It is Ok to deviate if you have a strong reason to\n> > (and I suspect it would make it easier to write \"exclude\" patterns like\n> > the above example to allow a regex here), but that needs to be prominently\n> > documented (e.g. \"Unlike any other ref-matching configuration variable,\n> > this alone uses regex, not glob\") to avoid end user confusion.\n> \n> ignore-paths also uses a regex.  I'm concerned that using globs will\n> not be expressive enough to represent a regex like (a combination of\n> the 2 use cases I posted initially):\n\nI also missed that (I never used that feature :x)\n\n> ^refs/remotes/((tags/)?old/myorg|old/bad_branch|old/unlabeled[^/]*|tags/(old/bad_tag|releases/another_tag))$\n\nI wonder if both would be better as a series of globs would be\neasier to read (maybe more verbose to write):\n\n\tignoreRefs = refs/remotes/tags/old/myorg\n\tignoreRefs = refs/remotes/old/myorg\n\tignoreRefs = refs/remotes/old/unlabeled/*\n\nBut I suppose the regexp route is fine.  I'll ack and push them\nout with Sam's Ack on 2/2\n\n-- \nEric Wong\n"},{"id":"140043","messageId":"k2oc8b3bef91004211002t8bf17be9w4bee4e76093c8eb6@mail.gmail.com","threadId":"23540","inReplyTo":"20100421165451.GA14004@dcvr.yhbt.net","subject":"Re: [PATCH/RFC 0/2] git-svn: Allow certain refs to be ignored","fromName":"Michael Olson","fromEmail":"mwolson@gnu.org","sentAt":"2010-04-21T17:02:50Z","receivedAt":"2010-04-21T17:02:50Z","isPatch":true,"sender":{"key":"mwolson@gnu.org","avatar":"https://avatars.githubusercontent.com/u/1510193?v=4"},"body":"On Wed, Apr 21, 2010 at 9:54 AM, Eric Wong <normalperson@yhbt.net> wrote:\n> Michael Olson <mwolson@gnu.org> wrote:\n>> ^refs/remotes/((tags/)?old/myorg|old/bad_branch|old/unlabeled[^/]*|tags/(old/bad_tag|releases/another_tag))$\n>\n> I wonder if both would be better as a series of globs would be\n> easier to read (maybe more verbose to write):\n>\n>        ignoreRefs = refs/remotes/tags/old/myorg\n>        ignoreRefs = refs/remotes/old/myorg\n>        ignoreRefs = refs/remotes/old/unlabeled/*\n\nThat does look cleaner, and kind of reminiscent of .gitignore.\n\n-- \nMichael Olson  |  http://mwolson.org/\n"}]}