git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michał Górny" <mgorny@gentoo.org>
To: Jens Lehmann <Jens.Lehmann@web.de>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 2/2] git-submodule: support 'rm' command.
Date: Thu, 28 Jun 2012 22:31:06 +0200	[thread overview]
Message-ID: <20120628223106.5bc9735e@pomiocik.lan> (raw)
In-Reply-To: <4FE898BC.2020307@web.de>

[-- Attachment #1: Type: text/plain, Size: 2664 bytes --]

On Mon, 25 Jun 2012 18:58:36 +0200
Jens Lehmann <Jens.Lehmann@web.de> wrote:

> Am 25.06.2012 12:57, schrieb Michał Górny:
> > Add an 'rm' command to git-submodule which provides means to
> > (semi-)easily remove git submodules.
> > 
> > Signed-off-by: Michał Górny <mgorny@gentoo.org>
> > ---
> > Right now, it requires the submodule checkout to be removed manually
> > first (so it does not remove unstaged commits), and just removes
> > the index entry and module information from config.
> > 
> > I based it on 'cmd_add' code trying to preserve the original coding
> > standards.
> 
> I really like the goal of this patch but would prefer that "git rm"
> learns how to remove submodules instead of adding more code to the
> git-submodule.sh script.

My main intent was, like Phil already pointed out, to provide
a counterpart to 'git submodule add'. I don't mind 'git rm' supporting
removing submodules but that's not exactly what I would consider...
friendly?

What I'm trying to express is that if I added a submodule using 'git
submodule add', I would expect to have 'git submodule rm'. Honestly, I
didn't even think about trying using 'git rm' on a submodule.
The correct results of such a call are hard to predict to me.

> Also it shouldn't be necessary for the user to remove the directory
> by hand before running "git rm". At least all files recorded in the
> submodule can be removed (and if the submodule uses a gitfile that
> can be removed too). Then all that is left are untracked files the
> user has to decide what to do with (which might be removed too when
> running "git rm --recurse-submodules=untracked").

Except for the untracked files there may also be commits which were not
pushed anywhere. Honestly, I didn't want to get into that risky area in
the first patch.

As the next step, I'd see adding a '--force' option to actually enforce
removing the directory. But I'd like the basics to start working first,
then consider harder things.

> > ++
> > +This command removes the submodule from the current git index,
> > +the .gitmodules file and the local repository config.
> 
> It should not be removed from .git/config by default. The user may
> have special settings there and the presence in .git/config shows
> he cared about having the submodule checked out, which should not
> be revoked by just removing the submodule from the work tree.
> Unless he removes the config from there himself he should get back
> a populated submodule when he checks out an earlier commit and says
> "git submodule update".

Ok, I will change that.

-- 
Best regards,
Michał Górny

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 316 bytes --]

      parent reply	other threads:[~2012-06-28 20:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-25 10:56 [PATCH 1/2] git-submodule.sh: fix filename in comment Michał Górny
2012-06-25 10:57 ` [PATCH 2/2] git-submodule: support 'rm' command Michał Górny
2012-06-25 16:58   ` Jens Lehmann
2012-06-25 20:53     ` Phil Hord
2012-06-25 21:09       ` Jens Lehmann
2012-06-26 19:12         ` Phil Hord
2012-06-26 19:59           ` Jens Lehmann
2012-06-27 18:48             ` Phil Hord
2012-06-28 20:31     ` Michał Górny [this message]

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=20120628223106.5bc9735e@pomiocik.lan \
    --to=mgorny@gentoo.org \
    --cc=Jens.Lehmann@web.de \
    --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).