From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fout-b4-smtp.messagingengine.com (fout-b4-smtp.messagingengine.com [202.12.124.147]) (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 4CB47AD27 for ; Wed, 20 Nov 2024 01:17:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.147 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732065462; cv=none; b=MuwVj2jVQYL8Kyjd/vUIpz5FCWJq6MEB9TCU6n4u+VIJobUlXB9ovgVOGlgeWZ6Lz1Fds7sLKYeiMWvHaXPm/rvMBPMYuuZkrSN01TJ8Xco6ONmDH1IEmrb2+UcHFdX+56lmwez5H71jKUS+6rocgfh0wDhKCfgus7da9j6pHHw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1732065462; c=relaxed/simple; bh=TWCg4IFLogv4bGmpiPuiQl3L+WNXufp4EgmzZg+VAf4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=rOwNDmTMoxUmyt92vfFAMFUu8G+rJtUx384a1bJgQfM3eUBi654ZCSb+9qL05X1H2rnkcDJVeP4MlLiTxMQQgq5VZWeBcwDGL7TLNQCVB3B5n0C22Pnz08pMKk/5UmK+Kl/xmObpzQRPaMIVFXWJZ5oq2PZvS0QmSv6Mv/o4AX4= 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=messagingengine.com header.i=@messagingengine.com header.b=brINuV3j; arc=none smtp.client-ip=202.12.124.147 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=messagingengine.com header.i=@messagingengine.com header.b="brINuV3j" Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.stl.internal (Postfix) with ESMTP id 26AC311401C4; Tue, 19 Nov 2024 20:17:39 -0500 (EST) Received: from phl-frontend-02 ([10.202.2.161]) by phl-compute-01.internal (MEProxy); Tue, 19 Nov 2024 20:17:39 -0500 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=fm3; t= 1732065459; x=1732151859; bh=FwD6K9LvsDQjEC/I7vBsDgLI2WORMqZ08dP QMY4PGck=; b=brINuV3j+oUr5fcL+dTLx+VXnk6LStq5/N8e+BhAjDYWzNqVTOb vfqs6DHhkhnrbNuLHU0nhduAgpQXvkYbYRS7AzvFGxkP/R4IcVeJV/e5uXVsvdQa nUIaMjiWJsrtIG3HucghWa/4E04ODEkSNKulupftzQeHdjuCJBQ2ZuRFbM9drGn2 D1p/7rnHYcVIpEiJBeVzjrz2Kip/VHcpW/ICuux1be6n/Vj/hWb8S5w6ZvxhmgpG UeGCAev1VWbhVnmMi/2iyAgTXEGdkkkTcACrucaPsx3QHY1PRhKGMSqkHfUovvA6 fqjrDGnCs3ZKiXP5VvLVNZIajOZ1/HM1/sg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrfeefgdefudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefhvfevufgjfhffkfgfgggtsehttdertddtredtnecu hfhrohhmpefluhhnihhoucevucfjrghmrghnohcuoehgihhtshhtvghrsehpohgsohigrd gtohhmqeenucggtffrrghtthgvrhhnpeefveetteejheeugeffledvteeiveffueefjeel ueffteeigffgfedthfefieegieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmh epmhgrihhlfhhrohhmpehgihhtshhtvghrsehpohgsohigrdgtohhmpdhnsggprhgtphht thhopeehpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopeigvghnohhtvghrrhgrtg hiuggvsehgmhgrihhlrdgtohhmpdhrtghpthhtohepsggvnhgtvgesfhgvrhguihhnrghn ugihrdgtohhmpdhrtghpthhtohepphgvfhhfsehpvghffhdrnhgvthdprhgtphhtthhope hgihhtsehvghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepghhithhsthgvrhes phhosghogidrtghomh X-ME-Proxy: Feedback-ID: if26b431b:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 19 Nov 2024 20:17:38 -0500 (EST) From: Junio C Hamano To: Caleb Cushing Cc: Bence Ferdinandy , Jeff King , git@vger.kernel.org Subject: Re: git remote set-head automatically In-Reply-To: (Caleb Cushing's message of "Tue, 19 Nov 2024 10:40:55 -0500") References: <20241116033616.GB1782794@coredump.intra.peff.net> Date: Wed, 20 Nov 2024 10:17:37 +0900 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 Caleb Cushing writes: > sounds great. I think I realized why I didn't have it. It's not done > by `git remote add https://...` my experiment was `git > remote rm origin` and then `git remote add origin ... ; git fetch > --all --prune` I think I also tried without the prune option. git > version 2.46.1 Yes, "git fetch" does not notice a missing remotes/$name/HEAD and does not automatically create it. This is being worked on in a separate thread. Doing it unconditionally may hurt some existing users (including me) who see more than one primarily interesting branches in a single remote and want to force themselves to be more explicit, though. For us, leaving remotes/$name/HEAD missing (e.g. by "git clone" followed by "git update-ref --no-deref -d refs/remotes/origin/HEAD") is a way to allow ourselves to say things like $ git checkout -b mytopic origin/maint $ git rebase origin/master mytopic but not $ git checkout --detach origin because the last one is ambiguous between the two branches of primary interest. But hopefully they have trained their fingers not to say "origin" by now ;-) So changing "git fetch" to auto-fill remotes/origin/HEAD to whatever branch the remote is pointing at at the time of running would be good enough for an initial enhanced version, even though we might need to further improve on by allowing folks to opt out of the feature.