git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Stefan Beller <sbeller@google.com>
Cc: git@vger.kernel.org
Subject: Re: [RFC PATCH 0/3] submodules with no working tree shall unset core.worktree
Date: Wed, 13 Jun 2018 11:00:19 -0700	[thread overview]
Message-ID: <xmqq7en27ej0.fsf@gitster-ct.c.googlers.com> (raw)
In-Reply-To: <20180612235825.12271-1-sbeller@google.com> (Stefan Beller's message of "Tue, 12 Jun 2018 16:58:22 -0700")

Stefan Beller <sbeller@google.com> writes:

> The first patch teaches checkout/reset (with --recurse-submodules) to unset
> the core.worktree config when the new state of the superprojects working tree
> doesn't contain the submodules working tree.

Are there two cases of "doesn't contain working tree of a submodule"?

The superproject's commit may not have a gitlink to a specific
submodule in its tree (i.e. there is no way to even "submodule init"
with such a commit in the superproject's history).  Or there may be
a gitlink but the user chose not to check it out in the working
tree.

Do they need to be treated differently, or can they be treated the
same way?

Also, is the "submodule" feature supposed to play well with multiple
worktree feature?  Let's imagine that you have two worktrees for a
single superproject, and the branches of the superproject these two
worktrees check out are different ones (which is the more sensible
set-up than checking out the same branch twice).  Further imagine
that the superproject started using a single submodule sometime in
the past and keeps using it throughout its life since then.

 1. if both of these two branches have the submodule, and two
    worktrees both are interested in having the submodule checked
    out via "submodule init/update", where does core.worktree point
    at?  Do we have two copies of the variable?

 2. what if one branch predates the use of the submodule in the
    superproject while the other branch is newer and uses the
    submodule?  Where does core.worktree point at?

Thanks.

> The last patch is teaching "git submodule deinit" to unset the core.worktree
> setting as well. It turned out this one is tricky, as for that we also
> have to set it in the counter part, such as "submodule update".
>
> Thanks,
> Stefan
>
> Stefan Beller (3):
>   submodule: unset core.worktree if no working tree is present
>   submodule: ensure core.worktree is set after update
>   submodule deinit: unset core.worktree
>
>  builtin/submodule--helper.c | 26 ++++++++++++++++++++++++++
>  git-submodule.sh            |  5 +++++
>  submodule.c                 | 14 ++++++++++++++
>  submodule.h                 |  2 ++
>  t/lib-submodule-update.sh   |  5 +++--
>  t/t7400-submodule-basic.sh  |  5 +++++
>  6 files changed, 55 insertions(+), 2 deletions(-)

  parent reply	other threads:[~2018-06-13 18:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-12 23:58 [RFC PATCH 0/3] submodules with no working tree shall unset core.worktree Stefan Beller
2018-06-12 23:58 ` [PATCH 1/3] submodule: unset core.worktree if no working tree is present Stefan Beller
2018-06-12 23:58 ` [PATCH 2/3] submodule: ensure core.worktree is set after update Stefan Beller
2018-06-16 20:26   ` SZEDER Gábor
2018-06-12 23:58 ` [PATCH 3/3] submodule deinit: unset core.worktree Stefan Beller
2018-06-13 18:00 ` Junio C Hamano [this message]
2018-06-13 18:52   ` [RFC PATCH 0/3] submodules with no working tree shall " Stefan Beller
2018-06-19  0:06 ` [PATCH " Stefan Beller
2018-06-19  0:06   ` [PATCH 1/3] submodule: unset core.worktree if no working tree is present Stefan Beller
2018-06-19  0:06   ` [PATCH 2/3] submodule: ensure core.worktree is set after update Stefan Beller
2018-06-19  0:06   ` [PATCH 3/3] submodule deinit: unset core.worktree Stefan Beller

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=xmqq7en27ej0.fsf@gitster-ct.c.googlers.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=sbeller@google.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.
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).