public inbox for git@vger.kernel.org 
 help / color / mirror / Atom feed
From: Mark Levedahl <mlevedahl@gmail•com>
To: Christopher Wilson <cwilson@cdwilson•us>
Cc: git@vger•kernel.org, Jens Lehmann <Jens.Lehmann@web•de>
Subject: Re: Why does adding an existing repo as a submodule modify .git/config?
Date: Tue, 24 May 2011 21:06:52 -0400	[thread overview]
Message-ID: <4DDC562C.2000204@gmail.com> (raw)
In-Reply-To: <4DDB58D9.2090701@cdwilson.us>

On 05/24/2011 03:06 AM, Christopher Wilson wrote:
>>
>> Mark
>
>
> Q: Can you elaborate on why a 2 step "git submodule add" + "git
> submodule init" wasn't sufficient?  What is the reason for adding this
> functionality into the "git submodule add" command, when "git submodule
> init" does the same job?
>

git-submodule.sh has evolved considerably over the last couple of years, 
and the behaviour of submodule-init on an already existing module may 
well be different.

However, while you could then change submodule-add to not register the 
submodule, you would now have the condition of having a submodule that 
is checked out in the current tree but *not* registered in .git/config. 
This is the key: .git/config is modified to include all submodules that 
are checked out in your current tree. If you add a remote submodule, 
that submodule is not checked out in your current tree so no entry is 
created in .git/config, while adding one that is already checked out in 
place does modify .git/config. I see no inconsistency here.

Mark

  reply	other threads:[~2011-05-25  1:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-22 20:02 Why does adding an existing repo as a submodule modify .git/config? Christopher Wilson
2011-05-23 18:43 ` Jens Lehmann
2011-05-24  1:19   ` Mark Levedahl
2011-05-24  7:06     ` Christopher Wilson
2011-05-25  1:06       ` Mark Levedahl [this message]
2011-05-25  3:11         ` Christopher Wilson
2011-05-26 21:35           ` Jens Lehmann

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=4DDC562C.2000204@gmail.com \
    --to=mlevedahl@gmail$(echo .)com \
    --cc=Jens.Lehmann@web$(echo .)de \
    --cc=cwilson@cdwilson$(echo .)us \
    --cc=git@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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