All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Marco Costalba <mcostalba@gmail.com>, GIT list <git@vger.kernel.org>
Subject: [PATCH 2/2] git-runstatus --refresh
Date: Fri, 09 Feb 2007 18:51:55 -0800	[thread overview]
Message-ID: <7vr6syohbo.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: 7vejoyq330.fsf@assigned-by-dhcp.cox.net

This teaches git-runstatus a new option --refresh to refresh the
index in-core.

Signed-off-by: Junio C Hamano <junkio@cox.net>
---
 * If a cache has 20k+ paths, this could be rather expensive
   because git-status already have refreshed the entries for us,
   so I am reluctant to make this the default, but obviously
   then qgit needs to know if it has runstatus that knows about
   this option.

 builtin-runstatus.c |    4 +++-
 wt-status.c         |    2 ++
 wt-status.h         |    1 +
 3 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/builtin-runstatus.c b/builtin-runstatus.c
index 4b489b1..df66742 100644
--- a/builtin-runstatus.c
+++ b/builtin-runstatus.c
@@ -4,7 +4,7 @@
 extern int wt_status_use_color;
 
 static const char runstatus_usage[] =
-"git-runstatus [--color|--nocolor] [--amend] [--verbose] [--untracked]";
+"git-runstatus [--color|--nocolor] [--refresh] [--amend] [--verbose] [--untracked]";
 
 int cmd_runstatus(int argc, const char **argv, const char *prefix)
 {
@@ -17,6 +17,8 @@ int cmd_runstatus(int argc, const char **argv, const char *prefix)
 	for (i = 1; i < argc; i++) {
 		if (!strcmp(argv[i], "--color"))
 			wt_status_use_color = 1;
+		else if (!strcmp(argv[i], "--refresh"))
+			s.refresh = 1;
 		else if (!strcmp(argv[i], "--nocolor"))
 			wt_status_use_color = 0;
 		else if (!strcmp(argv[i], "--amend")) {
diff --git a/wt-status.c b/wt-status.c
index e346511..27c228b 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -195,6 +195,8 @@ static void wt_read_cache(struct wt_status *s)
 {
 	discard_cache();
 	read_cache();
+	if (s->refresh)
+		refresh_cache(REFRESH_QUIET);
 }
 
 void wt_status_print_initial(struct wt_status *s)
diff --git a/wt-status.h b/wt-status.h
index cfea4ae..680a0ca 100644
--- a/wt-status.h
+++ b/wt-status.h
@@ -15,6 +15,7 @@ struct wt_status {
 	int verbose;
 	int amend;
 	int untracked;
+	int refresh;
 	/* These are computed during processing of the individual sections */
 	int commitable;
 	int workdir_dirty;
-- 
1.5.0.rc4.26.gcc46

  parent reply	other threads:[~2007-02-10  2:52 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-09 19:25 'git status' is not read-only fs friendly Marco Costalba
2007-02-09 19:56 ` Linus Torvalds
2007-02-09 20:19   ` Marco Costalba
2007-02-09 20:27     ` Junio C Hamano
2007-02-09 20:22   ` Junio C Hamano
2007-02-09 20:29     ` Morten Welinder
2007-02-09 23:27       ` Theodore Tso
2007-02-09 20:35     ` Marco Costalba
2007-02-09 20:59       ` Linus Torvalds
2007-02-10  0:12         ` Junio C Hamano
2007-02-10  0:16           ` Junio C Hamano
2007-02-10  2:51             ` [PATCH 1/2] run_diff_{files,index}(): update calling convention Junio C Hamano
2007-02-10  8:02               ` Marco Costalba
2007-02-10  8:20                 ` Junio C Hamano
2007-02-10  8:29                   ` Marco Costalba
2007-02-10  8:46                     ` Marco Costalba
2007-02-10 10:40                       ` Junio C Hamano
2007-02-10 11:25                         ` Marco Costalba
2007-02-10 15:13                           ` Junio C Hamano
2007-02-10 15:51                             ` Marco Costalba
2007-02-10  2:51             ` Junio C Hamano [this message]
2007-02-10 14:19 ` 'git status' is not read-only fs friendly Johannes Schindelin
2007-02-10 14:31   ` Marco Costalba
2007-02-10 14:41     ` Johannes Schindelin
2007-02-10 14:48       ` Marco Costalba
2007-02-10 14:51         ` Marco Costalba
2007-02-10 16:25           ` Junio C Hamano
2007-02-10 20:36             ` Johannes Schindelin
2007-02-11 21:57               ` Junio C Hamano
2007-02-11 22:09                 ` Johannes Schindelin
2007-02-11 22:28                   ` Johannes Schindelin
2007-02-11 22:30                   ` Junio C Hamano
2007-02-11 23:24                     ` Johannes Schindelin
2007-02-10 14:59         ` Johannes Schindelin
2007-02-10 15:45           ` Marco Costalba
2007-02-10 15:54           ` Nicolas Pitre
2007-02-10 16:27             ` Junio C Hamano
2007-02-10 16:40               ` Nicolas Pitre
2007-02-10 16:46                 ` Junio C Hamano
2007-02-10 17:03                   ` Nicolas Pitre
2007-02-10 18:00                     ` Junio C Hamano
2007-02-10 18:43                       ` Theodore Tso
2007-02-10 18:53                       ` Nicolas Pitre
2007-02-10 18:56                         ` Theodore Tso
2007-02-10 19:08                         ` Marco Costalba
2007-02-10 17:37                 ` Linus Torvalds
2007-02-10 18:51                   ` Nicolas Pitre
2007-02-11  6:33                   ` Junio C Hamano
2007-02-11  7:23                   ` Shawn O. Pearce
2007-02-10 20:40             ` Johannes Schindelin
2007-02-10 16:25           ` Junio C Hamano
2007-02-10 16:35             ` Marco Costalba

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=7vr6syohbo.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=mcostalba@gmail.com \
    --cc=torvalds@linux-foundation.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.