git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jens Lehmann <Jens.Lehmann@web.de>
To: "W. Trevor King" <wking@tremily.us>
Cc: Git Mailing List <git@vger.kernel.org>,
	Junio C Hamano <gitster@pobox.com>,
	Jonathan Nieder p <jrnieder@gmail.com>, Jeff King <peff@peff.net>,
	Heiko Voigt <hvoigt@hvoigt.net>
Subject: Re: [RFC/PATCH 2/4] Submodules: Add the lib-submodule-update.sh test library
Date: Fri, 18 Apr 2014 14:31:05 +0200	[thread overview]
Message-ID: <53511B09.1010700@web.de> (raw)
In-Reply-To: <20140417215531.GY21805@odin.tremily.us>

Am 17.04.2014 23:55, schrieb W. Trevor King:
> On Thu, Apr 17, 2014 at 11:08:06PM +0200, Jens Lehmann wrote:
>> Am 17.04.2014 18:41, schrieb W. Trevor King:
>>> On Tue, Mar 25, 2014 at 06:05:05PM +0100, Jens Lehmann wrote:
>>>> *) When a submodule is replaced with a tracked file of the same name
>>>>    the submodule work tree including any local modifications (and
>>>>    even the whole history if it uses a .git directory instead of a
>>>>    gitfile!) is simply removed.
>>>> …
>>>> I think the first bug really needs to be fixed, as that behavior is
>>>> extremely nasty. We should always protect work tree modifications
>>>> (unless forced) and *never* remove a .git directory (even when
>>>> forced).
>>>
>>> I think this should be covered by the usual “don't allow checkouts
>>> from dirty workdirs unless the dirty-ing changes are easily applied to
>>> the target tree”.
>>
>> Nope, the target tree will be removed completely and everything in
>> it is silently nuked. It should be allowed with '-f', but only if
>> the submodule contains a gitfile, and never if it contains a .git
>> directory (which is just what we do for rm too).
> 
> I think it's not covered *now* because of a flaw in our “are dirty-ing
> changes easily applied to the target tree” detection logic, and the
> solution should involve updating that logic to hit on this case.

Yup.

>> b) recursive checkout is the place to consistently care about
>> submodule modifications (the submodule script doesn't do that and it
>> is impossible to change that without causing trouble to a lot of
>> users.
> 
> I agree that the submodule script is not the place for this, and the
> core checkout code is.  I'd like checkouts to always be recursive, and
> see --[no-]recurse-submodules as a finger-breaking stop-gap until we
> can complete that transition for checkout, bisect, merge, reset, and
> other work-tree altering commands.  I think this is one reason why
> some folks prefer the stiffer joints you get from a subtree approach.

We are definitely in the same boat here :-)

  reply	other threads:[~2014-04-18 12:31 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-25 17:03 [RFC/PATCH 0/4] Add submodule test harness Jens Lehmann
2014-03-25 17:04 ` [RFC/PATCH 1/4] test-lib: add test_dir_is_empty() Jens Lehmann
2014-03-25 20:49   ` Junio C Hamano
2014-03-25 21:06     ` David Kastrup
2014-03-26  8:29     ` Jens Lehmann
2014-03-26 10:43       ` Michael Haggerty
2014-03-26 19:22         ` Jens Lehmann
2014-03-25 17:05 ` [RFC/PATCH 2/4] Submodules: Add the lib-submodule-update.sh test library Jens Lehmann
2014-04-17 16:41   ` W. Trevor King
2014-04-17 19:23     ` Junio C Hamano
2014-04-17 21:30       ` Jens Lehmann
2014-04-18 12:39         ` Heiko Voigt
2014-04-17 21:08     ` Jens Lehmann
2014-04-17 21:55       ` W. Trevor King
2014-04-18 12:31         ` Jens Lehmann [this message]
2014-03-25 17:05 ` [RFC/PATCH 3/4] checkout: call the new submodule update test framework Jens Lehmann
2014-03-25 17:06 ` [RFC/PATCH 4/4] apply: add t4137 for submodule updates 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=53511B09.1010700@web.de \
    --to=jens.lehmann@web.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=hvoigt@hvoigt.net \
    --cc=jrnieder@gmail.com \
    --cc=peff@peff.net \
    --cc=wking@tremily.us \
    /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).