git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Neal Kreitzinger" <neal@rsss.com>
Cc: git@vger.kernel.org
Subject: Re: nested git repos (not submodules)
Date: Thu, 09 Feb 2012 20:16:25 -0800	[thread overview]
Message-ID: <7vd39ns4py.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <jh1vo3$7af$1@dough.gmane.org> (Neal Kreitzinger's message of "Thu, 9 Feb 2012 20:34:42 -0600")

"Neal Kreitzinger" <neal@rsss.com> writes:

> In the worktree of a particular git repo, the user has made a subdir 
> (worktree/subdir) of the worktree (worktree/.git) its own repo 
> (worktree/subdir/.git).  Is there a danger of worktree/.git and 
> worktree/subdir/.git crossing wires?  

The repository controlled by worktree/.git should behave as if subdir/
does not exist, except that obviously the project cannot have a regular
file "subdir" in it.  When you chdir to worktree/subdir, everything in
there should behave as if worktree/.git directory does not exist.

At least that is the design, and it indeed is how I arrange my primary
working tree (I have two "clones" at /git/git.git/ and /git/git.git/Meta,
and the latter has a checkout of the "todo" branch), so I would make
noises about any breakage for such a layout.

I do not know offhand if an attempt to add files inside subdir to the
repository controlled by worktree/.git is always correctly prohibited by
the code, though, as our code often forgets to error out "stupid user
mistakes", and running "git add subdir/bar" when in worktree/ falls into
that category.

And the use of that layout predates the submodules by a large margin.
In fact, when people suggest use of submodules when the toplevel and the
sublevel do not even need tight version dependencies, some of their use
cases might be better supported by using the simply-nested layout without
even letting the toplevel be aware of the sublevel.

  parent reply	other threads:[~2012-02-10  4:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-10  2:34 nested git repos (not submodules) Neal Kreitzinger
2012-02-10  3:47 ` Andrew Ardill
2012-02-10 22:07   ` Neal Kreitzinger
2012-02-10  4:16 ` Junio C Hamano [this message]
2012-02-10 22:30   ` Neal Kreitzinger

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=7vd39ns4py.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=neal@rsss.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).