From: Junio C Hamano <gitster@pobox.com>
To: "Kalyan Sriram" <kalyan@coderkalyan.com>
Cc: "Matheus Tavares" <matheus.bernardino@usp.br>,
"brian m. carlson" <sandals@crustytoothpaste.net>,
"git" <git@vger.kernel.org>
Subject: Re: Git submodule remove
Date: Fri, 22 Oct 2021 15:02:54 -0700 [thread overview]
Message-ID: <xmqq4k98en01.fsf@gitster.g> (raw)
In-Reply-To: <0101017ca60e5ffd-9563fafd-86f6-443d-9cbe-e07203caacba-000000@us-west-2.amazonses.com> (Kalyan Sriram's message of "Fri, 22 Oct 2021 03:32:12 +0000")
"Kalyan Sriram" <kalyan@coderkalyan.com> writes:
> "git rm" deletes the submodule directory completely and modifies
> .gitmodules, effectively removing the submodule. However, it leaves the
> entry in .git/config dangling, which is annoying.
The entry is not dangling. It is there to be used when you go back
in history.
> "git submodule deinit" (which I didn't know existed until I just read the man
> page) deletes all contents of submodule directory, but leaves the
> (empty) submodule directory itself intact. It DOES delete the entry in
> .git/config, but leaves a dangling entry in .gitmodules, so the next
> "git submodule update --init --recursive" registers and populates the
> submodule again.
"deinit" is *not* about remove a submodule. A project can be
checked out and used with or without its submodules instantiated,
and "git submodule init" is a way to instantiate it. "deinit" is
its opposite. As far as the history (which has already been
recorded in the repository, and the history that will be recorded
in the repository starting from that state) is concerned, the
submodule is there---it's just that you are not interested in it and
chose not to check it out.
So "git rm" seems to be doing exactly what "git submodule rm" should
be doing, nothing more, nothing less.
next prev parent reply other threads:[~2021-10-22 22:03 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-21 17:25 Git submodule remove Kalyan Sriram
2021-10-21 21:36 ` brian m. carlson
2021-10-21 22:47 ` Junio C Hamano
2021-10-21 23:25 ` Matheus Tavares
2021-10-21 23:35 ` Junio C Hamano
2021-10-22 3:32 ` Kalyan Sriram
2021-10-22 22:02 ` Junio C Hamano [this message]
2021-10-24 20:33 ` Kalyan Sriram
2021-10-24 20:46 ` Junio C Hamano
2021-10-22 12:12 ` Ævar Arnfjörð Bjarmason
2021-10-22 21:32 ` Junio C Hamano
2021-10-22 13:47 ` Randall S. Becker
2021-10-22 17:52 ` Kalyan Sriram
2021-10-22 20:45 ` Randall S. Becker
2021-10-22 21:17 ` Junio C Hamano
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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=xmqq4k98en01.fsf@gitster.g \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=kalyan@coderkalyan.com \
--cc=matheus.bernardino@usp.br \
--cc=sandals@crustytoothpaste.net \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).