git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Re: Re: What's cooking in git.git (May 2013, #09; Wed, 29)

From
John Keeping <john@keeping.me.uk>
Date
Jun 5, 2013, 08:19 UTC
Message-ID
<20130605081901.GQ1072@serenity.lan>
In-Reply-To
<CABURp0qPt8S4WWhjb22qEJwnUOoT7SFr9=cZBv3Syp-uEX-ycg@mail.gmail.com>
On Tue, Jun 04, 2013 at 06:57:34PM -0400, Phil Hord wrote:
Show 51 quoted lines
> On Tue, Jun 4, 2013 at 8:48 AM, John Keeping <john@keeping.me.uk> wrote:
> > The problem is that sometimes you do want to adjust the path and
> > sometimes you don't.  Reading git-submodule(1), it says:
> >
> >      This may be either an absolute URL, or (if it begins with ./ or
> >      ../), the location relative to the superproject’s origin
> >      repository.
> >      [snip]
> >      If the superproject doesn’t have an origin configured the
> >      superproject is its own authoritative upstream and the current
> >      working directory is used instead.
> >
> > So I think it's quite reasonable to have a server layout that looks like
> > this:
> >
> >     project
> >     |- libs
> >     |  |- libA
> >     |  `- libB
> >     |- core.git
> >
> > and with only core.git on your local system do:
> >
> >     cd core/libs
> >     git submodule add ../libs/libB
> >
> > expecting that to point to libB.  But if we adjust the path then the
> > user has to do:
> >
> >     git submodule add ../../libs/libB
> >
> > However, it is also perfectly reasonable to have no remote configured
> > and the library next to the repository itself.  In which case we do want
> > to specify the additional "../" so that shell completion works in the
> > natural way.
> 
> In submodule add, the leading '../' prefix on the repository url has
> always meant that the url is relative to the url of the current repo.
> The given repo-url is precisely what ends up in .gitmodules'
> submodule.$name.url.  It works this way whether there is a remote
> configured or not.
> 
> It does seem like we need to be cautious around this change.
> 
> > The only way I can see to resolve the ambiguity is to die when we hit
> > this particular case.  This should be acceptable because people
> > shouldn't be adding new submodules anywhere near as often as they
> > perform other submodule operations and it doesn't affect absolute URLs.
> 
> I don't think I like that.  But I don't know if I like anything I
> dreamed up, either.

I've decided that I will make it die (unless anyone comes up with an obviously correct solution before I get around to sending the reroll) because it's a lot easier to loosen that in the future than to change it if we get the behaviour wrong now. I don't want to hold every other subcommand hostage to this one case.

Previous: Phil HordNext: Øystein Walle
Message 22 of 23 in “What's cooking in git.git (May 2013, #09; Wed, 29)”
  1. Junio C HamanoMay 29, 2013
  2. Thomas RastMay 30, 2013
  3. Ramkumar RamachandraMay 30, 2013
  4. Junio C HamanoJun 2, 2013
  5. Jens LehmannMay 30, 2013
  6. Junio C HamanoJun 2, 2013
  7. Jens LehmannJun 3, 2013
  8. Junio C HamanoJul 1, 2013
  9. Jens LehmannMay 30, 2013
  10. John KeepingMay 31, 2013
  11. John KeepingJun 3, 2013
  12. Junio C HamanoJun 3, 2013
  13. Jens LehmannJun 3, 2013
  14. John KeepingJun 3, 2013
  15. Heiko VoigtJun 4, 2013
  16. John KeepingJun 4, 2013
  17. Heiko VoigtJun 4, 2013
  18. John KeepingJun 4, 2013
  19. Jens LehmannJun 4, 2013
  20. John KeepingJun 4, 2013
  21. Phil HordJun 4, 2013
  22. John KeepingJun 5, 2013
  23. Øystein WalleMay 31, 2013

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.