From mboxrd@z Thu Jan 1 00:00:00 1970 From: Junio C Hamano Subject: Re: [PATCH 4/5] Make 'diff_populate_filespec()' use the new 'strbuf_readlink()' Date: Wed, 17 Dec 2008 12:37:43 -0800 Message-ID: <7vmyeuleqw.fsf@gitster.siamese.dyndns.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Git Mailing List To: Linus Torvalds X-From: git-owner@vger.kernel.org Wed Dec 17 21:39:26 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 1LD3Ay-0001Yq-UZ for gcvg-git-2@gmane.org; Wed, 17 Dec 2008 21:39:25 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751489AbYLQUhu (ORCPT ); Wed, 17 Dec 2008 15:37:50 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751438AbYLQUhu (ORCPT ); Wed, 17 Dec 2008 15:37:50 -0500 Received: from a-sasl-fastnet.sasl.smtp.pobox.com ([207.106.133.19]:63730 "EHLO sasl.smtp.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751304AbYLQUht (ORCPT ); Wed, 17 Dec 2008 15:37:49 -0500 Received: from localhost.localdomain (unknown [127.0.0.1]) by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTP id E45198775F; Wed, 17 Dec 2008 15:37:47 -0500 (EST) Received: from pobox.com (unknown [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 1A44A8775E; Wed, 17 Dec 2008 15:37:44 -0500 (EST) User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) X-Pobox-Relay-ID: 90D9494E-CC7A-11DD-9EED-5720C92D7133-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: Linus Torvalds writes: > diff --git a/diff.c b/diff.c > index afefe08..4b2029c 100644 > --- a/diff.c > +++ b/diff.c > @@ -1773,19 +1773,17 @@ int diff_populate_filespec(struct diff_filespec *s, int size_only) > s->size = xsize_t(st.st_size); > if (!s->size) > goto empty; > - if (size_only) > - return 0; > if (S_ISLNK(st.st_mode)) { > ... > } > + if (size_only) > + return 0; It is unfortunate that we need to always readlink even when we only would want to cull differences early (e.g. --raw without any fancy filters such as rename detection), but symbolic links should be minorities in any sane repo, and it should not be worth trying to optimize this for sane filesystems by making it conditional.