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

Re: [PATCH] builtin-fast-export.c: add default case to avoid crash on corrupt repo

From
Shawn O. Pearce <spearce@spearce.org>
Date
Mar 23, 2009, 00:26 UTC
Message-ID
<20090323002636.GI23521@spearce.org>
In-Reply-To
<7vd4cabffl.fsf@gitster.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> wrote:
> It
> appears that there is no way to feed a tree object to fast-import, but I
> think the fast-import language can represent a tag that points at another
> tag just fine.
Correct.

This area of the langauge was built around the basic CVS->Git sort of conversion, where we just wanted to attach the CVS "tag" symbol onto a Git snapshot that seemed to match it. Annotated tags were used only because tools like git fetch and git describe prefer to work with them, and these were (at some point in time) meaningful labels for these revisions so the project post-conversion should retain those same labels.

In hindsight, parts of the fast-import langauge are problematic as they don't fully represent the Git object graph, and this is one of those areas. It wasn't designed to represent the same range of structures as Git can represent.

> So the best you can do is perhaps to issue a warning
> "skipping a tag that points at a tree object" and impoement a proper
> handling of a tag that points at a tag.

Or, patch fast-import to expand its language. You could relax the "from <committish>" rule to be "from <objectish>" and then create tag a tree using a temporary branch and a from line of "from temp-branch^{tree}".

-- 
Shawn.
Previous: Junio C Hamano
Message 6 of 6 in “builtin-fast-export.c: add default case to avoid crash on corrupt repo”
  1. builtin-fast-export.c: add default case to avoid crash on corrupt repoErik Faye-Lund, Mar 21, 2009
  2. Junio C HamanoMar 21, 2009
  3. Erik Faye-LundMar 22, 2009
  4. Erik Faye-LundMar 22, 2009
  5. Junio C HamanoMar 22, 2009
  6. Shawn O. PearceMar 23, 2009

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.