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

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.

Previous: Francis Moreau
Message 5 of 5 in “Adding "--ignore-submodules" switch to git-describe”
  1. Francis MoreauMar 1, 2013
  2. Junio C HamanoMar 1, 2013
  3. Jens LehmannMar 1, 2013
  4. Francis MoreauMar 8, 2013
  5. Junio C HamanoMar 8, 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.