From: Jens Lehmann <Jens.Lehmann@web.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: What's cooking in git.git (Jan 2010, #07; Fri, 22)
Date: Sat, 23 Jan 2010 17:37:26 +0100 [thread overview]
Message-ID: <4B5B25C6.70604@web.de> (raw)
In-Reply-To: <7vtyudfqju.fsf@alter.siamese.dyndns.org>
Am 23.01.2010 04:28, schrieb Junio C Hamano:
> * jl/submodule-diff (2010-01-18) 4 commits
> (merged to 'next' on 2010-01-20 at 95cb513)
> + Performance optimization for detection of modified submodules
> (merged to 'next' on 2010-01-17 at 525075b)
> + git status: Show uncommitted submodule changes too when enabled
> (merged to 'next' on 2010-01-16 at 0a99e3c)
> + Teach diff that modified submodule directory is dirty
> + Show submodules as modified when they contain a dirty work tree
What about adding the following patch to this series?
Without it i see a performance regression for people who use
"git diff* --ignore-submodules".
A patch that teaches "git diff --submodule" to display if the submodule
contains new untracked and/or modified files is also almost ready. Would
you consider it for inclusion into 1.7.0 too or shall i wait until after
the release?
------8<-----
Subject: [PATCH] git diff: Don't test submodule dirtiness with --ignore-submodules
The diff family suppresses the output of submodule changes when
requested but checks them nonetheless. But since recently submodules
get examined for their dirtiness, which is rather expensive. There is
no need to do that when the --ignore-submodules option is used, as
the gathered information is never used anyway.
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
---
diff-lib.c | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/diff-lib.c b/diff-lib.c
index ec2e2ac..e896b9c 100644
--- a/diff-lib.c
+++ b/diff-lib.c
@@ -161,7 +161,10 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
continue;
}
- if ((ce_uptodate(ce) && !S_ISGITLINK(ce->ce_mode)) || ce_skip_worktree(ce))
+ if ((ce_uptodate(ce)
+ && (!S_ISGITLINK(ce->ce_mode)
+ || DIFF_OPT_TST(&revs->diffopt, IGNORE_SUBMODULES)))
+ || ce_skip_worktree(ce))
continue;
/* If CE_VALID is set, don't look at workdir for file removal */
@@ -179,6 +182,7 @@ int run_diff_files(struct rev_info *revs, unsigned int option)
}
changed = ce_match_stat(ce, &st, ce_option);
if (S_ISGITLINK(ce->ce_mode)
+ && !DIFF_OPT_TST(&revs->diffopt, IGNORE_SUBMODULES)
&& (!changed || (revs->diffopt.output_format & DIFF_FORMAT_PATCH))
&& is_submodule_modified(ce->name)) {
changed = 1;
@@ -220,7 +224,7 @@ static int get_stat_data(struct cache_entry *ce,
const unsigned char **sha1p,
unsigned int *modep,
int cached, int match_missing,
- unsigned *dirty_submodule, int output_format)
+ unsigned *dirty_submodule, struct diff_options *diffopt)
{
const unsigned char *sha1 = ce->sha1;
unsigned int mode = ce->ce_mode;
@@ -241,7 +245,8 @@ static int get_stat_data(struct cache_entry *ce,
}
changed = ce_match_stat(ce, &st, 0);
if (S_ISGITLINK(ce->ce_mode)
- && (!changed || (output_format & DIFF_FORMAT_PATCH))
+ && !DIFF_OPT_TST(diffopt, IGNORE_SUBMODULES)
+ && (!changed || (diffopt->output_format & DIFF_FORMAT_PATCH))
&& is_submodule_modified(ce->name)) {
changed = 1;
*dirty_submodule = 1;
@@ -270,7 +275,7 @@ static void show_new_file(struct rev_info *revs,
* the working copy.
*/
if (get_stat_data(new, &sha1, &mode, cached, match_missing,
- &dirty_submodule, revs->diffopt.output_format) < 0)
+ &dirty_submodule, &revs->diffopt) < 0)
return;
diff_index_show_file(revs, "+", new, sha1, mode, dirty_submodule);
@@ -287,7 +292,7 @@ static int show_modified(struct rev_info *revs,
unsigned dirty_submodule = 0;
if (get_stat_data(new, &sha1, &mode, cached, match_missing,
- &dirty_submodule, revs->diffopt.output_format) < 0) {
+ &dirty_submodule, &revs->diffopt) < 0) {
if (report_missing)
diff_index_show_file(revs, "-", old,
old->sha1, old->ce_mode, 0);
--
1.6.6.1.558.g5c480.dirty
next prev parent reply other threads:[~2010-01-23 16:37 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-23 3:28 What's cooking in git.git (Jan 2010, #07; Fri, 22) Junio C Hamano
2010-01-23 11:18 ` Jakub Narebski
2010-01-23 16:37 ` Jens Lehmann [this message]
2010-01-23 20:03 ` Junio C Hamano
2010-01-24 2:11 ` Junio C Hamano
2010-01-24 8:10 ` Junio C Hamano
2010-01-24 14:09 ` Jens Lehmann
2010-01-25 18:05 ` [RFC/H] "git diff --submodule" showing submodule work tree dirtiness Junio C Hamano
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=4B5B25C6.70604@web.de \
--to=jens.lehmann@web.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.
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).