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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Feb 1, 2012 at 5:37 PM, Jens Lehmann <Jens.Lehmann@xxxxxx> wrote:
> 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
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]