From mboxrd@z Thu Jan 1 00:00:00 1970 From: Junio C Hamano Subject: Re: [PATCH v2 3/6] clone: factor out checkout code Date: Mon, 09 Jan 2012 16:32:26 -0800 Message-ID: <7vd3ascs85.fsf@alter.siamese.dyndns.org> References: <1325771380-18862-1-git-send-email-pclouds@gmail.com> <1326023188-15559-1-git-send-email-pclouds@gmail.com> <1326023188-15559-3-git-send-email-pclouds@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: git@vger.kernel.org, Jeff King To: =?utf-8?B?Tmd1eeG7hW4gVGjDoWkgTmfhu41j?= Duy X-From: git-owner@vger.kernel.org Tue Jan 10 01:32:45 2012 Return-path: Envelope-to: gcvg-git-2@lo.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RkPds-0000uU-Lf for gcvg-git-2@lo.gmane.org; Tue, 10 Jan 2012 01:32:45 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933586Ab2AJAcb convert rfc822-to-quoted-printable (ORCPT ); Mon, 9 Jan 2012 19:32:31 -0500 Received: from b-pb-sasl-quonix.pobox.com ([208.72.237.35]:57391 "EHLO smtp.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933544Ab2AJAcb convert rfc822-to-8bit (ORCPT ); Mon, 9 Jan 2012 19:32:31 -0500 Received: from smtp.pobox.com (unknown [127.0.0.1]) by b-sasl-quonix.pobox.com (Postfix) with ESMTP id 1F0356475; Mon, 9 Jan 2012 19:32:28 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:message-id:mime-version:content-type :content-transfer-encoding; s=sasl; bh=8oynO+u5vOSQdnS7XQfZgfXa8 7M=; b=LCZHGFh472q4WTPKARz6SefxNj8za3Ds3GSg6h1Z6p65Z6IiBKKyO+ZTb 72KrZwaUW982s2WhGtfTigWoMTnJrptN0VTzDpWvVraziPewU6k/2IVy8K6UGh9X ApRDcOKGbqYVcYinQDxeldARcSKEX+NGXdXY4XVRnRRPhIDXcA= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=sasl; b=u3TYj3/f5X/Sp4FGuiO Gw37fvgTchtKARBErQU31A9SAkQHzsFJYAxJpoQ0GKlSGobZTTkUaqZCzdBSSNBu FwNBEK7hoeBmcE/rJ4lf0IW7VmROEoAGVoAa0NKxynADp/TkJwW05yZs5OBRLYoN jdOvTd9nrFUu4z/1Vv2zdxw0= Received: from b-pb-sasl-quonix.pobox.com (unknown [127.0.0.1]) by b-sasl-quonix.pobox.com (Postfix) with ESMTP id 16C256474; Mon, 9 Jan 2012 19:32:28 -0500 (EST) Received: from pobox.com (unknown [76.102.170.102]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by b-sasl-quonix.pobox.com (Postfix) with ESMTPSA id A1C1F6473; Mon, 9 Jan 2012 19:32:27 -0500 (EST) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: 92DD5C34-3B22-11E1-AB9B-9DB42E706CDE-77302942!b-pb-sasl-quonix.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: Nguy=E1=BB=85n Th=C3=A1i Ng=E1=BB=8Dc Duy writes: > Read HEAD from disk instead of relying on local variable > our_head_points_at, so that if earlier code fails to make HEAD > properly, it'll be detected. The end result might be more or less the same with your patch from the end-user's point of view, but "if earlier code fails", shouldn't you detect and diagnose it right there? If you observe lack of "HEAD" in checkout(), you cannot tell if that wa= s because the remote did not have anything usable in the first place, or because we knew where it should point at (and may have even attempted t= o create it) but somehow failed to make it point at it.