From: Junio C Hamano Date: Sat, 16 Nov 2024 00:22:36 GMT Subject: Re: [PATCH v12 4/8] remote set-head: better output for --auto Message-ID: In-Reply-To: "Bence Ferdinandy" writes: >> so refs_read_symbolic_ref -> 1 only happens if there's a valid non-symbolic ref >> in origin/HEAD. So maybe if we put "Not a symbolic reference." in the referent >> (which should be an invalid symref), the caller could check for that and then >> should be able to distinguish this special case? > > On second thought, it would maybe make even more sense to get the reference > hash and put that into referent. In that case the output could still be > > "'%s/HEAD' has changed from '%s' and now points to '%s'\n" > > but with a non-symref after from. The output may look like the above, but people would certainly wish to clarify and/or translate "from '%s'" part. And to allow that, we may need to signal a bit more explicitly that we saw a non-symref HEAD there so that we can tell between a detached HEAD and a confusingly named branch whose name is 40-hex. Otherwise, one who tries to update that "has changed from '%s'" message to clarify between "pointed at branch '%s'" and "pointed at commit '%s'" (or translate into a language where the distinction matters, perhaps because branch and commit have different gender there that affects conjugation for "has changed from" part, or something hand-wavy) have insufficient information to work with. Thanks.