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

Re: [PATCH] builtin/describe.c: ignore untracked changes in submodules

From
Brandon Casey <drafnel@gmail.com>
Date
Sep 12, 2010, 19:10 UTC
Message-ID
<AANLkTinMf-_vk2-gRazf-8FNykZoNbVwmu_+c+5ht8rY@mail.gmail.com>
In-Reply-To
<1094265482.7527324.1284144028114.JavaMail.fmail@mwmweb047>
On Fri, Sep 10, 2010 at 1:40 PM, Jens Lehmann <Jens.Lehmann@web.de> wrote:
Show 24 quoted lines
>>Brandon Casey <casey@nrlssc.navy.mil> writes:
>>
>>> From: Brandon Casey <drafnel@gmail.com>
>>>
>>> Since 'git describe' does not append -dirty to the version string it
>>> produces when untracked files exist in the working directory of the main
>>> repository, it should not do so for submodules either.
>>>
>>> Add --ignore-submodules=untracked to the call to diff-index which is used
>>> to decide whether or not the '-dirty' string is necessary.
>>>
>>> Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil>
>>> ---
>>
>>Hmm, this changes the behaviour in a big way but it probably is for the
>>better.  At least it is consistent with the recent fixes to the
>>interaction between diff and submodules.
>
> Hmm, by default the diff family considers submodules with untracked files as
> dirty unless configured otherwise (and AFAICS the recent fixes to the interaction
> between diff and submodule were options to configure your own default).
>
> So when git status tells you the subodule is modified, e.g. because of an untracked
> file, I would expect git describe to add '-dirty' to its output when requested.

Triple hmm. Perhaps a deeper level change is necessary than what I originally thought.

It appears to me now, that the behavior of the entire diff family is inconsistent with respect to how untracked content is handled at the super-project level and at the submodule level.

At the super-project level, git only considers as 'modified', changes to _tracked_ content. Any untracked content is ignored by git-describe, git-diff, and friends, and git-status places it in its own 'Untracked files' section.

At the submodule level, all files, tracked and untracked, are considered.
Show 7 quoted lines
> To get rid
> of that I would expect you either fix the .gitignore of the submodule or configure that
> you don't care about untracked files in submodules at all (either only for this
> submodule or in the config).
>
> So if I didn't misunderstand something here I would rather vote against this change,
> git describe should append a '-dirty' when git status would show modifications, no?

Do you agree that there is an inconsistency between how untracked content is treated at the super-project level and at the submodule level? Any thoughts about how the behavior should be made to be consistent?

Perhaps the default setting of submodule.<name>.ignore should be 'untracked'?
-Brandon
Previous: Jens LehmannNext: Jens Lehmann
Message 4 of 14 in “builtin/describe.c: ignore untracked changes in submodules”
  1. builtin/describe.c: ignore untracked changes in submodulesBrandon Casey, Sep 9, 2010
  2. Junio C HamanoSep 10, 2010
  3. Jens LehmannSep 10, 2010
  4. Brandon CaseySep 12, 2010
  5. Jens LehmannSep 13, 2010
  6. yj2133011Sep 12, 2010
  7. Jens LehmannSep 11, 2010
  8. Junio C HamanoSep 11, 2010
  9. Jens LehmannSep 11, 2010
  10. Junio C HamanoSep 12, 2010
  11. Junio C HamanoSep 12, 2010
  12. Jens LehmannSep 13, 2010
  13. Junio C HamanoSep 13, 2010
  14. Jens LehmannSep 14, 2010

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.