From: Jens Lehmann <Jens.Lehmann@web.de>
To: Ramkumar Ramachandra <artagnon@gmail.com>
Cc: Git List <git@vger.kernel.org>
Subject: Re: Why does 'submodule add' stage the relevant portions?
Date: Tue, 26 Mar 2013 17:57:30 +0100 [thread overview]
Message-ID: <5151D37A.6000708@web.de> (raw)
In-Reply-To: <CALkWK0mXOHGJHQ85mMuoUyzti6b2QoijN1EEFzpJ+TKm3tWnXg@mail.gmail.com>
Am 26.03.2013 08:57, schrieb Ramkumar Ramachandra:
> Jens Lehmann wrote:
>> And leaving aside 'add', there are tons of submodules out there
>> which were cloned with older Git who have their .git directory
>> inside the work tree. So a new subcommand (or at least a helper
>> script in contrib) to relocate the .git directory would really help
>> here to migrate these legacy submodules without users having to
>> worry about data loss.
>
> The question is: after using a "non-relocated submodule" for some
> time, will the user suddenly decide to make it a "relocated submodule"
> one day?
I think quite some users - and definitely myself - will do that as
soon as the full recursive checkout materialized, as that allows to
remove submodules without any directory remaining and even to replace
a submodule with a directory containing other files. And even with
current Git you already get a clean work tree when using "git rm" or
"git submodule deinit" (in current master) on a submodule iff it has
its .git directory stored in the .git directory of the superproject.
It is definitely not a Must Have right now, but I expect it to be
that in the near future.
>>> I meant a variant of add that would clone, but not stage. I was
>>> arguing for a new subcommand so that I don't have to touch 'submodule
>>> add', not for a rename.
>>
>> Ah, now I get it, I was confused by your reference to 'git submodule
>> add <repository> <path>'. I have to admit I still don't understand
>> the use case you have for adding a submodule without staging it, but
>> maybe it is just too late here.
>
> I usually reset after running 'git submodule add', because I rarely
> commit the added submodule immediately after adding it.
I'm not sure many submodule users do the same, but even then the
normal ways of unstaging the submodule and .gitmodules should be
sufficient here, no? I'd rather avoid adding a new command to git
submodule for that.
next prev parent reply other threads:[~2013-03-26 16:58 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-24 17:38 Why does 'submodule add' stage the relevant portions? Ramkumar Ramachandra
2013-03-25 8:35 ` Jens Lehmann
2013-03-25 8:59 ` Ramkumar Ramachandra
2013-03-25 18:43 ` Jens Lehmann
2013-03-25 19:57 ` Ramkumar Ramachandra
2013-03-25 22:57 ` Jens Lehmann
2013-03-26 7:57 ` Ramkumar Ramachandra
2013-03-26 16:57 ` Jens Lehmann [this message]
2013-03-25 17:51 ` Junio C Hamano
2013-03-25 18:02 ` Ramkumar Ramachandra
2013-03-25 18:20 ` Jonathan Nieder
2013-03-25 18:27 ` Ramkumar Ramachandra
2013-03-25 18:31 ` Junio C Hamano
2013-03-25 18:48 ` Ramkumar Ramachandra
2013-03-25 18:50 ` Jonathan Nieder
2013-03-25 19:06 ` Ramkumar Ramachandra
2013-03-25 19:13 ` Jonathan Nieder
2013-03-26 3:27 ` Duy Nguyen
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=5151D37A.6000708@web.de \
--to=jens.lehmann@web.de \
--cc=artagnon@gmail.com \
--cc=git@vger.kernel.org \
/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).