git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* gitk shows local uncommit changes after touch file + reload
@ 2019-01-06 22:51 Jacob Kroon
  2019-01-07 17:41 ` Philip Oakley
  0 siblings, 1 reply; 3+ messages in thread
From: Jacob Kroon @ 2019-01-06 22:51 UTC (permalink / raw)
  To: git

Hi,

Not sure if this has already been reported, but I observe this odd
behaviour in gitk from master:

git status
gitk # everything looks good
touch <file-under-version-control>
gitk # gitk shows "local uncomitted changes" on the file I touched
git status
gitk # gitk is back to normal again, showing no local uncommitted changes

The issue has been discussed on stackoverflow here:
https://stackoverflow.com/questions/49990403/after-tar-untar-of-git-repo-gitk-shows-local-uncommitted-changes-not-checked

Any chance gitk could be changed to so that it doesn't display the
"local uncommitted changes" blob in this case ?

Regards Jacob

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: gitk shows local uncommit changes after touch file + reload
  2019-01-06 22:51 gitk shows local uncommit changes after touch file + reload Jacob Kroon
@ 2019-01-07 17:41 ` Philip Oakley
  2019-01-08  6:41   ` Jacob Kroon
  0 siblings, 1 reply; 3+ messages in thread
From: Philip Oakley @ 2019-01-07 17:41 UTC (permalink / raw)
  To: Jacob Kroon, git

On 06/01/2019 22:51, Jacob Kroon wrote:
> Hi,
>
> Not sure if this has already been reported, but I observe this odd
> behaviour in gitk from master:
>
> git status
> gitk # everything looks good
> touch <file-under-version-control>
> gitk # gitk shows "local uncomitted changes" on the file I touched
> git status
> gitk # gitk is back to normal again, showing no local uncommitted changes
>
> The issue has been discussed on stackoverflow here:
> https://stackoverflow.com/questions/49990403/after-tar-untar-of-git-repo-gitk-shows-local-uncommitted-changes-not-checked
>
> Any chance gitk could be changed to so that it doesn't display the
> "local uncommitted changes" blob in this case ?
>
> Regards Jacob

I believe this is doing the right thing (TM) at the level of 
investigation that gitk uses to determine the status of the files. In 
particular, Git uses the modified time stamp as a surrogate indication 
for detecting that the user has probably edited the file (it's been 
modified at time hhmmss, right?).

Now as I understand it, the full (without limiting options) git status 
command does go and check the content of anything that's potentially 
changed (but it can be costly), and at that point the status command 
simply updates its 'Index' record with the new mtime after noticing that 
nothing had really changed. Meanwhile, gitk, being a continuously 
running GUI avoids the overhead of the git status (though you can force 
it) and does report the mtime change as being a potential file modification.

There is a separate discussion on the git users forum regarding the 
compatibility with other tools that has a similar root cause in the use 
and abuse of mtime as a canary for modification, given that the Git repo 
storage does not record any file times, so will get a (moderately) 
arbitrary mtime & ctime when checked out.

-- 

Philip


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: gitk shows local uncommit changes after touch file + reload
  2019-01-07 17:41 ` Philip Oakley
@ 2019-01-08  6:41   ` Jacob Kroon
  0 siblings, 0 replies; 3+ messages in thread
From: Jacob Kroon @ 2019-01-08  6:41 UTC (permalink / raw)
  To: Philip Oakley, git

On 1/7/19 6:41 PM, Philip Oakley wrote:
> On 06/01/2019 22:51, Jacob Kroon wrote:
>> Hi,
>>
>> Not sure if this has already been reported, but I observe this odd
>> behaviour in gitk from master:
>>
>> git status
>> gitk # everything looks good
>> touch <file-under-version-control>
>> gitk # gitk shows "local uncomitted changes" on the file I touched
>> git status
>> gitk # gitk is back to normal again, showing no local uncommitted changes
>>
>> The issue has been discussed on stackoverflow here:
>> https://stackoverflow.com/questions/49990403/after-tar-untar-of-git-repo-gitk-shows-local-uncommitted-changes-not-checked 
>>
>>
>> Any chance gitk could be changed to so that it doesn't display the
>> "local uncommitted changes" blob in this case ?
>>
>> Regards Jacob
> 
> I believe this is doing the right thing (TM) at the level of 
> investigation that gitk uses to determine the status of the files. In 
> particular, Git uses the modified time stamp as a surrogate indication 
> for detecting that the user has probably edited the file (it's been 
> modified at time hhmmss, right?).
> 
> Now as I understand it, the full (without limiting options) git status 
> command does go and check the content of anything that's potentially 
> changed (but it can be costly), and at that point the status command 
> simply updates its 'Index' record with the new mtime after noticing that 
> nothing had really changed. Meanwhile, gitk, being a continuously 
> running GUI avoids the overhead of the git status (though you can force 
> it) and does report the mtime change as being a potential file 
> modification.

Although gitk it is a continuously running application, I don't expect 
it is continuously monitoring the files. If I explicitly tell gitk to 
"reload" I'd be perfectly fine with it taking some more time to discard 
any false positives in the same way as "git status".

What do you mean by "you can force it", is there some option in gitk I 
can set which forces it to do the equivalent of "git status" on reload ?

Thanks,
Jacob

> There is a separate discussion on the git users forum regarding the 
> compatibility with other tools that has a similar root cause in the use 
> and abuse of mtime as a canary for modification, given that the Git repo 
> storage does not record any file times, so will get a (moderately) 
> arbitrary mtime & ctime when checked out.
> 

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-01-08  6:41 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-06 22:51 gitk shows local uncommit changes after touch file + reload Jacob Kroon
2019-01-07 17:41 ` Philip Oakley
2019-01-08  6:41   ` Jacob Kroon

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).