From mboxrd@z Thu Jan 1 00:00:00 1970 From: Junio C Hamano Subject: Re: [PATCH 06/10] Move read_cache_unmerged() to read-cache.c Date: Thu, 05 Jun 2008 16:05:54 -0700 Message-ID: <7vhcc7zdm5.fsf@gitster.siamese.dyndns.org> References: <0a2c2130f9fd87e98192ab0fe0d23e16c902997c.1212698317.git.vmiklos@frugalware.org> <9867fa302ce1c28f4bd8534a70bda19786c75971.1212698317.git.vmiklos@frugalware.org> <5aca216074b88d68f97b8223ebf6272dfe6bddeb.1212698317.git.vmiklos@frugalware.org> <3168647573b1325f47ab16f9ee3cae5abaaee473.1212698317.git.vmiklos@frugalware.org> <01dd116d05eedba51578935e39f679a8747380d6.1212698317.git.vmiklos@frugalware.org> <514d4184569ab033cad97be9afbd88c767bfb484.1212698317.git.vmiklos@frugalware.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: git@vger.kernel.org To: Miklos Vajna X-From: git-owner@vger.kernel.org Fri Jun 06 01:07:03 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 1K4OXp-0007Nm-5Z for gcvg-git-2@gmane.org; Fri, 06 Jun 2008 01:06:57 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752411AbYFEXGE (ORCPT ); Thu, 5 Jun 2008 19:06:04 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752848AbYFEXGE (ORCPT ); Thu, 5 Jun 2008 19:06:04 -0400 Received: from a-sasl-fastnet.sasl.smtp.pobox.com ([207.106.133.19]:38573 "EHLO sasl.smtp.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751713AbYFEXGC (ORCPT ); Thu, 5 Jun 2008 19:06:02 -0400 Received: from localhost.localdomain (localhost [127.0.0.1]) by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTP id B94183BEF; Thu, 5 Jun 2008 19:06:00 -0400 (EDT) Received: from pobox.com (ip68-225-240-77.oc.oc.cox.net [68.225.240.77]) (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 0D6DB3BEE; Thu, 5 Jun 2008 19:05:57 -0400 (EDT) In-Reply-To: <514d4184569ab033cad97be9afbd88c767bfb484.1212698317.git.vmiklos@frugalware.org> (Miklos Vajna's message of "Thu, 5 Jun 2008 22:44:32 +0200") User-Agent: Gnus/5.110006 (No Gnus v0.6) Emacs/21.4 (gnu/linux) X-Pobox-Relay-ID: F6D553D4-3353-11DD-8998-F9737025C2AA-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: Miklos Vajna writes: > builtin-read-tree has a read_cache_unmerged() which is useful for other > builtins, for example builtin-merge uses it as well. Move it to > read-cache.c to avoid code duplication. Looks good, but as a public interface probably it needs a few lines of comment in front of the function's definition to describe what it is used for. Perhaps like... /* * Read the index file that is potentially unmerged into given * index_state, dropping any unmerged entries. Returns true is * the index is unmerged. Callers who want to refuse to work * from an unmerged state can call this and check its return value, * instead of calling read_cache(). */