git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: sj/untracked-files-in-submodule-directory-is-not-dirty, was Re: What's cooking in git.git (Oct 2020, #04; Tue, 27)
Date: Mon, 2 Nov 2020 02:58:26 +0100 (CET)	[thread overview]
Message-ID: <nycvar.QRO.7.76.6.2011020251520.18437@tvgsbejvaqbjf.bet> (raw)
In-Reply-To: <xmqqmu079rbv.fsf@gitster.c.googlers.com>

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

  parent reply	other threads:[~2020-11-02 12:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-27 23:33 What's cooking in git.git (Oct 2020, #04; Tue, 27) Junio C Hamano
2020-11-02  1:47 ` jc/sequencer-stopped-sha-simplify, was " Johannes Schindelin
2020-11-02 18:34   ` Junio C Hamano
2020-11-02 18:46     ` Jonathan Tan
2020-11-02 18:51       ` Junio C Hamano
2020-11-02  1:50 ` jk/committer-date-is-author-date-fix-simplify, " Johannes Schindelin
2020-11-02 18:57   ` Junio C Hamano
2020-11-02  1:58 ` Johannes Schindelin [this message]
2020-11-03  1:01   ` sj/untracked-files-in-submodule-directory-is-not-dirty, " Junio C Hamano
2020-11-02  2:37 ` ag/merge-strategies-in-c, " Johannes Schindelin
2020-11-02 21:36   ` Junio C Hamano
2020-11-02 22:31     ` Alban Gruin
2020-11-03  0:32       ` Junio C Hamano
2020-11-04 13:22     ` Johannes Schindelin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=nycvar.QRO.7.76.6.2011020251520.18437@tvgsbejvaqbjf.bet \
    --to=johannes.schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).