git submodule foreach --trait=is-active ...
git submodule foreach --trait=!is-active ...
git submodule foreach --trait=is-populated ...
to allow iterating only on submodules with/without given trait (I am
not suggesting the actual option name, but merely making sure that
'is-active' is not anything special but one of the possibilities
that can be used to limit the iteration using the same mechanism).
The idea that other candidate are possible seem good. But then users
will need combination like is-active && !is-populated. ...
... this would allow combination with the is active filter and the
previous example would be
git submodule--helper --is-active --is-populated=false <cmd>
There is no difference between that and
git submodule--helper --trait=is-active --trait=is-populated
so I fail to see what new you are proposing, sorry.
The difference is that you repeat twice the same flag. Sometime
repeating a flag overwrite the previous value, but it depend how it is
implemented. In current case it should be possible to implement it this
way, if this is required.
Regarding previous example, it use '!' to negate the value. Not all
people know the meaning of it. A new proposal would be:
git submodule--helper foreach [--trait=[not-](active|populated)]
What do you think?