From: Jens Lehmann <Jens.Lehmann@web.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: Git Mailing List <git@vger.kernel.org>,
Sergio Callegari <sergio.callegari@gmail.com>
Subject: Re: [PATCH] git status: ignoring untracked files must apply to submodules too
Date: Sun, 14 Mar 2010 00:08:28 +0100 [thread overview]
Message-ID: <4B9C1AEC.2070605@web.de> (raw)
In-Reply-To: <7vhboj6et9.fsf@alter.siamese.dyndns.org>
Am 13.03.2010 23:24, schrieb Junio C Hamano:
> Jens Lehmann <Jens.Lehmann@web.de> writes:
>
>> Since 1.7.0 submodules are considered dirty when they contain untracked
>> files. But when git status is called with the "-uno" option, the user
>> asked to ignore untracked files, so they must be ignored in submodules
>> too. To achieve this, the new flag DIFF_OPT_IGNORE_UNTRACKED_IN_SUBMODULES
>> is introduced.
>>
>> Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
>> ---
>>
>> This patch applies on top of current pu.
>>
>> I'm open to suggestions for a shorter name for the new diff option
>> IGNORE_UNTRACKED_IN_SUBMODULES; I did not manage to come up with a
>> shorter yet still descriptive enough name.
>
> Why do you even need that flag? Isn't it the matter of deciding to ignore
> or pay attention to the DIRTY_SUBMODULE_UNTRACKED bit in the return value
> of is_submodule_modified(), depending on whether the toplevel wt_status
> was called with -uno?
First: When called from "git status" run_diff_files() calls
wt_status_collect_changed_cb() for every file it considers changed, so
when the "-uno" option is given for a submodule with only untracked files
i thought it cleaner to let is_submodule_modified() return 0 so this
callback is not called at all and the submodule won't show up in the
"change" list of wt_status (Yes, this could be done by not adding such a
submodule to that list in the wt_status_collect_changed_cb() too).
Second: One of my next patches will be about adding an option to the git
diff family to not show submodules with only untracked files in their
work tree as modified, which calls for such a diff option AFAICS.
Third: We give is_submodule_modified() the possibility to stop parsing the
output of the "git status" run in the submodule early, because as soon as
it sees a modified file it will stop to parse the output further when
untracked files shall be ignored.
next prev parent reply other threads:[~2010-03-13 23:08 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-13 22:00 [PATCH] git status: ignoring untracked files must apply to submodules too Jens Lehmann
2010-03-13 22:24 ` Junio C Hamano
2010-03-13 23:08 ` Jens Lehmann [this message]
2010-03-14 0:07 ` Junio C Hamano
2010-03-14 0:55 ` Jens Lehmann
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=4B9C1AEC.2070605@web.de \
--to=jens.lehmann@web.de \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=sergio.callegari@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).