public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
* [Discuss] soften warning message after cloning "void"
@ 2015-02-18 23:24 Junio C Hamano
  2015-02-19  0:13 ` Stefan Beller
  0 siblings, 1 reply; 9+ messages in thread
From: Junio C Hamano @ 2015-02-18 23:24 UTC (permalink / raw)
  To: git

If you did this:

    $ git init void &&
      git -C void commit --allow-empty -m initial &&
      git -C void symbolic-ref HEAD refs/heads/nosuch
    $ git clone --no-local void new

you would get

    warning: remote HEAD refers to nonexistent ref, unable to checkout.

While it is correct that we are unable to perform the normal
"checkout" of their primary branch that their HEAD points at,
it was reported that some users find this message unnecessarily
alarming.

Rephrase by saying what we decided to do, instead of only stating
what led us to that decision without telling what that decision is.
That is, "(because we cannot checkout), we left the HEAD pointing at
an unborn branch."

---
 builtin/clone.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/builtin/clone.c b/builtin/clone.c
index 9572467..c7f1bf2 100644
--- a/builtin/clone.c
+++ b/builtin/clone.c
@@ -625,8 +625,8 @@ static int checkout(void)
 
 	head = resolve_refdup("HEAD", RESOLVE_REF_READING, sha1, NULL);
 	if (!head) {
-		warning(_("remote HEAD refers to nonexistent ref, "
-			  "unable to checkout.\n"));
+		warning(_("remote HEAD refers to nonexistent ref; "
+			  "leaving the current branch unborn.\n"));
 		return 0;
 	}
 	if (!strcmp(head, "HEAD")) {

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2015-02-21  5:58 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-18 23:24 [Discuss] soften warning message after cloning "void" Junio C Hamano
2015-02-19  0:13 ` Stefan Beller
2015-02-19  0:25   ` Junio C Hamano
2015-02-19  0:43     ` Shawn Pearce
2015-02-19  0:46       ` Shawn Pearce
2015-02-19  2:54       ` Junio C Hamano
2015-02-19  5:12         ` Stefan Beller
2015-02-21  5:58           ` Junio C Hamano
2015-02-19  0:47     ` Stefan Beller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox