From: Junio C Hamano Subject: Re: [PATCH] remote-hg: fix path when cloning with tilde expansion Date: Fri, 09 Aug 2013 23:50:12 -0700 Message-ID: <7v38qi2g63.fsf@alter.siamese.dyndns.org> References: <1376068387-28510-1-git-send-email-apelisse@gmail.com> <7veha266nq.fsf@alter.siamese.dyndns.org> <7vy58a4mcy.fsf@alter.siamese.dyndns.org> <7v7gfu4ikb.fsf@alter.siamese.dyndns.org> <7vmwoq304o.fsf@alter.siamese.dyndns.org> <7vioze2kev.fsf@alter.siamese.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Antoine Pelisse , git To: Felipe Contreras X-From: git-owner@vger.kernel.org Sat Aug 10 08:57:47 2013 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 1V837T-0000hh-7u for gcvg-git-2@plane.gmane.org; Sat, 10 Aug 2013 08:57:47 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030506Ab3HJG5l (ORCPT ); Sat, 10 Aug 2013 02:57:41 -0400 Received: from b-pb-sasl-quonix.pobox.com ([208.72.237.35]:48559 "EHLO smtp.pobox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031890Ab3HJGuP (ORCPT ); Sat, 10 Aug 2013 02:50:15 -0400 Received: from smtp.pobox.com (unknown [127.0.0.1]) by b-sasl-quonix.pobox.com (Postfix) with ESMTP id 663F12FCDC; Sat, 10 Aug 2013 06:50:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=zN0U762mNpGMw9kgyCVqlra4zpk=; b=gGwvML hdvntGMRaAEVj7JrdsL9XMa8wzj07fxiRycjMDTBroICsrEjni64ZMstDeP4HXL0 Sa0uQHMXHzwgUbY/tMYCyDX8jJufacOB3Yh+gceCUFXoSWBM7YRlqXaAog3Al77a yGWdCYfLRSOJZl66emsVO27lj1vYfD1grRW38= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=K0to1OMhmdKcBxjV14UCtweA6cdSjVmb 7lgbW9tFitCrkc6U+AnBVBTXatD6DiMj3PGsn6Fng6G8FCbcXwiuBEVorpzOcINA nYrqA8D0Q44l1AWuUrCQf036FM3bUIVLnB2o0KrvHWwGy8AHX6lnskwRDIsL2rQo Q5WaPOpsN3I= Received: from b-pb-sasl-quonix.pobox.com (unknown [127.0.0.1]) by b-sasl-quonix.pobox.com (Postfix) with ESMTP id 57EE02FCDA; Sat, 10 Aug 2013 06:50:14 +0000 (UTC) Received: from pobox.com (unknown [50.161.4.97]) (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 B868C2FCD8; Sat, 10 Aug 2013 06:50:13 +0000 (UTC) In-Reply-To: (Felipe Contreras's message of "Sat, 10 Aug 2013 01:39:59 -0500") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: 1BABDE86-0189-11E3-A623-E84251E3A03C-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: Felipe Contreras writes: > If I clone ~/git, and then change my username, and move my home > directory, doing a 'git fetch' in ~/git wouldn't work anymore, because > we have expanded the path and fixed it to my old home, if instead we > simply return without fixing, it would still work just fine. Antoine's patch runs expanduser() only to see if the given one gets modified to absolute path, and makes fix_path() return without calling the extra 'git config', so it is my understanding that the above describes exactly what the patch does. Am I reading the patch incorrectly? It outsources the determination of "is this a special notation to name a home directory?" logic to .isabs(.expanduser()) instead of doing a .beginswith('~') ourselves.