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

Re: [PATCH] git checkout: don't warn about unborn branch if -f is already passed

From
Matt McCutchen <matt@mattmccutchen.net>
Date
Dec 1, 2008, 16:47 UTC
Message-ID
<1228150047.2643.5.camel@mattlaptop2.local>
In-Reply-To
<7vr64yfexp.fsf@gitster.siamese.dyndns.org>
On Wed, 2008-11-26 at 11:46 -0800, Junio C Hamano wrote:
Show 16 quoted lines
> Matt McCutchen <matt@mattmccutchen.net> writes:
> 
> > I think it's unnecessary to warn that the checkout has been forced due to an
> > unborn current branch if -f has been explicitly passed.  For one project, I am
> > using git-new-workdir to create workdirs from a bare repository whose HEAD is
> > set to an unborn branch, and this warning started to irritate me.
> 
> I doubt anybody minds this particular change per-se, but I wonder what the
> justification of keeping a dangling HEAD in a bare repository is.
> 
> After all, the primary intended purpose of a bare repository is to serve
> as a distribution point (i.e. something you can clone from), and I think a
> dangling HEAD interferes with the usual operation of clone (although I've
> never tested this).
> 
> Care to explain why?

I am taking a course with six programming projects. I want a separate working tree for each project, but I want all the working trees connected to the same repository because I often copy changes from one project to another and that makes it more convenient to inspect the history of one project while I am working on another. I didn't want to put the repository inside an arbitrary one of the working trees, so I left it bare, and I didn't want to point its HEAD to an arbitrary one of the projects, so I left it unborn.

The upshot is that I am using a bare repository as a distribution point for *working trees* (via git-new-workdir), not for push/pull.

Matt
Previous: Junio C Hamano
Message 3 of 3 in “git checkout: don't warn about unborn branch if -f is already passed”
  1. git checkout: don't warn about unborn branch if -f is already passedMatt McCutchen, Nov 24, 2008
  2. Junio C HamanoNov 26, 2008
  3. Matt McCutchenDec 1, 2008

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.