git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jens Lehmann <Jens.Lehmann@web.de>
Cc: Antony Male <antony.male@gmail.com>,
	git@vger.kernel.org, iveqy@iveqy.com
Subject: Re: [PATCH] Submodules always use a relative path to gitdir
Date: Tue, 03 Jan 2012 10:27:30 -0800	[thread overview]
Message-ID: <7vsjjwvdyl.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <4F007492.8010909@web.de> (Jens Lehmann's message of "Sun, 01 Jan 2012 15:58:26 +0100")

Jens Lehmann <Jens.Lehmann@web.de> writes:

> Am 29.12.2011 23:40, schrieb Junio C Hamano:
>> Antony Male <antony.male@gmail.com> writes:
>> I further wonder if we can get away without using separate-git-dir option
>> in this codepath, though. IOW using
>> 
>>         git clone $quiet -bare ${reference:+"$reference"} "$url" "$gitdir"
>> 
>> might be a better solution.
>
> A quick test shows that using a bare repo won't fly because without the
> core.worktree setting commands that operate on the work tree can't be
> run anymore inside submodules (starting with the initial checkout). 

Probably the right thing to do would be to restructure the flow as I
suggested, i.e.

	if we do not have it yet
        then
        	git clone --bare ...
	fi
	# now we have it, make sure they are correct
	git config core.bare false
	git config core.worktree $there
        echo "gitdir: $here" >$there/.git

> Yes, and the core.worktree setting also contains an absolute path. So
> we must either make that relative too and rewrite it on every "git
> submodule add" to record the possibly changed path there or make the
> bare clone work with a work tree (which sounds a bit strange ;-).

Update of core.worktree has to be done regardless of the absolute/relative
differences anyway, no?

The first version of the superproject you trigger module_clone for
submodule $name may happen to have it at $path, module_clone notices that
you do not have it, and the initial "clone --separate-git-dir" will set
the core.worktree to $superproject/$path.  Nobody will update it after
that, even when we check out different version of superproject that has
the same submodule $name at a different location in the superproject.

  reply	other threads:[~2012-01-03 18:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-29 21:00 [PATCH] Submodules always use a relative path to gitdir Antony Male
2011-12-29 22:40 ` Junio C Hamano
2011-12-31 21:28   ` Phil Hord
2012-01-03 18:45     ` Junio C Hamano
2012-01-03 19:58       ` Junio C Hamano
2012-01-01 14:58   ` Jens Lehmann
2012-01-03 18:27     ` Junio C Hamano [this message]
2012-01-03 22:10       ` Jens Lehmann
2012-01-03 22:17         ` Junio C Hamano
2012-01-05 22:52           ` Jens Lehmann
2012-01-06  0:11             ` Junio C Hamano
2012-01-06 14:26               ` Phil Hord
2012-01-06 15:07                 ` Nguyen Thai Ngoc Duy
2012-01-06 18:53                 ` Junio C Hamano
2011-12-29 22:48 ` Fredrik Gustafsson
2011-12-31 20:31 ` Phil Hord

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=7vsjjwvdyl.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=Jens.Lehmann@web.de \
    --cc=antony.male@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=iveqy@iveqy.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).