git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/7] Enable wt-status to run against non-standard index file.

From
Kristian Høgsberg <krh@redhat.com>
Date
Sep 18, 2007, 00:06 UTC
Message-ID
<1190074014548-git-send-email-krh@redhat.com>
In-Reply-To
<1190074008617-git-send-email-krh@redhat.com>

We still default to get_index_file(), but this can be overridden by setting wt_status.index_file after calling wt_status_prepare().

Signed-off-by: Kristian Høgsberg <krh@redhat.com>
---
 wt-status.c |    3 ++-
 wt-status.h |    1 +
 2 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/wt-status.c b/wt-status.c
index eeb1691..03b5ec4 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -53,6 +53,7 @@ void wt_status_prepare(struct wt_status *s)
 	s->branch = head ? xstrdup(head) : NULL;
 	s->reference = "HEAD";
 	s->fp = stdout;
+	s->index_file = get_index_file();
 }
 
 static void wt_status_print_cached_header(struct wt_status *s)
@@ -198,7 +199,7 @@ static void wt_status_print_changed_cb(struct diff_queue_struct *q,
 static void wt_read_cache(struct wt_status *s)
 {
 	discard_cache();
-	read_cache();
+	read_cache_from(s->index_file);
 }
 
 static void wt_status_print_initial(struct wt_status *s)
diff --git a/wt-status.h b/wt-status.h
index 4f3a615..7744932 100644
--- a/wt-status.h
+++ b/wt-status.h
@@ -21,6 +21,7 @@ struct wt_status {
 	int commitable;
 	int workdir_dirty;
 	int workdir_untracked;
+	const char *index_file;
 	FILE *fp;
 };
 
-- 
1.5.3.1.993.gbf388-dirty
Previous: Kristian HøgsbergNext: Kristian Høgsberg
Message 2 of 18 in “Enable wt-status output to a given FILE pointer.”
  1. 1/7 Enable wt-status output to a given FILE pointer.Kristian Høgsberg, Sep 18, 2007
  2. 2/7 Enable wt-status to run against non-standard index file.Kristian Høgsberg, Sep 18, 2007
  3. 3/7 Introduce entry point for launching add--interactive.Kristian Høgsberg, Sep 18, 2007
  4. 4/7 Clean up stripspace a bit, use strbuf even more.Kristian Høgsberg, Sep 18, 2007
  5. 5/7 Add strbuf_read_file().Kristian Høgsberg, Sep 18, 2007
  6. 6/7 Export rerere() and launch_editor().Kristian Høgsberg, Sep 18, 2007
  7. 7/7 Implement git commit as a builtin command.Kristian Høgsberg, Sep 18, 2007
  8. Johannes SchindelinSep 18, 2007
  9. Kristian HøgsbergSep 18, 2007
  10. Junio C HamanoSep 20, 2007
  11. Kristian HøgsbergSep 21, 2007
  12. Junio C HamanoSep 21, 2007
  13. Kristian HøgsbergSep 24, 2007
  14. Johannes SchindelinSep 18, 2007
  15. Junio C HamanoSep 19, 2007
  16. Kristian HøgsbergSep 21, 2007
  17. Johannes SchindelinSep 18, 2007
  18. Kristian HøgsbergSep 18, 2007

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.