{"thread":{"id":"13547","subject":"git-svn goes into infinite loop rebuilding rev_map","startedAt":"2008-05-16T17:15:56Z","lastAt":"2008-05-19T03:30:55Z","messageCount":4,"participants":["Daniel Berlin","Kevin Ballard"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"77149","messageId":"4aca3dc20805161015l28d1e4a2u318c1bc23bb5b925@mail.gmail.com","threadId":"13547","inReplyTo":null,"subject":"git-svn goes into infinite loop rebuilding rev_map","fromName":"Daniel Berlin","fromEmail":"dberlin@dberlin.org","sentAt":"2008-05-16T17:15:56Z","receivedAt":"2008-05-16T17:15:56Z","isPatch":false,"sender":{"key":"dberlin@dberlin.org","avatar":null},"body":"Starting last night, for no particularly obvious reason, git-svn fetch\n(or git-svn rebase or any command that does naything interesting) on\ngcc.gnu.org's repo causes git-svn to do the following:\n\n-bash-3.00$ git-svn fetch\nRebuilding .git/svn/trunk/.rev_map.138bc75d-0d04-0410-961f-82ee72b054a4 ...\nDone rebuilding .git/svn/trunk/.rev_map.138bc75d-0d04-0410-961f-82ee72b054a4\nRebuilding .git/svn/trunk/.rev_map.138bc75d-0d04-0410-961f-82ee72b054a4 ...\n<repeat forever>\n\n\nI checked the obvious things. There is no permissions problem, strace\ndoesn't show the writes failing, etc.\ngit-fsck shows nothing as being obviously wrong.\n\n\nThis just suddenly started happening with no obvious reason (we fire\noff git-svn fetch and rebase on the repo when cvs commits happen).\n\ngit-log shows the last processed rev was:\n\ncommit e66b310fb9a3ddc7ed5143db3c468711c8a36d08\nAuthor: uros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>\nDate:   Thu May 15 14:38:23 2008 +0000\n\n        * config/i386/sse.md (*vec_concatv2sf_sse4_1): Add \"m\" constraint\n        to alternative 4 of operand 2.\n\n\n    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@135364\n138bc75d-0d04-0410-961f-82ee72b054a4\n\n\nI'm happy to provide anything i can to get the problem fixed, but not\nbeing a git expert, i have no idea what is up here.\n"},{"id":"77154","messageId":"4E00E139-E354-4336-8290-51CD1B55017A@sb.org","threadId":"13547","inReplyTo":"4aca3dc20805161015l28d1e4a2u318c1bc23bb5b925@mail.gmail.com","subject":"Re: git-svn goes into infinite loop rebuilding rev_map","fromName":"Kevin Ballard","fromEmail":"kevin@sb.org","sentAt":"2008-05-16T17:48:01Z","receivedAt":"2008-05-16T17:48:01Z","isPatch":false,"sender":{"key":"kevin@sb.org","avatar":"https://avatars.githubusercontent.com/u/714?v=4"},"body":"On May 16, 2008, at 1:15 PM, Daniel Berlin wrote:\n\n> Starting last night, for no particularly obvious reason, git-svn fetch\n> (or git-svn rebase or any command that does naything interesting) on\n> gcc.gnu.org's repo causes git-svn to do the following:\n>\n> -bash-3.00$ git-svn fetch\n> Rebuilding .git/svn/trunk/.rev_map. \n> 138bc75d-0d04-0410-961f-82ee72b054a4 ...\n> Done rebuilding .git/svn/trunk/.rev_map. \n> 138bc75d-0d04-0410-961f-82ee72b054a4\n> Rebuilding .git/svn/trunk/.rev_map. \n> 138bc75d-0d04-0410-961f-82ee72b054a4 ...\n> <repeat forever>\n>\n>\n> I checked the obvious things. There is no permissions problem, strace\n> doesn't show the writes failing, etc.\n> git-fsck shows nothing as being obviously wrong.\n\nAre you sure? I just glanced at the code, and it avoids rebuilding i  \nthe map file exists and is not empty.\n\n> This just suddenly started happening with no obvious reason (we fire\n> off git-svn fetch and rebase on the repo when cvs commits happen).\n>\n> git-log shows the last processed rev was:\n>\n> commit e66b310fb9a3ddc7ed5143db3c468711c8a36d08\n> Author: uros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>\n> Date:   Thu May 15 14:38:23 2008 +0000\n>\n>        * config/i386/sse.md (*vec_concatv2sf_sse4_1): Add \"m\"  \n> constraint\n>        to alternative 4 of operand 2.\n>\n>\n>    git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@135364\n> 138bc75d-0d04-0410-961f-82ee72b054a4\n>\n>\n> I'm happy to provide anything i can to get the problem fixed, but not\n> being a git expert, i have no idea what is up here.\n\nWhat version of git do you have? And you might want to CC Eric Wong <normalperson@yhbt.net \n > on this.\n\n-Kevin Ballard\n\n-- \nKevin Ballard\nhttp://kevin.sb.org\nkevin@sb.org\nhttp://www.tildesoft.com\n"},{"id":"77155","messageId":"4aca3dc20805161102y2de0d95cif8a6b643abf722e8@mail.gmail.com","threadId":"13547","inReplyTo":"4E00E139-E354-4336-8290-51CD1B55017A@sb.org","subject":"Re: git-svn goes into infinite loop rebuilding rev_map","fromName":"Daniel Berlin","fromEmail":"dberlin@dberlin.org","sentAt":"2008-05-16T18:02:20Z","receivedAt":"2008-05-16T18:02:20Z","isPatch":false,"sender":{"key":"dberlin@dberlin.org","avatar":null},"body":"On Fri, May 16, 2008 at 1:48 PM, Kevin Ballard <kevin@sb.org> wrote:\n> On May 16, 2008, at 1:15 PM, Daniel Berlin wrote:\n>\n>> Starting last night, for no particularly obvious reason, git-svn fetch\n>> (or git-svn rebase or any command that does naything interesting) on\n>> gcc.gnu.org's repo causes git-svn to do the following:\n>>\n>> -bash-3.00$ git-svn fetch\n>> Rebuilding .git/svn/trunk/.rev_map.138bc75d-0d04-0410-961f-82ee72b054a4\n>> ...\n>> Done rebuilding\n>> .git/svn/trunk/.rev_map.138bc75d-0d04-0410-961f-82ee72b054a4\n>> Rebuilding .git/svn/trunk/.rev_map.138bc75d-0d04-0410-961f-82ee72b054a4\n>> ...\n>> <repeat forever>\n>>\n>>\n>> I checked the obvious things. There is no permissions problem, strace\n>> doesn't show the writes failing, etc.\n>> git-fsck shows nothing as being obviously wrong.\n>\n> Are you sure? I just glanced at the code, and it avoids rebuilding i the map\n> file exists and is not empty.\nAbsolutely positive.\n\nYou can see the strace at http://www.dberlin.org/git.strace.bz2\nNote there are no eperms or anything of the sort.\n\n\n>\n>> This just suddenly started happening with no obvious reason (we fire\n>> off git-svn fetch and rebase on the repo when cvs commits happen).\n>>\n>> git-log shows the last processed rev was:\n>>\n>> commit e66b310fb9a3ddc7ed5143db3c468711c8a36d08\n>> Author: uros <uros@138bc75d-0d04-0410-961f-82ee72b054a4>\n>> Date:   Thu May 15 14:38:23 2008 +0000\n>>\n>>       * config/i386/sse.md (*vec_concatv2sf_sse4_1): Add \"m\" constraint\n>>       to alternative 4 of operand 2.\n>>\n>>\n>>   git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@135364\n>> 138bc75d-0d04-0410-961f-82ee72b054a4\n>>\n>>\n>> I'm happy to provide anything i can to get the problem fixed, but not\n>> being a git expert, i have no idea what is up here.\n>\n> What version of git do you have? And you might want to CC Eric Wong\n> <normalperson@yhbt.net> on this.\n>\nIt was 1.5.5\nAfter we noticed this problem, i tried updating it to the absolute\nlatest from the repo as of this morning (didn't help).\nSo it is now 1.5.5.1.308.g1fbb5\n\n\n> -Kevin Ballard\n>\n> --\n> Kevin Ballard\n> http://kevin.sb.org\n> kevin@sb.org\n> http://www.tildesoft.com\n>\n>\n>\n"},{"id":"77248","messageId":"4aca3dc20805182030v4ff6707bo997dfb34110305d4@mail.gmail.com","threadId":"13547","inReplyTo":"4aca3dc20805161102y2de0d95cif8a6b643abf722e8@mail.gmail.com","subject":"Re: git-svn goes into infinite loop rebuilding rev_map","fromName":"Daniel Berlin","fromEmail":"dberlin@dberlin.org","sentAt":"2008-05-19T03:30:55Z","receivedAt":"2008-05-19T03:30:55Z","isPatch":false,"sender":{"key":"dberlin@dberlin.org","avatar":null},"body":"On Fri, May 16, 2008 at 2:02 PM, Daniel Berlin <dberlin@dberlin.org> wrote:\n> On Fri, May 16, 2008 at 1:48 PM, Kevin Ballard <kevin@sb.org> wrote:\n>> On May 16, 2008, at 1:15 PM, Daniel Berlin wrote:\n>>\n>>> Starting last night, for no particularly obvious reason, git-svn fetch\n>>> (or git-svn rebase or any command that does naything interesting) on\n>>> gcc.gnu.org's repo causes git-svn to do the following:\n>>>\n\nI finally got a chance to debug this a bit, and it appears to occur\nbecause rewriteRoot is not taken into account during rebuilding of\nmetadata.\n\n\nIn this loop in rebuild:\n while (<$log>) {\n                if ( m{^commit ($::sha1)$} ) {\n                        $c = $1;\n                        next;\n                }\n                next unless s{^\\s*(git-svn-id:)}{$1};\n                my ($url, $rev, $uuid) = ::extract_metadata($_);\n                remove_username($url);\n\n                # ignore merges (from set-tree)\n                next if (!defined $rev || !$uuid);\n                print \"uuid:$uuid, svn_uuid:$svn_uuid, full_url:\n$full_url, url: $url!\\n\";\n                my $rwr = $self->rewrite_root;\n\n                # if we merged or otherwise started elsewhere, this is\n                # how we break out of it\n\n                if (($uuid ne $svn_uuid) ||\n                    ($full_url && $url && ($url ne $full_url))) {\n                        next;\n                }\n\n                $self->rev_map_set($rev, $c);\n                print \"r$rev = $c\\n\";\n        }\n\nWe end up with\nuuid:138bc75d-0d04-0410-961f-82ee72b054a4,\nsvn_uuid:138bc75d-0d04-0410-961f-82ee72b054a4, full_url:\nfile:///svn/gcc/trunk, url: svn+ssh://gcc.gnu.org/svn/gcc/trunk\n\nThis is because we fetch from the local fs but rewriteRoot it into a\npath that works for remote users who want to commit.\n\nHowever, in that loop that $full_url ne $url so it skips setting the\nrev in the rev map, under the assumption it came from elsewhere.\n\nSince it does this for every rev, it never actually puts anything in\nthe rev map (which means it never creates it).\nSo it decides to rebuild it again since the file existence fails.\nLather, Rinse, Repeat\n\nThe correct fix (i'm not good enough at perl/git-svn to know how to\nwrite this code) is to take rewriteRoot into account.\nIn addition, it might make sense to assert that when we rebuild the\nrev_map, it actually exists when we are done :).\n\nHTH,\nDan\n"}]}