From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Shawn O. Pearce" 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 Message-ID: <20090323002636.GI23521@spearce.org> References: <1237675051-6688-1-git-send-email-kusmabite@gmail.com> <7vd4cabffl.fsf@gitster.siamese.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Erik Faye-Lund , git@vger.kernel.org, Johannes Schindelin To: Junio C Hamano X-From: git-owner@vger.kernel.org Mon Mar 23 01:28:10 2009 Return-path: Envelope-to: gcvg-git-2@gmane.org Received: from vger.kernel.org ([209.132.176.167]) by lo.gmane.org with esmtp (Exim 4.50) id 1LlY1Q-0005mw-Up for gcvg-git-2@gmane.org; Mon, 23 Mar 2009 01:28:09 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753939AbZCWA0k (ORCPT ); Sun, 22 Mar 2009 20:26:40 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753698AbZCWA0j (ORCPT ); Sun, 22 Mar 2009 20:26:39 -0400 Received: from george.spearce.org ([209.20.77.23]:41958 "EHLO george.spearce.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753645AbZCWA0i (ORCPT ); Sun, 22 Mar 2009 20:26:38 -0400 Received: by george.spearce.org (Postfix, from userid 1001) id D6EB138211; Mon, 23 Mar 2009 00:26:36 +0000 (UTC) Content-Disposition: inline In-Reply-To: <7vd4cabffl.fsf@gitster.siamese.dyndns.org> User-Agent: Mutt/1.5.17+20080114 (2008-01-14) Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Junio C Hamano 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 " rule to be "from " and then create tag a tree using a temporary branch and a from line of "from temp-branch^{tree}". -- Shawn.