git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Marius Storm-Olsen <marius@trolltech.com>
To: git <git@vger.kernel.org>
Cc: Junio C Hamano <gitster@pobox.com>
Subject: [PATCH 3/3] Add shortcut in refresh_cache_ent() for marked entries.
Date: Fri, 30 May 2008 14:38:35 +0200	[thread overview]
Message-ID: <c581c03d8d8bfc76753018d4399a79b02a057186.1212152269.git.marius@trolltech.com> (raw)
In-Reply-To: 3088e5a9507aa55ee55f512fb3bd554f1658d2e3.1212152269.git.marius@trolltech.com

When a cache entry has been marked as CE_VALID, the user has
promised us that any change in the work tree does not matter.
Just mark the entry as up-to-date, and continue.

Done-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
---
 read-cache.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/read-cache.c b/read-cache.c
index ac9a8e7..8e5fbb6 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -893,6 +893,15 @@ static struct cache_entry *refresh_cache_ent(struct index_state *istate,
 	if (ce_uptodate(ce))
 		return ce;
 
+	/*
+	 * CE_VALID means the user promised us that the change to
+	 * the work tree does not matter and told us not to worry.
+	 */
+	if (!ignore_valid && (ce->ce_flags & CE_VALID)) {
+		ce_mark_uptodate(ce);
+		return ce;
+	}
+
 	if (lstat(ce->name, &st) < 0) {
 		if (err)
 			*err = errno;
-- 
1.5.5.GIT

  reply	other threads:[~2008-05-30 13:09 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-27  9:29 [PATCH] Ensure that commit/status don't stat all files when core.ignoreStat = true Marius Storm-Olsen
2008-05-27 20:00 ` Junio C Hamano
2008-05-27 20:21   ` Marius Storm-Olsen
2008-05-30 11:14     ` [PATCH 1/3] Clearify the documentation for core.ignoreStat Marius Storm-Olsen
2008-05-30  8:54       ` [PATCH 2/3] Introduce core.showUntrackedFiles to make it possible to disable showing of untracked files Simon Hausmann
2008-05-30 12:38         ` Marius Storm-Olsen [this message]
2008-05-30 13:14           ` [PATCH 3/3] Add shortcut in refresh_cache_ent() for marked entries Marius Storm-Olsen
2008-05-30 13:10         ` [PATCH 2/3] Introduce core.showUntrackedFiles to make it possible to disable showing of untracked files Marius Storm-Olsen
2008-05-30 13:16         ` Marius Storm-Olsen
2008-05-30 20:27         ` Junio C Hamano
2008-05-31  6:41           ` Marius Storm-Olsen
2008-06-03 13:09           ` [PATCH] Add an optional <mode> argument to commit/status -u|--untracked-files option Marius Storm-Olsen
2008-06-03 13:12             ` [PATCH] Add configuration option for default untracked files mode Marius Storm-Olsen
2008-06-03 20:02             ` [PATCH] Add an optional <mode> argument to commit/status -u|--untracked-files option Junio C Hamano
2008-06-03 21:00               ` Marius Storm-Olsen
2008-06-05  8:31               ` [PATCH 1/3] " Marius Storm-Olsen
2008-06-05 12:22                 ` [PATCH 2/3] Add argument 'no' commit/status option -u|--untracked-files Marius Storm-Olsen
2008-06-05 12:47                   ` [PATCH 3/3] Add configuration option for default untracked files mode Marius Storm-Olsen
2008-06-07  1:55                 ` [PATCH 1/3] Add an optional <mode> argument to commit/status -u|--untracked-files option Junio C Hamano
2008-06-09  6:54                   ` Marius Storm-Olsen
2008-06-05  8:31                     ` Marius Storm-Olsen
2008-06-05 12:22                       ` [PATCH 2/3] Add argument 'no' commit/status option -u|--untracked-files Marius Storm-Olsen
2008-06-05 12:47                         ` [PATCH 3/3] Add configuration option for default untracked files mode Marius Storm-Olsen
2008-06-10  6:23                     ` [PATCH 1/3] Add an optional <mode> argument to commit/status -u|--untracked-files option Junio C Hamano
2008-06-03 20:14             ` [PATCH] " Jeff King
2008-06-03 21:17               ` Marius Storm-Olsen
2008-06-03 22:27                 ` Jeff King
2008-06-03 22:26               ` しらいしななこ
     [not found]               ` <200806032227.m53MRLeD005668@mi0.bluebottle.com>
2008-06-03 22:53                 ` Jeff King
2008-06-06  6:32             ` Alex Riesen
2008-06-06  6:56               ` Marius Storm-Olsen

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=c581c03d8d8bfc76753018d4399a79b02a057186.1212152269.git.marius@trolltech.com \
    --to=marius@trolltech.com \
    --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).