git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Glen Choo <chooglen@google.com>
To: rsbecker@nexbridge.com, git@vger.kernel.org
Subject: RE: [RFC] Branches with --recurse-submodules
Date: Thu, 11 Nov 2021 10:12:37 -0800	[thread overview]
Message-ID: <kl6lbl2qv9wq.fsf@chooglen-macbookpro.roam.corp.google.com> (raw)
In-Reply-To: <000a01d7d671$1c7d4820$5577d860$@nexbridge.com>

<rsbecker@nexbridge.com> writes:

>> > 4. If working on the submodule, use a branch, not a commit - typically off
>> main.
>> 
>> With the proposed UX, step (4) would happen automatically when using
>> "branch --recurse-submodules". Users would get a safer and more
>> convenient default.
>
> I think this might be more reliably done using a switch in .gitconfig to enable the capabilities. Perhaps something like:
>
> submodule.fetch-branches=true

Correct me if I am wrong, but we might be suggesting different things
here. "submodule.fetch-branches" suggests to me that you're thinking of
submodule branches that track the remotes of the submodule. The proposed
UX is more about how we have submodule branches that work in tandem with
superproject branches.

A user who is only concerned about a single submodule can cd and make
their changes as if the submodule were a standalone repo - I think
that's pretty well-supported. The missing link being able to coordinate
this work with the superproject.

>> > What I could see as a possible improvement is to add the branch ref to the
>> submodule ref file - not replacing the commit but adding to it. I do worry that
>> there are unintended (unforeseen) side-effects that will result from this,
>> however, including potential merge conflicts. Two people working on the
>> same commit but different branches may mess the ref file, so not really a
>> good idea.
>> 
>> It's an interesting idea, but as you noted, it is quite thorny. I would also like to
>> see more information being captured by the superproject tree (instead of
>> just .gitmodules), but I'm also not sure how we might do that.
>
> I'm suggesting this instead of a command-line option because this seems more like a policy-based process that you would either always want or never want. I would not like to depend on a developer making the call each time a clone occurred. I'm sad to admit that I don't really know where to start on this enhancement, though, even if approved.

Agreed with regards to both points, i.e. using a config instead of CLI
option, and not knowing where to start..

  reply	other threads:[~2021-11-11 18:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-08 22:33 [RFC] Branches with --recurse-submodules Glen Choo
2021-11-10 18:21 ` Glen Choo
2021-11-10 18:35   ` rsbecker
2021-11-10 19:35     ` Glen Choo
2021-11-10 20:25       ` rsbecker
2021-11-11 18:12         ` Glen Choo [this message]
2021-11-12  3:22   ` Philippe Blain
2021-11-12  3:19 ` Philippe Blain
2021-11-15 19:03   ` Glen Choo
2021-11-23 18:36     ` Philippe Blain
2021-11-23 19:04       ` Glen Choo

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=kl6lbl2qv9wq.fsf@chooglen-macbookpro.roam.corp.google.com \
    --to=chooglen@google.com \
    --cc=git@vger.kernel.org \
    --cc=rsbecker@nexbridge.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).