git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: kusmabite@gmail.com
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: git checkout creates strange '(null)'-branch
Date: Tue, 08 May 2012 09:22:25 -0700	[thread overview]
Message-ID: <7vhavqy75q.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <CABPQNSYzxDoer_Xhf+8EEU4zz58PLRQiZAsg_CWzP3ps6f_4rw@mail.gmail.com> (Erik Faye-Lund's message of "Tue, 8 May 2012 18:04:58 +0200")

Erik Faye-Lund <kusmabite@gmail.com> writes:

> Yes, it does. Basically, it calls "git checkout -f -q" from cmd_add if
> $branch is empty. And it fails if the checkout-call fails.
>
> I'm not saying it's a sane thing to do. But to me, it kind of feels
> natural to initialize the shared (i.e bare) repos for both the
> superproject and the submodule, clone the superproject, add the
> submodule, and populate these from there.

I sense a bit of slipperly slope here.  After doing this, the superproject
would have its .gitmodules file set up to point at something, but what
does its first commit look like?  Other files and .gitmodules, but no
empty-submodule?  Can you commit the superproject _with_ empty-submodule
without having any commit in that empty-submodule?  I think "git add"
should fail when there is no commit there in the first place, so you won't
create such a superproject commit that does not have anything in the
submodule.  Is that OK for everybody?  Or would we add yet another funny
special case for such a setting, perhaps by contaminating the index and
the tree in the superproject with a stand-in value to represent a "does
not yet exist" commit that ought to be at the tip of submodule's history?

> But that won't work the way
> things currently are, because you can't "git submodule add" an empty
> project.
>
> To allow that,...

Yes, allowing that does not seem to make sense at all in the larger
picture. What benefit would we get from that slipperly slope?

      reply	other threads:[~2012-05-08 16:22 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-08 11:24 git checkout creates strange '(null)'-branch Erik Faye-Lund
2012-05-08 11:34 ` Johannes Sixt
2012-05-08 11:50   ` Erik Faye-Lund
2012-05-08 12:10     ` Andreas Schwab
2012-05-08 16:25     ` Junio C Hamano
2012-05-10 14:22       ` Erik Faye-Lund
2012-05-10 16:49         ` Junio C Hamano
2012-05-08 15:09   ` Junio C Hamano
2012-05-08 15:05 ` Junio C Hamano
2012-05-08 15:19 ` Junio C Hamano
2012-05-08 16:04   ` Erik Faye-Lund
2012-05-08 16:22     ` Junio C Hamano [this message]

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

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

  git send-email \
    --in-reply-to=7vhavqy75q.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=kusmabite@gmail.com \
    /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.
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 NNTP newsgroup(s).