git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Johannes Sixt <j.sixt@viscovery.net>
Cc: Ping Yin <pkufranky@gmail.com>, Git Mailing List <git@vger.kernel.org>
Subject: Re: [regression?] "git status -a" reports modified for empty   submodule directory
Date: Wed, 30 Apr 2008 00:29:50 -0700	[thread overview]
Message-ID: <7vej8n3imp.fsf@gitster.siamese.dyndns.org> (raw)
In-Reply-To: <4818143C.6050206@viscovery.net> (Johannes Sixt's message of "Wed, 30 Apr 2008 08:39:56 +0200")

Johannes Sixt <j.sixt@viscovery.net> writes:

> Junio C Hamano schrieb:
>> "Ping Yin" <pkufranky@gmail.com> writes:
>> 
>>> In the super project super with empty submodule directory sub
>>> $ git diff
>>> diff --git a/sub b/sub
>>> deleted file mode 160000
>>> index f2c0d45..0000000
>>> --- a/sub
>>> +++ /dev/null
>>> @@ -1 +0,0 @@
>>> -Subproject commit f2c0d4509a3178c...
>> 
>> The repository used to have a subproject and now it doesn't.  Why
>> shouldn't it report the removal?
>
> Because you are not required to have a subproject checked out?

Yes, but.

This is a policy issue, which is not very well enforced currently.

I have been scratching my head to figure out where the right balance we
should strike at for the past week and a half.

For example, it has long been known ever since submodules were introduced
that if you work inside a sparsely checked out supermodule you have to use
"commit -a" with care, because the command notices missing submodule, and
there is no way for it to differenciate between the case you _want to_
remove it and the case you did not care about it, so you will end up
removing unchecked out submodules.

That quirk was something people could live with while submodule support
was merely a newly invented curiosity.  But I do not think a command at
high level (iow Porcelain) such as commit and status should be left
unaware of the Policy that equate missing submodule and unmodified one
forever.  We should actively enforce the policy, so that unless you
explicitly ask nicely, the command should consider a missing submodule
just as unmodified, e.g. "commit -a" should not remove unchecked out
submodules.

But then you would need a way to ask nicely.  How?  Perhaps using "git rm",
and low level "update-index --remove".  Do we even need "commit -A"?  I
doubt it --- you do not remove submodules every day.

We'd like to keep the lowest-level unaware of the Policy, which means that
"diff-files" and "diff-index" should report unchecked out submodules.
Otherwise script writers will be left with no way to differenciate missing
and removed submodules.

Once we start doing this, I think "git diff" Porcelain should fall into
Policy-aware category.

  reply	other threads:[~2008-04-30  7:30 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-22 11:01 [regression?] "git status -a" reports modified for empty submodule directory Ping Yin
2008-04-22 11:04 ` Ping Yin
2008-04-22 12:15 ` Johannes Sixt
2008-04-22 12:39   ` Ping Yin
2008-04-22 12:46     ` Johannes Sixt
2008-04-22 18:00     ` Roman Shaposhnik
2008-04-29 15:31 ` Ping Yin
2008-04-29 16:07   ` [PATCH 0/2] Add tests for submodule with empty directory Ping Yin
2008-04-29 16:07     ` [PATCH 1/2] t4027: test diff " Ping Yin
2008-04-29 16:07       ` [PATCH 2/2] Add t7506 to test submodule related functions for git-status Ping Yin
2008-04-29 21:40   ` [regression?] "git status -a" reports modified for empty submodule directory Junio C Hamano
2008-04-30  6:39     ` Johannes Sixt
2008-04-30  7:29       ` Junio C Hamano [this message]
2008-04-30 15:56         ` Ping Yin
2008-05-02 13:35           ` [PATCH 0/4] Fix regression for unchecked out submodules Ping Yin
2008-05-02 13:35             ` [PATCH 1/4] t4027: test diff for submodule with empty directory Ping Yin
2008-05-02 13:35               ` [PATCH 2/4] Add t7506 to test submodule related functions for git-status Ping Yin
2008-05-02 13:35                 ` [PATCH 3/4] Fix diff regression for submodules not checked out Ping Yin
2008-05-02 13:35                   ` [PATCH 4/4] Fix ie_match_stat for non-checked-out submodule Ping Yin
2008-05-02 21:57                     ` Junio C Hamano
2008-05-02 23:34                       ` Ping Yin
2008-05-02 22:23                   ` [PATCH 3/4] Fix diff regression for submodules not checked out Junio C Hamano
2008-05-02 23:55                     ` Ping Yin
2008-05-03  0:07                     ` [PATCH] Rename ENT_INEXISTENT to ENT_NONEXISTENT Ping Yin
2008-05-03 12:36                     ` [PATCH 3/4] Fix diff regression for submodules not checked out Johannes Schindelin
2008-05-03 16:59                       ` Junio C Hamano
2008-05-04  6:45                     ` Junio C Hamano
2008-05-04  7:10                       ` Ping Yin

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

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

  git send-email \
    --in-reply-to=7vej8n3imp.fsf@gitster.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=j.sixt@viscovery.net \
    --cc=pkufranky@gmail.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.
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 NNTP newsgroup(s).