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

[PATCH] gitk: Refresh the index

From
CJChristian Jaeger <chrjae@gmail.com>
Date
Sep 27, 2009, 23:43 UTC
Message-ID
<b53c9c0e96f4967935f6c36cd4b2655d22de7cef.1254093602.git.chrjae@gmail.com>

If one or more tracked files changed non-tracked metadata like mtime, gitk would report it as "Local uncommitted changes, not checked in to index" even if no actual changes have been made. (Clicking on the "Local uncommitted changes.." entry would show the file but without any diff.)

This refreshes the index in readdiffindex to avoid this and make gitk behave more like "git status" instead.

Signed-off-by: Christian Jaeger <chrjae@gmail.com>
---
 gitk |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
 * NOTE: I'm not subscribed to the mailing list. *
diff --git a/gitk b/gitk
index a0214b7..bb0e8e1 100755
--- a/gitk
+++ b/gitk
@@ -4898,6 +4898,7 @@ proc readdiffindex {fd serial inst} {
     }
 
     # now see if there are any local changes not checked in to the index
+    exec git update-index -q --refresh
     set cmd "|git diff-files"
     if {$vfilelimit($curview) ne {}} {
 	set cmd [concat $cmd -- $vfilelimit($curview)]
-- 
1.6.4.4
Message 1 of 1 in “gitk: Refresh the index”
  1. gitk: Refresh the indexChristian Jaeger, Sep 27, 2009

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.