From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-a7-smtp.messagingengine.com (fhigh-a7-smtp.messagingengine.com [103.168.172.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4EA7E244685 for ; Sun, 26 Jul 2026 23:29:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.158 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785108557; cv=none; b=AIkSqEFSS6J9IrIqvzZ4qBynuXgU9ydNI+Lwej+ATCEqQeh5LNTyGdLopaulHZ9+R5iLlmJSMQvCgKaBhDZuUxiCDv992ewsZyz0nTNMBr4OuLXLblBgsoWUKSGgr/m0DtaW/R5AA4VjguNbSy9OGw9muQ4w6UmonT0pvyZRLoU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785108557; c=relaxed/simple; bh=fxJA+3GBNK5ylS4ZtRK6WbEwB1BLbj8lPJKhDoXiBb8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=SVhffLPgRh1aXmN2IwQV165fU98fTkcEDWVLdDRptTKjUcVUzKqL0qT0LhlzHik97LGBfkhfOuWjcHx29lpkqD3Y9ZmIWl2olx6p93p/TianbygXI1TkmjCi8w6+B6mhpaM61wAl1loFLT3hfmDDO2/O52AOlJ4RgqwTaDFgVQo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com; spf=pass smtp.mailfrom=pobox.com; dkim=pass (2048-bit key) header.d=pobox.com header.i=@pobox.com header.b=QYeVd6We; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=ZOd40Ovt; arc=none smtp.client-ip=103.168.172.158 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=pobox.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pobox.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=pobox.com header.i=@pobox.com header.b="QYeVd6We"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="ZOd40Ovt" Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfhigh.phl.internal (Postfix) with ESMTP id 586AB1400325; Sun, 26 Jul 2026 19:29:14 -0400 (EDT) Received: from phl-frontend-02 ([10.202.2.161]) by phl-compute-05.internal (MEProxy); Sun, 26 Jul 2026 19:29:14 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pobox.com; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1785108554; x=1785194954; bh=lWPbuMokKU ck4AIM7jbD41wGsjTz+egSsfcA7HebDsg=; b=QYeVd6Web6a34dHKseQ2m3xNA8 6skIFc4yBFo0BMnpBLyOmlCN35V2TLfg/Bc1KbErUYfsTo7CS0bPAQ3tys4sW/dq 9gYSjfqHlfVSLeEoLbhOv07piB3jnr0MS275usu+EDgLocel1P60P5z4hYihxXHs LzlbazjfwDfaEiovc4lKWFxOycNkIvvq6mpIk8kg7AsxsG+VQu07os0jq35MA4kt vzbxqU2LSonJLu15A2TlROeOBTnDxa9PHSj1lpvivDIR4uaqvl0+qPfkfBQ++NLH guaBueS6UJYcLpvDGyFDEYsWGtbCJ6sxOadSIJpDNDcqqDP76VRxJUAq6FJA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1785108554; x=1785194954; bh=lWPbuMokKUck4AIM7jbD41wGsjTz+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cwW4z/H6dib2w X-ME-Proxy: Feedback-ID: if26b431b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 26 Jul 2026 19:29:13 -0400 (EDT) From: Junio C Hamano To: "Lucas Zamboni Orioli via GitGitGadget" Cc: git@vger.kernel.org, Ben Knoble , Pablo Sabater , Lucas Zamboni Orioli Subject: Re: [PATCH v4 0/2] mv: report missing destination leading directory In-Reply-To: (Lucas Zamboni Orioli via GitGitGadget's message of "Sun, 26 Jul 2026 20:17:49 +0000") References: Date: Sun, 26 Jul 2026 16:29:12 -0700 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain "Lucas Zamboni Orioli via GitGitGadget" writes: > Changes in v4: > > * reverted to lstat and added has_symlink_leading_path() to refuse a > destination that goes through a symbolic link, independent of the link > target, per Junio C Hamano's point that Git tracks symlinks and must not > follow them here I'll review the series tomorrow, but the use of the helper function has_symlink_leading_path() in other contexts like 'git apply' rings a bell. I agree the problem you face is exactly the issue the helper function aims to address. > * added new "destination is beyond a symbolic link" message > * added tests: symlink as immediate parent and as intermediate component, > symlink at the destination, -f does not bypass the symlink refusal, and a > regression test that a move through a symlink no longer corrupts the > index (see the reproduction reported on the list) Sounds good. When 'y' is a symbolic link to some directory (say, 'a/b'), we do not want 'git mv x y' to create 'y/x' at the same time we have 'y' as a symbolic link. It may be OK if the result has 'a/b/x' (a file in a directory) and 'y' (a symbolic link), but I think that would be more confusing than it is worth. Thanks.