All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jens Lehmann <Jens.Lehmann@web.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, "Michał Górny" <mgorny@gentoo.org>,
	"Phil Hord" <phil.hord@gmail.com>,
	"Heiko Voigt" <hvoigt@hvoigt.net>
Subject: Re: [RFC PATCH 1/2] rm: don't fail when removing populated submodules
Date: Fri, 17 Aug 2012 18:44:40 +0200	[thread overview]
Message-ID: <502E74F8.4070209@web.de> (raw)
In-Reply-To: <7vmx1uzekb.fsf@alter.siamese.dyndns.org>

Am 16.08.2012 23:56, schrieb Junio C Hamano:
> Jens Lehmann <Jens.Lehmann@web.de> writes:
> 
>> Am 09.07.2012 21:38, schrieb Junio C Hamano:
>>> Jens Lehmann <Jens.Lehmann@web.de> writes:
>>>
>>>> Cool, so let's drop this patch and I'll teach "rm" to handle
>>>> populated submodules according to what we do for regular files:
>>>> Make sure there are no modifications which could get lost (unless
>>>> "-f") and remove all tracked files and the gitfile from the work
>>>> tree (unless "--cached") before removing the submodule from the
>>>> index. If the submodule uses the old layout with the .git
>>>> directory instead of a gitfile we error out just like we do today.
>>>
>>> Alternatively we could "mv" .git directory out of the way and the
>>> next "git checkout" of a branch that still has the submodule can
>>> make a gitfile to point there, no?
>>
>> Yup. That would mean a smooth transition for legacy .git-dir
>> submodules into the new gitfile world.
>>
>>>> And we didn't talk about untracked or ignored files which may live
>>>> inside the submodules work tree so far, but according to what a
>>>> "rm -r" does in the superproject they should still be around after
>>>> using "rm" on a populated submodule, right?
>>>
>>> Until we add the "precious" class, untracked and ignored files are
>>> expendable, so if a submodule working tree has no modification and
>>> only has leftover *.o files, they can be nuked as part of submodule
>>> removal, but if it has an untracked and unignored *.c file for
>>> example, the "rm" operation without "-f" should be stopped, no?
>>
>> Ok, untracked files mark the submodule modified while ignored files
>> which are not tracked won't.
>>
>> Thanks for this discussion, I'll start hacking on that.
> 
> A mild ping on seemingly stalled topic.

I'm almost there. The only thing left is to check if a nested
submodule is using a git directory. In that case I expect "rm" to
fail even when -f is used to protect the submodule's history. I
still need to find a suitable command for recursing the submodules
and doing that check.

  reply	other threads:[~2012-08-17 16:44 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-04 20:43 [RFC PATCH 0/2] Teach rm to better handle submodules Jens Lehmann
2012-07-04 20:44 ` [RFC PATCH 1/2] rm: don't fail when removing populated submodules Jens Lehmann
2012-07-06  6:57   ` Junio C Hamano
2012-07-07 12:51     ` Jens Lehmann
2012-07-08  7:32       ` Junio C Hamano
2012-07-08 15:08         ` Jens Lehmann
2012-07-09  2:17           ` Junio C Hamano
2012-07-09  5:02             ` Junio C Hamano
2012-07-09 18:33             ` Jens Lehmann
2012-07-09 19:38               ` Junio C Hamano
2012-07-09 20:23                 ` Jens Lehmann
2012-08-16 21:56                   ` Junio C Hamano
2012-08-17 16:44                     ` Jens Lehmann [this message]
2012-08-17 18:11                       ` Phil Hord
2012-08-19 19:38                         ` Jens Lehmann
2012-07-04 20:44 ` [RFC PATCH 2/2] rm: remove submodules from the index and the .gitmodules file Jens Lehmann
2012-07-05  0:44 ` [RFC PATCH 0/2] Teach rm to better handle submodules Junio C Hamano
2012-07-05 19:06   ` Jens Lehmann
2012-07-05 22:10     ` 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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=502E74F8.4070209@web.de \
    --to=jens.lehmann@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=hvoigt@hvoigt.net \
    --cc=mgorny@gentoo.org \
    --cc=phil.hord@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.