From mboxrd@z Thu Jan 1 00:00:00 1970 From: Junio C Hamano Subject: Re: Diff-tree does not work for initial commit Date: Mon, 15 Sep 2008 13:54:42 -0700 Message-ID: <7vprn59lkd.fsf@gitster.siamese.dyndns.org> References: <3665a1a00809151301p7d8e6387g3cacfb879b45da2f@mail.gmail.com> <48CECA42.1050209@drmicha.warpmail.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Anatol Pomozov , Git Mailing List To: Michael J Gruber X-From: git-owner@vger.kernel.org Mon Sep 15 22:56:07 2008 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 1KfL72-0005gy-6t for gcvg-git-2@gmane.org; Mon, 15 Sep 2008 22:56:00 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754349AbYIOUyw (ORCPT ); Mon, 15 Sep 2008 16:54:52 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754287AbYIOUyw (ORCPT ); Mon, 15 Sep 2008 16:54:52 -0400 Received: from a-sasl-fastnet.sasl.smtp.pobox.com ([207.106.133.19]:40546 "EHLO sasl.smtp.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753085AbYIOUyw (ORCPT ); Mon, 15 Sep 2008 16:54:52 -0400 Received: from localhost.localdomain (localhost [127.0.0.1]) by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTP id 6C8C86125D; Mon, 15 Sep 2008 16:54:49 -0400 (EDT) Received: from pobox.com (ip68-225-240-211.oc.oc.cox.net [68.225.240.211]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTPSA id 2467A61255; Mon, 15 Sep 2008 16:54:44 -0400 (EDT) In-Reply-To: <48CECA42.1050209@drmicha.warpmail.net> (Michael J. Gruber's message of "Mon, 15 Sep 2008 22:49:06 +0200") User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) X-Pobox-Relay-ID: 894CA38E-8368-11DD-BCEF-D0CFFE4BC1C1-77302942!a-sasl-fastnet.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Michael J Gruber writes: > Anatol Pomozov venit, vidit, dixit 15.09.2008 22:01: >> Hi, It looks like I found a bug in git. >> >> The problem: In my script I need to know what files were modified by >> given commit. I use diff-tree for it. Although it works for most >> cases, for initial commit it does not. Here is a sequence of actions. >> >> >> anatol:~ $ mkdir mkdir initialcommitissue anatol:~ $ cd >> initialcommitissue/ anatol:initialcommitissue $ git init Initialized >> empty Git repository in /home/anatol/initialcommitissue/.git/ >> anatol:initialcommitissue $ echo "First commit" > 1.txt >> anatol:initialcommitissue $ git add 1.txt anatol:initialcommitissue $ >> git commit -m "First commit" Created initial commit 31ccc6a: First >> commit 1 files changed, 1 insertions(+), 0 deletions(-) create mode >> 100644 1.txt anatol:initialcommitissue $ git diff-tree HEAD <<<<< >> PROBLEM IS HERE > > From the man page: > > Compares the content and mode of the blobs found via two tree > objects. > > If there is only one given, the commit is compared > with its parents (see --stdin below). > > Note that git-diff-tree can use the tree encapsulated in a commit > object. > > The initial commit has no parent, so diff-tree does not know which tree > to compare to. --root?