git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v6 15/16] remote-svn: add marks-file regeneration

From
Joachim Schmitz <jojo@schmitz-digital.de>
Date
Aug 25, 2012, 15:55 UTC
Message-ID
<001c01cd82da$03abbb00$0b033100$@schmitz-digital.de>

"Florian Achleitner" <florian.achleitner.2.6.31@gmail.com> schrieb im Newsbeitrag news:<1345662961-9587-16-git-send-email-florian.achleitner.2.6.31@gmail.com>...

Show 23 quoted lines
> fast-import mark files are stored outside the object database and are
> therefore not fetched and can be lost somehow else.  marks provide a
> svn revision --> git sha1 mapping, while the notes that are attached
> to each commit when it is imported provide a git sha1 --> svn revision
> mapping.
> 
> If the marks file is not available or not plausible, regenerate it by
> walking through the notes tree.  , i.e.  The plausibility check tests
> if the highest revision in the marks file matches the revision of the
> top ref. It doesn't ensure that the mark file is completely correct.
> This could only be done with an effort equal to unconditional
> regeneration.
> 
> Signed-off-by: Florian Achleitner <florian.achleitner.2.6.31@gmail.com>
> Signed-off-by: Junio C Hamano <gitster@pobox.com>
> ---
>  remote-testsvn.c |   68 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 68 insertions(+)
> 
> diff --git a/remote-testsvn.c b/remote-testsvn.c
> index e90d221..09dc304 100644
> --- a/remote-testsvn.c
> +++ b/remote-testsvn.c
...
Show 21 quoted lines
> +static void check_or_regenerate_marks(int latestrev) {
> +	FILE *marksfile;
> +	char *line = NULL;
> +	size_t linelen = 0;
> +	struct strbuf sb = STRBUF_INIT;
> +	int found = 0;
> +
> +	if (latestrev < 1)
> +		return;
> +
> +	init_notes(NULL, notes_ref, NULL, 0);
> +	marksfile = fopen(marksfilename, "r");
> +	if (!marksfile) {
> +		regenerate_marks();
> +		marksfile = fopen(marksfilename, "r");
> +		if (!marksfile)
> +			die_errno("cannot read marks file %s!", marksfilename);
> +		fclose(marksfile);
> +	} else {
> +		strbuf_addf(&sb, ":%d ", latestrev);
> +		while (getline(&line, &linelen, marksfile) != -1) {
getline() is not available to anybody, e.g. it is not in HP NonStop.
Bye, Jojo
Message 1 of 1 in “Re: [PATCH v6 15/16] remote-svn: add marks-file regeneration”
  1. Joachim SchmitzAug 25, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.