public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: "Shawn O. Pearce" <spearce@spearce•org>
To: Junio C Hamano <gitster@pobox•com>
Cc: Erik Faye-Lund <kusmabite@gmail•com>,
	git@vger•kernel.org,
	Johannes Schindelin <johannes.schindelin@gmx•de>
Subject: Re: [PATCH] builtin-fast-export.c: add default case to avoid crash on corrupt repo
Date: Sun, 22 Mar 2009 17:26:36 -0700	[thread overview]
Message-ID: <20090323002636.GI23521@spearce.org> (raw)
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.

      parent reply	other threads:[~2009-03-23  0:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-21 22:37 [PATCH] builtin-fast-export.c: add default case to avoid crash on corrupt repo Erik Faye-Lund
2009-03-21 23:54 ` Junio C Hamano
2009-03-22 12:22   ` Erik Faye-Lund
2009-03-22 12:32     ` Erik Faye-Lund
2009-03-22 21:58     ` Junio C Hamano
2009-03-23  0:26   ` Shawn O. Pearce [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090323002636.GI23521@spearce.org \
    --to=spearce@spearce$(echo .)org \
    --cc=git@vger$(echo .)kernel.org \
    --cc=gitster@pobox$(echo .)com \
    --cc=johannes.schindelin@gmx$(echo .)de \
    --cc=kusmabite@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox