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: Heiko Voigt <hvoigt@hvoigt.net>, Adam Spiers <git@adamspiers.org>,
	Git Mailing List <git@vger.kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH] update-index: allow overwriting existing submodule index entries
Date: Mon, 11 Jun 2012 23:23:15 +0200	[thread overview]
Message-ID: <4FD661C3.7000105@web.de> (raw)
In-Reply-To: <7v3961ao1q.fsf@alter.siamese.dyndns.org>

Am 11.06.2012 17:03, schrieb Junio C Hamano:
> Heiko Voigt <hvoigt@hvoigt.net> writes:
> 
>> In commit e01105 Linus introduced gitlinks to update-index. He explains
>> that he thinks it is not the right thing to replace a gitlink with
>> something else.
>>
>> That commit is from the very first beginnings of submodule support.
>> Since then we have gotten a lot closer to being able to remove a
>> submodule without losing its history. This check prevents such a use
>> case, so I think this assumption has changed.
> 
> Yeah, I think we should remove it if only to make it consistent with
> "add" (if anything, the Porcelain level "add" should be the one that
> is more strict and the plumbing level should be able to let you
> shoot in the foot, not the other way around), but we need to make
> sure "closer to" becomes reality. Can we remove and the resurrect
> automatically when checking out a branch with a submodule when you
> are on a branch with a directory and vice versa?

Even while I suspect most of the time a submodule <=> directory
transition will occur (moving directory content into a submodule
or vice versa; and then there will be no replacement of a gitlink
with something else as only the files inside the directory will be
recorded) there is no reason why submodule <=> file or submodule
<=> link transitions shouldn't work just fine. So yes, we can ;-)
(See the recursive_submodule_checkout branch in my GitHub repo for
current state of affairs, even though not all transitions work yet
some do just fine)

If you want I can keep this patch in my GitHub repo until "closer
to" becomes reality. Me too thinks that plumbing should not enforce
this restriction, but I wouldn't mind to hold this patch back until
then.

  reply	other threads:[~2012-06-11 21:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-01 10:31 Bug in git citool when staging symlink as replacement for submodule Adam Spiers
2012-06-09 13:47 ` [PATCH] git-gui: recognize submodule diff when replaced by file Heiko Voigt
2012-06-09 14:27 ` [PATCH] update-index: allow overwriting existing submodule index entries Heiko Voigt
2012-06-11 15:03   ` Junio C Hamano
2012-06-11 21:23     ` Jens Lehmann [this message]
2012-06-12 20:33       ` Heiko Voigt
2012-06-12 21:18         ` 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=4FD661C3.7000105@web.de \
    --to=jens.lehmann@web.de \
    --cc=git@adamspiers.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=hvoigt@hvoigt.net \
    --cc=torvalds@linux-foundation.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 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.