git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Regarding Git and Branch Naming

From
Jeff King <peff@peff.net>
Date
Jun 27, 2020, 03:05 UTC
Message-ID
<20200627030532.GA1187031@coredump.intra.peff.net>
In-Reply-To
<xmqq7dvth6xy.fsf@gitster.c.googlers.com>
On Fri, Jun 26, 2020 at 02:07:37PM -0700, Junio C Hamano wrote:
Show 14 quoted lines
> >   $ 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.

Given the difficulties many users seem to have with understanding detached HEADs, I think that might be even more unfriendly. :)

Show 10 quoted lines
> > 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.
Yeah, agreed.
-Peff
Previous: Junio C HamanoNext: Philip Oakley
Message 5 of 9 in “Re: Regarding Git and Branch Naming”
  1. Craig H MaynardJun 26, 2020
  2. Chris TorekJun 26, 2020
  3. Jeff KingJun 26, 2020
  4. Junio C HamanoJun 26, 2020
  5. Jeff KingJun 27, 2020
  6. Philip OakleyJun 26, 2020
  7. Jeff KingJun 27, 2020
  8. Elijah NewrenJun 26, 2020
  9. Jeff KingJun 27, 2020

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.