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

Re: [PATCH] fast-export: Allow pruned-references in mark file

From
Antoine Pelisse <apelisse@gmail.com>
Date
Nov 26, 2012, 13:23 UTC
Message-ID
<CALWbr2yZpAT=eSahGcGKw5weoz1MjTzbb16pdQndKDFcn_3VJg@mail.gmail.com>
In-Reply-To
<CAMP44s0iSkqcOW0YsD=Jm_=x1tuoRbFQ+EbVvkROa_yY2-WFcA@mail.gmail.com>

On Mon, Nov 26, 2012 at 12:37 PM, Felipe Contreras <felipe.contreras@gmail.com> wrote:

Show 5 quoted lines
> On Mon, Nov 26, 2012 at 5:03 AM, Junio C Hamano <gitster@pobox.com> wrote:
>> Is this a safe and sane thing to do, and if so why?  Could you
>> describe that in the log message here?
> Why would fast-export try to export something that was pruned? Doesn't
> that mean it wasn't reachable?

Hello Junio, Hello Felipe,

Actually the issue happened while using Felipe's branch with his git-remote-hg. Everything was going fine until I (or did it run automatically, I dont remember) ran git gc that pruned unreachable objects. Of course some of the branch I had pushed to the hg remote had been changed (most likely rebased). References no longer exists in the repository (cleaned by gc), but the reference still exists in mark file, as it was exported earlier. Thus the failure when git fast-export reads the mark file.

Then, is it safe ? Updating the last_idnum as I do in the patch doesn't work because if the reference is the last, the number is going to be overwriten in the next run. From git point of view, I guess it is fine. The file is fully read at the beginning of fast-export and fully written at the end. The issue is more for git-remote-hg that keeps track of matches between git marks and hg commits. The marks are going to change and be overriden. It will most likely need to read the mark file to see if a ref has changed, and update it's dictionary.

One of the solution I'm thinking of, is to update the mark file with marks of newly exported objects instead of recreating it, and let obsolete references in the file. But of course that is not acceptable.

Cheers, Antoine

Previous: Felipe ContrerasNext: Felipe Contreras
Message 4 of 13 in “fast-export: Allow pruned-references in mark file”
  1. fast-export: Allow pruned-references in mark fileAntoine Pelisse, Nov 24, 2012
  2. Junio C HamanoNov 26, 2012
  3. Felipe ContrerasNov 26, 2012
  4. Antoine PelisseNov 26, 2012
  5. Felipe ContrerasNov 26, 2012
  6. Antoine PelisseNov 26, 2012
  7. Junio C HamanoNov 26, 2012
  8. Antoine PelisseNov 26, 2012
  9. Felipe ContrerasNov 26, 2012
  10. Junio C HamanoNov 26, 2012
  11. Antoine PelisseDec 1, 2012
  12. fast-export: Allow pruned-references in mark fileAntoine Pelisse, Apr 6, 2013
  13. Felipe ContrerasApr 6, 2013

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.