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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Junio,

On Tue, 27 Oct 2020, Junio C Hamano wrote:

> * 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




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux