git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Chris Torek <chris.torek@gmail.com>,
	Craig H Maynard <chmaynard@me.com>,
	git@vger.kernel.org
Subject: Re: Regarding Git and Branch Naming
Date: Fri, 26 Jun 2020 14:07:37 -0700	[thread overview]
Message-ID: <xmqq7dvth6xy.fsf@gitster.c.googlers.com> (raw)
In-Reply-To: <20200626203539.GA1173768@coredump.intra.peff.net> (Jeff King's message of "Fri, 26 Jun 2020 16:35:39 -0400")

Jeff King <peff@peff.net> writes:

> We definitely _could_ extend HEAD to allow a "not pointing at anything"
> state. Presumably for reading that would behave like the "pointing at a
> branch that doesn't exist yet" case. But I think the experience it
> creates for writing is not very good. I.e., I think the best we could do
> is something like:
>
>   $ git init
>   $ git add some-files
>   $ git commit -m whatever
>   fatal: HEAD does not point to any branch
>   hint: use "git checkout -b <branch>" to make commits on <branch>

... or you could stay forever on detached HEAD state.

Very briefly in early days of Git, the envisioned use case (which
quickly was retracted) was to use one repository per one line of
development (so you'd pull among the repositories you have, and each
repository does not even need to have "the default" branch---there
was no need for any branch).  Staying forever on detached HEAD is
pretty much in line with that.

> Perhaps that's not _too_ bad, but it feels a bit unfriendly (and
> definitely more likely to cause backwards compatibility issues than
> picking _some_ default name). There would also be a lot of corner cases
> to cover and debug (e.g., "git checkout foo" moving away from the "no
> branch" state should make the usual complaints if we'd have to overwrite
> or modify index and untracked files).

I do not see much point in adding such a new set-up, only to risk
introducing unexpected and unnecessary bugs.  Such extra engineering
resource is better spent elsewhere, I would say.




  reply	other threads:[~2020-06-26 21:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-26 16:18 Regarding Git and Branch Naming Craig H Maynard
2020-06-26 18:33 ` Chris Torek
2020-06-26 20:35   ` Jeff King
2020-06-26 21:07     ` Junio C Hamano [this message]
2020-06-27  3:05       ` Jeff King
2020-06-26 21:33     ` Philip Oakley
2020-06-27  3:11       ` Jeff King
2020-06-26 21:58     ` Elijah Newren
2020-06-27  3:14       ` Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqq7dvth6xy.fsf@gitster.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=chmaynard@me.com \
    --cc=chris.torek@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).