archive mirror
 help / color / mirror / Atom feed
From: Denton Liu <>
To: Junio C Hamano <>
Cc: Git Mailing List <>, Danh Doan <>
Subject: Re: [PATCH v3] submodule: teach set-url subcommand
Date: Wed, 30 Oct 2019 10:58:17 -0700	[thread overview]
Message-ID: <20191030175817.GA5120@generichostname> (raw)
In-Reply-To: <>

Hi Junio,

On Wed, Oct 30, 2019 at 02:54:58PM +0900, Junio C Hamano wrote:
> Denton Liu <> writes:
> > Currently, in the event that a submodule's upstream URL changes, users
> > have to manually alter the URL in the .gitmodules file then run
> > `git submodule sync`. Let's make that process easier.
> Right now, submodule.<name>.url might be the only thing that gets
> synched down to .git/config of the submodule; we may not learn any
> more things that needs "edit in .gitmodules and then run sync".  Can
> we sately say that "sync" is now obsolete and what it has been used
> for can now be done with "set-url"?  In other words, does "set-url"
> makes "sync" unnecessary and deprecated?

"sync" isn't deprecated quite yet. If upstream edits the .gitmodules and
we pull in the change, then we still need to run "sync" to update our

> Or is it expected that we would learn more things end users can edit
> in .gitmodules and run sync to propagate necessary pieces of
> information down?  If so, do we want to add an extra command like
> set-url for each of these new things, or do we tell users "if you
> are editing url, use set-url, otherwise edit .gitmodules and run
> sync"?  If the former, that would make the set of subcommands quite
> noisy, and if the latter, the users need to learn two things,
> i.e. it is not making it easier but harder to learn the system.

I was running under the assumption that we weren't planning on adding
new information to .gitmodules. I don't think we'll be making changes to
the submodule file format without careful thought so _if_ that ever
comes up, we should discuss it then but I don't think it's a discussion
that's going to happen any time soon, if ever.

Either way, though, the sync workflow isn't going away so users still
need to know how to do that (unfortunately). We'll just add a
convenience function on top to make people's lives easier but it's not
strictly _necessary_ to use "set-url".

> There is nothing _wrong_ to introduce the new subcommand per-se, but
> given that the URL should not change that often, and due to above
> concerns, I am not sure if I want to back this change.

I think it changes often enough to cause problems. Seems like at least
936 people on StackOverflow agree with me[1].

I think that the problem is that it's a common enough use-case but not
common enough that people often forget to "sync" after editing the
.gitmodules. I know that it's bitten me the few times I've done this and
I've had to go back to that SO post each time.


  reply	other threads:[~2019-10-30 17:58 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-17 20:03 [PATCH] " Denton Liu
2019-10-29  8:34 ` [PATCH v2] " Denton Liu
2019-10-29  9:15   ` Danh Doan
2019-10-29 17:01   ` [PATCH v3] " Denton Liu
2019-10-30  5:54     ` Junio C Hamano
2019-10-30 17:58       ` Denton Liu [this message]
2019-11-02  4:25         ` 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:

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

  git send-email \
    --in-reply-to=20191030175817.GA5120@generichostname \ \ \ \ \
    --subject='Re: [PATCH v3] submodule: teach set-url subcommand' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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).