{"thread":{"id":"50232","subject":"[RFC PATCH] gitk: Don't mark files with new time-stamp as modified","startedAt":"2019-01-15T19:21:40Z","lastAt":"2019-01-15T19:21:40Z","messageCount":1,"participants":["Jacob Kroon"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"366740","messageId":"20190115192118.14072-1-jacob.kroon@gmail.com","threadId":"50232","inReplyTo":null,"subject":"[RFC PATCH] gitk: Don't mark files with new time-stamp as modified","fromName":"Jacob Kroon","fromEmail":"jacob.kroon@gmail.com","sentAt":"2019-01-15T19:21:18Z","receivedAt":"2019-01-15T19:21:40Z","isPatch":true,"sender":{"key":"jacob.kroon@gmail.com","avatar":null},"body":"Run 'git update-index --refresh' in order to get rid\nof false positives about unstaged changes in files.\n\nTo reproduce:\n1. git status # no local changes\n2. touch <file-under-version-control>\n3. gitk # file shows up as unstaged modified file\n4. git update-index --refresh\n5. gitk # file does not show up\n\nSee link below for more discussion.\n\nhttps://public-inbox.org/git/0c4b21c8-996b-3017-a1f9-894ac5b27232@gmail.com/T/#m121ab8bd38196a53a6d7ccb89034a99dcd3a703e\n\nSigned-off-by: Jacob Kroon <jacob.kroon@gmail.com>\n---\n gitk-git/gitk | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex a14d7a16b..016c1d7fe 100755\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -5334,6 +5334,7 @@ proc readdiffindex {fd serial inst} {\n     }\n \n     # now see if there are any local changes not checked in to the index\n+    catch { exec git update-index --refresh }\n     set cmd \"|git diff-files\"\n     if {$vfilelimit($curview) ne {}} {\n \tset cmd [concat $cmd -- $vfilelimit($curview)]\n@@ -7829,6 +7830,7 @@ proc diffcmd {ids flags} {\n \t    }\n \t} else {\n \t    # comparing working directory with index\n+\t    catch { exec git update-index --refresh }\n \t    set cmd [concat | git diff-files $flags]\n \t    if {$j == 1} {\n \t\tlappend cmd -R\n-- \n2.11.0\n\n"}]}