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

[RFC PATCH] gitk: Don't mark files with new time-stamp as modified

From
JKJacob Kroon <jacob.kroon@gmail.com>
Date
Jan 15, 2019, 19:21 UTC
Message-ID
<20190115192118.14072-1-jacob.kroon@gmail.com>

Run 'git update-index --refresh' in order to get rid of false positives about unstaged changes in files.

To reproduce:
1. git status # no local changes
2. touch <file-under-version-control>
3. gitk # file shows up as unstaged modified file
4. git update-index --refresh
5. gitk # file does not show up
See link below for more discussion.
https://public-inbox.org/git/0c4b21c8-996b-3017-a1f9-894ac5b27232@gmail.com/T/#m121ab8bd38196a53a6d7ccb89034a99dcd3a703e
Signed-off-by: Jacob Kroon <jacob.kroon@gmail.com>
---
 gitk-git/gitk | 2 ++
 1 file changed, 2 insertions(+)
diff --git a/gitk-git/gitk b/gitk-git/gitk
index a14d7a16b..016c1d7fe 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -5334,6 +5334,7 @@ proc readdiffindex {fd serial inst} {
     }
 
     # now see if there are any local changes not checked in to the index
+    catch { exec git update-index --refresh }
     set cmd "|git diff-files"
     if {$vfilelimit($curview) ne {}} {
 	set cmd [concat $cmd -- $vfilelimit($curview)]
@@ -7829,6 +7830,7 @@ proc diffcmd {ids flags} {
 	    }
 	} else {
 	    # comparing working directory with index
+	    catch { exec git update-index --refresh }
 	    set cmd [concat | git diff-files $flags]
 	    if {$j == 1} {
 		lappend cmd -R
-- 
2.11.0
Message 1 of 1 in “gitk: Don't mark files with new time-stamp as modified”
  1. gitk: Don't mark files with new time-stamp as modifiedJacob Kroon, Jan 15, 2019

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.