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

From: "Shawn O. Pearce" <[email-masked]>
Date: Sun, 22 Mar 2009 17:26:36 -0700

Junio C Hamano <[email-masked]> 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.