From mboxrd@z Thu Jan 1 00:00:00 1970 From: Felipe Contreras Subject: Re: [PATCH v2 4/4] fast-export: make sure refs are updated properly Date: Tue, 30 Oct 2012 23:18:04 +0100 Message-ID: References: <1351617089-13036-1-git-send-email-felipe.contreras@gmail.com> <1351617089-13036-5-git-send-email-felipe.contreras@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Cc: ">" , Jeff King , Junio C Hamano , Jonathan Nieder , Johannes Schindelin , Elijah Newren To: Sverre Rabbelier X-From: git-owner@vger.kernel.org Tue Oct 30 23:18:23 2012 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1TTK8a-0002FT-OM for gcvg-git-2@plane.gmane.org; Tue, 30 Oct 2012 23:18:21 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752939Ab2J3WSH (ORCPT ); Tue, 30 Oct 2012 18:18:07 -0400 Received: from mail-ob0-f174.google.com ([209.85.214.174]:64767 "EHLO mail-ob0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751495Ab2J3WSF (ORCPT ); Tue, 30 Oct 2012 18:18:05 -0400 Received: by mail-ob0-f174.google.com with SMTP id uo13so807046obb.19 for ; Tue, 30 Oct 2012 15:18:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=MgIsTpU/MiX3vBuNbV6v8pvm4MDxn8Gd1wTVVLnh4YQ=; b=JFQAkq7HQ5drgZ2e1SQ9pkbNnPJJluiR8a0jJgCqtK0AF3Nv9NTMaqvghNQorj0gdy 2sQzIryx4jAUljSxp3JCM0uK6UspJFHt+dPtLrS6tddjLWkaWVVLJXFkB1v91paoRf8n Kbgvo/FOwlgt5r7ooy2qdXuUDMDXPO824eXAvJayUEkx70Hmm+jgUIMHVL4UUNwwMRD5 DkBb8S9xlUAjF46AH8ypk3NtTX4SB3f4Cy84+Y7DJ7tgcpETFeS7exKBYSVuw7UAA9AT 1AN1phh6G+sfGgA7ZXCEK68uNtE/aS/BWhM8qlJcRZgz5MLSn/p0RcU2wf6MK4+viQtQ wHTA== Received: by 10.182.116.6 with SMTP id js6mr28599163obb.82.1351635484164; Tue, 30 Oct 2012 15:18:04 -0700 (PDT) Received: by 10.60.4.74 with HTTP; Tue, 30 Oct 2012 15:18:04 -0700 (PDT) In-Reply-To: Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: On Tue, Oct 30, 2012 at 10:59 PM, Sverre Rabbelier wrote: > On Tue, Oct 30, 2012 at 2:35 PM, Felipe Contreras > wrote: >> On Tue, Oct 30, 2012 at 10:17 PM, Sverre Rabbelier wrote: >>> On Tue, Oct 30, 2012 at 11:47 AM, Felipe Contreras >>> wrote: >>>> Why would it? We are not changing the way objects are exported, the >>>> only difference is what happens at the end >>>> (handle_tags_and_duplicates()). >>> >>> Because the marking is per-commit, not per-ref, right? >> >> Oh, you meant using marks? > > No, I meant the 'SHOWN' flag, doesn't it get added per commit, not per > ref? That is, commit->object.flags & SHOWN refers to the object > underlying the ref. So I suspect this scenario doesn't pass the tests: Without marks you cannot have the SHOWN mark at that point; we haven't traversed the commits. > git init && > echo first > content && > git add content && > git commit -m "first" && > git branch first && > echo two > content && > git commit -m "second" && > git branch second && > git fast-export first > actual && > test_cmp actual expected_first && > git fast-export second > actual && > test_cmp actual expected_second > > With expected_first being something like: > > Why would a 'reset' command be expected if the 'first' branch is already pointing to the 'first' commit? > And expected_second being something like > > Ditto, plus, why would 'git fast-export second' do anything regarding 'first'? It wasn't specified in the committish; it's not relevant. Before an after my patch the output is the same: % git fast-export first: reset refs/heads/first commit refs/heads/first % git fast-export second: reset refs/heads/second commit refs/heads/second commit refs/heads/second Which is expected and correct; the branch already points to the right commit, no need for an extra reset. Cheers. -- Felipe Contreras