{"thread":{"id":"31354","subject":"Re: [PATCH v6 15/16] remote-svn: add marks-file regeneration","startedAt":"2012-08-25T15:55:13Z","lastAt":"2012-08-25T15:55:13Z","messageCount":1,"participants":["Joachim Schmitz"],"isPatch":true,"patchVersion":6,"patchTotal":16},"messages":[{"id":"197836","messageId":"001c01cd82da$03abbb00$0b033100$@schmitz-digital.de","threadId":"31354","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-25T15:55:13Z","receivedAt":"2012-08-25T15:55:13Z","isPatch":true,"sender":{"key":"jojo@schmitz-digital.de","avatar":"https://avatars.githubusercontent.com/u/1786669?v=4"},"body":"\"Florian Achleitner\" <florian.achleitner.2.6.31@gmail.com> schrieb im Newsbeitrag\nnews:<1345662961-9587-16-git-send-email-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\ngetline() is not available to anybody, e.g. it is not in HP NonStop.\n\nBye, Jojo\n"}]}