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

sj/untracked-files-in-submodule-directory-is-not-dirty, was Re: What's cooking in git.git (Oct 2020, #04; Tue, 27)

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Nov 2, 2020, 01:58 UTC
Message-ID
<nycvar.QRO.7.76.6.2011020251520.18437@tvgsbejvaqbjf.bet>
In-Reply-To
<xmqqmu079rbv.fsf@gitster.c.googlers.com>
Hi Junio,
On Tue, 27 Oct 2020, Junio C Hamano wrote:
Show 10 quoted lines
> * sj/untracked-files-in-submodule-directory-is-not-dirty (2020-10-26) 1 commit
>  - diff: do not show submodule with untracked files as "-dirty"
>
>  "git diff" showed a submodule working tree with untracked cruft as
>  "Submodule commit <objectname>-dirty", but a natural expectation is
>  that the "-dirty" indicator would align with "git describe --dirty",
>  which does not consider having untracked files in the working tree
>  as source of dirtiness.  The inconsistency has been fixed.
>
>  Needs doc update.

I *think* the original rationale for marking submodules with untracked (_un-ignored_) files was to avoid deleting a submodule that has uncommitted (because untracked) files.

This is just a fall-out of the submodule design where it pretends that submodules are files, but files only have a handful "aggregate states": they are either ignored, untracked, up to date or dirty. Whereas submodule can be all of the above, pretty much at the same time.

This patch affects e.g. if some script wants to determine whether a submodule can be deleted safely and uses `git diff` to do so. With this patch, it is possible to lose data irretrievably.

Ciao, Dscho

Previous: Junio C HamanoNext: Junio C Hamano
Message 8 of 14 in “What's cooking in git.git (Oct 2020, #04; Tue, 27)”
  1. Junio C HamanoOct 27, 2020
  2. jc/sequencer-stopped-sha-simplify, was Re: What's cooking in git.git (Oct 2020, #04; Tue, 27)Johannes Schindelin, Nov 2, 2020
  3. Junio C HamanoNov 2, 2020
  4. Jonathan TanNov 2, 2020
  5. Junio C HamanoNov 2, 2020
  6. jk/committer-date-is-author-date-fix-simplify, was Re: What's cooking in git.git (Oct 2020, #04; Tue, 27)Johannes Schindelin, Nov 2, 2020
  7. Junio C HamanoNov 2, 2020
  8. sj/untracked-files-in-submodule-directory-is-not-dirty, was Re: What's cooking in git.git (Oct 2020, #04; Tue, 27)Johannes Schindelin, Nov 2, 2020
  9. Junio C HamanoNov 3, 2020
  10. ag/merge-strategies-in-c, was Re: What's cooking in git.git (Oct 2020, #04; Tue, 27)Johannes Schindelin, Nov 2, 2020
  11. Junio C HamanoNov 2, 2020
  12. Alban GruinNov 2, 2020
  13. Junio C HamanoNov 3, 2020
  14. Johannes SchindelinNov 4, 2020

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.