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

Re: [RFC/PATCH] add update to branch support for "floating submodules"

From
Phil Hord <phil.hord@gmail.com>
Date
Feb 6, 2012, 17:31 UTC
Message-ID
<CABURp0rt=LcjMfDU61m0de-gLpX1a3x3vhb0zVxCbceSvD9jFw@mail.gmail.com>
In-Reply-To
<4F29BEB7.1080901@web.de>
On Wed, Feb 1, 2012 at 5:37 PM, Jens Lehmann <Jens.Lehmann@web.de> wrote:
Show 21 quoted lines
> Am 31.01.2012 23:50, schrieb Phil Hord:
>> What I mean is that a developer may be completely focused on one
>> particular submodule (his domain).  He does his work in this module,
>> and when it's ready he commits and pushes to the server.  'git status'
>> shows him that his directory is clean.  But this is only because he
>> doesn't really know where the submodules top-directories are, so he
>> doesn't realize that he has changes in another submodule that he has
>> not committed.  He has to know to run 'git status' from somewhere in
>> the superproject (ostensibly in the root directory of that
>> superproject).  But he may forget since 'git status' already assured
>> him he was done.
> <snip>
>> I guess what would help here is something like the opposite of 'git
>> status' showing the status of descendant submodules;  it would help if
>> it showed the status of sibling submodules and the superproject as
>> well.
>
> Hmm, I really think the fact that submodules are unaware that they
> are part of a superproject is a feature. I'd prefer seeing that kind
> of problem being tackled by the CI server and/or user education. Or
> maybe a pre-commit hook which issues a warning in that case?

I agree that submodule isolation is a feature essential to the architecture of git and the submodules implementation. But it is also a limitation, not just of this example. A pre-commit hook is a nice idea, but it doesn't help 'git status' (which is the standard go-to answer point for "where am I").

This has me thinking more about recursing siblings now, though. I find
myself typing something like this quite a lot:
    git submodule foreach 'git grep "someFunction" || :'
Or worse (in that the UI is more unwieldy):
    git submodule foreach 'git log --oneline "-SsomeFunction" || :'
But what I want is this:
    git --git-dir=${TOP}/../.git grep --recurse-submodules "someFunction"
But not really, because I am lazy and that is too much typing.
    git grep --include-siblings "someFunction"
Maybe I can add a "sib" macro to get this:
    git sib grep "someFunction"

But now I've really wandered off-topic. Phil

Previous: Jens LehmannNext: Jens Lehmann
Message 24 of 27 in “add update to branch support for "floating submodules"”
  1. add update to branch support for "floating submodules"Heiko Voigt, Nov 9, 2011
  2. Junio C HamanoNov 9, 2011
  3. Heiko VoigtNov 29, 2011
  4. Leif GruenwoldtDec 10, 2011
  5. Jonathan NiederDec 10, 2011
  6. Junio C HamanoDec 10, 2011
  7. Leif GruenwoldtDec 10, 2011
  8. Andreas T.AuerDec 12, 2011
  9. Leif GruenwoldtDec 12, 2011
  10. Andreas T.AuerDec 12, 2011
  11. Leif GruenwoldtDec 12, 2011
  12. Jens LehmannDec 12, 2011
  13. Phil HordDec 12, 2011
  14. Marc BranchaudDec 13, 2011
  15. Jens LehmannDec 13, 2011
  16. Marc BranchaudDec 13, 2011
  17. Junio C HamanoDec 12, 2011
  18. Phil HordDec 13, 2011
  19. Jens LehmannDec 13, 2011
  20. Phil HordJan 30, 2012
  21. Jens LehmannJan 31, 2012
  22. Phil HordJan 31, 2012
  23. Jens LehmannFeb 1, 2012
  24. Phil HordFeb 6, 2012
  25. Jens LehmannFeb 6, 2012
  26. Brandon CaseyDec 13, 2011
  27. Gioele BarabucciDec 10, 2011

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.