From: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
To: Catalin Marinas <catalin.marinas@gmail.com>
Cc: git@vger.kernel.org
Subject: [patch 03/11] stg diff / files: don't update directory cache unless needed
Date: Fri, 16 Sep 2005 21:35:15 +0200 [thread overview]
Message-ID: <20050916193515.18681.83716.stgit@zion.home.lan> (raw)
In-Reply-To: <20050916193511.18681.24189.stgit@zion.home.lan>
Do git-update-cache only when diffing with the working tree, not otherwise.
Spending something like 1min for a stg files is bad - yes, my laptop
was really busy and the Linux tree was probably cache-cold, but that's just
not needed.
Also, in diffstat we currently do it both by hand and by calling git.diff.
And in files there's no need at all for that - even the comments says that
"files" has only to do with committed changes.
Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
---
stgit/git.py | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/stgit/git.py b/stgit/git.py
--- a/stgit/git.py
+++ b/stgit/git.py
@@ -376,11 +376,11 @@ def status(files = [], modified = False,
def diff(files = [], rev1 = 'HEAD', rev2 = None, out_fd = None):
"""Show the diff between rev1 and rev2
"""
- os.system('git-update-cache --refresh > /dev/null')
if rev2:
diff_str = _output(['git-diff-tree', '-p', rev1, rev2] + files)
else:
+ os.system('git-update-cache --refresh > /dev/null')
diff_str = _output(['git-diff-cache', '-p', rev1] + files)
if out_fd:
@@ -392,7 +392,6 @@ def diffstat(files = [], rev1 = 'HEAD',
"""Return the diffstat between rev1 and rev2
"""
- os.system('git-update-cache --refresh > /dev/null')
p=popen2.Popen3('git-apply --stat')
diff(files, rev1, rev2, p.tochild)
p.tochild.close()
@@ -404,7 +403,6 @@ def diffstat(files = [], rev1 = 'HEAD',
def files(rev1, rev2):
"""Return the files modified between rev1 and rev2
"""
- os.system('git-update-cache --refresh > /dev/null')
str = ''
for line in _output_lines('git-diff-tree -r %s %s' % (rev1, rev2)):
next prev parent reply other threads:[~2005-09-16 19:38 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-09-16 19:35 [patch 01/11] Fix typo: comitter->committer Paolo 'Blaisorblade' Giarrusso
2005-09-16 19:35 ` [patch 02/11] Make "empty patch" checking optional in "series" command Paolo 'Blaisorblade' Giarrusso
2005-09-17 8:17 ` Catalin Marinas
2005-09-16 19:35 ` Paolo 'Blaisorblade' Giarrusso [this message]
2005-09-16 19:35 ` [patch 04/11] Fix "mail" command when description contains "From" lines Paolo 'Blaisorblade' Giarrusso
2005-09-16 19:35 ` [patch 05/11] Make "stg files" output match "quilt files" one Paolo 'Blaisorblade' Giarrusso
2005-09-16 19:35 ` [patch 06/11] Avoid allowing --undo if it doesn't change anything Paolo 'Blaisorblade' Giarrusso
2005-09-16 19:35 ` [patch 07/11] Implement fast-forward when only tree (but not commits) match Paolo 'Blaisorblade' Giarrusso
2005-09-16 19:35 ` [patch 08/11] Fix "stg clean" when stack is empty Paolo 'Blaisorblade' Giarrusso
2005-09-16 19:35 ` [patch 09/11] Allow mailing a given patch list Paolo 'Blaisorblade' Giarrusso
2005-09-16 19:35 ` [patch 10/11] Fix "stg mail" address parsing for hyphen Paolo 'Blaisorblade' Giarrusso
2005-09-16 19:35 ` [patch 11/11] Detect description in quilt patches Paolo 'Blaisorblade' Giarrusso
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=20050916193515.18681.83716.stgit@zion.home.lan \
--to=blaisorblade@yahoo.it \
--cc=catalin.marinas@gmail.com \
--cc=git@vger.kernel.org \
/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).