Re: Adding "--ignore-submodules" switch to git-describe
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 8, 2013, 21:26 UTC
- Message-ID
- <7vy5dxfuqq.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <CAC9WiBhHmqn7QZMLFcLjqGPamHmbMFNxvQ6Yzv5dr=+fe+F3_g@mail.gmail.com>
Francis Moreau <francis.moro@gmail.com> writes:
Show 7 quoted lines
>> But when we ignore untracked paths in the superproject, we should >> ignore untracked paths in submodule working trees consistently. > > yes I agree. > > But in the short term, could you suggest a method to workaround this > inconsistency ?
Hrm, ... didn't I already?
As we do not take untracked content at the superproject level into
account when deciding "--dirty"-ness, I think it is very sensible to
either do one of the following:(1) always ignore untracked files in submodule working trees; or
(2) if we were to introduce some form of --ignore-submodules,
ignore untracked files in the superproject working tree when we
use that mechanism to ignore untracked files in submodule
working trees.Strictly speaking, (1) is a degenerate case of (2).
...
I think what is missing from "--dirty" is not "--ignore-submodules",
but "--do-not-ignore-untracked" option [*1*]. "describe --dirty"
ignores untracked files in the superproject by default, and we
should ignore untracked files in submodule working trees, but the
current code does not. Fixing that is (1) above.I think the right first step without any new option is to make "describe --dirty" to ignore the dirtiness in submodules coming solely from having untracked files in submodules' working trees.
You could later add --having-untracked-is-dirty option to mark the output dirty when there is an untracked file in submodules' working trees or the toplevel working tree, which would be the second step.