{"thread":{"id":"31359","subject":"RE: [PATCH v6 15/16] remote-svn: add marks-file regeneration","startedAt":"2012-08-25T18:55:05Z","lastAt":"2012-08-25T18:55:05Z","messageCount":1,"participants":["Joachim Schmitz"],"isPatch":true,"patchVersion":6,"patchTotal":16},"messages":[{"id":"197842","messageId":"002401cd82f3$24a465f0$6ded31d0$@schmitz-digital.de","threadId":"31359","inReplyTo":null,"subject":"RE: [PATCH v6 15/16] remote-svn: add marks-file regeneration","fromName":"Joachim Schmitz","fromEmail":"jojo@schmitz-digital.de","sentAt":"2012-08-25T18:55:05Z","receivedAt":"2012-08-25T18:55:05Z","isPatch":true,"sender":{"key":"jojo@schmitz-digital.de","avatar":"https://avatars.githubusercontent.com/u/1786669?v=4"},"body":"> From: Joachim Schmitz [mailto:jojo@schmitz-digital.de]\n> Sent: Saturday, August 25, 2012 5:55 PM\n> To: 'florian.achleitner.2.6.31@gmail.com'\n> Cc: git@vger.kernel.org\n> Subject: Re: [PATCH v6 15/16] remote-svn: add marks-file regeneration\n> \n> \"Florian Achleitner\" <florian.achleitner.2.6.31@gmail.com> schrieb im Newsbeitrag news:<1345662961-9587-16-git-send-email-\n> florian.achleitner.2.6.31@gmail.com>...\n> > fast-import mark files are stored outside the object database and are\n> > therefore not fetched and can be lost somehow else.  marks provide a\n> > svn revision --> git sha1 mapping, while the notes that are attached\n> > to each commit when it is imported provide a git sha1 --> svn revision\n> > mapping.\n> >\n> > If the marks file is not available or not plausible, regenerate it by\n> > walking through the notes tree.  , i.e.  The plausibility check tests\n> > if the highest revision in the marks file matches the revision of the\n> > top ref. It doesn't ensure that the mark file is completely correct.\n> > This could only be done with an effort equal to unconditional\n> > regeneration.\n> >\n> > Signed-off-by: Florian Achleitner <florian.achleitner.2.6.31@gmail.com>\n> > Signed-off-by: Junio C Hamano <gitster@pobox.com>\n> > ---\n> >  remote-testsvn.c |   68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++\n> >  1 file changed, 68 insertions(+)\n> >\n> > diff --git a/remote-testsvn.c b/remote-testsvn.c\n> > index e90d221..09dc304 100644\n> > --- a/remote-testsvn.c\n> > +++ b/remote-testsvn.c\n> ...\n> > +static void check_or_regenerate_marks(int latestrev) {\n> > +\tFILE *marksfile;\n> > +\tchar *line = NULL;\n> > +\tsize_t linelen = 0;\n> > +\tstruct strbuf sb = STRBUF_INIT;\n> > +\tint found = 0;\n> > +\n> > +\tif (latestrev < 1)\n> > +\t\treturn;\n> > +\n> > +\tinit_notes(NULL, notes_ref, NULL, 0);\n> > +\tmarksfile = fopen(marksfilename, \"r\");\n> > +\tif (!marksfile) {\n> > +\t\tregenerate_marks();\n> > +\t\tmarksfile = fopen(marksfilename, \"r\");\n> > +\t\tif (!marksfile)\n> > +\t\t\tdie_errno(\"cannot read marks file %s!\", marksfilename);\n> > +\t\tfclose(marksfile);\n> > +\t} else {\n> > +\t\tstrbuf_addf(&sb, \":%d \", latestrev);\n> > +\t\twhile (getline(&line, &linelen, marksfile) != -1) {\n> \n> getline() is not available to anybody, e.g. it is not in HP NonStop.\n\nI'd like to confirm that Ramsey's patch works for me too, so I second his request.\n(Subject: [PATCH 1/3] remote-testsvn.c: Avoid the getline() GNU extension function)\n\nBye, Jojo\n"}]}