Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Selected file item in "status" list jumps randomly #120

Closed
AndiDog opened this issue Mar 19, 2012 · 4 comments
Closed

Selected file item in "status" list jumps randomly #120

AndiDog opened this issue Mar 19, 2012 · 4 comments

Comments

@AndiDog
Copy link
Contributor

AndiDog commented Mar 19, 2012

Using Windows 7, git-cola 1.7.5. The problem occurred already with v1.7.4 after I used it without problems for a while. Now I always get this problem with one repo.

When I select a file under "Modified" (or "Untracked", doesn't matter), the selection jumps to another element after a second or it gets deselected. Unfortunately I can reproduce this only with one of my Git repos (a confidential one), not with the others. Looks like a directory monitoring issue to me that always updates the list. Also killed TGitCache but no difference.

Do you have an idea, or a hint where in the source code I should start debugging?

@davvid
Copy link
Member

davvid commented Mar 20, 2012

Interesting. If you're on Windows then the directory monitoring happens in cola/inotify.py's run_win32() method.

Right now we have Linux inotify and Win32 monitoring handled in a single file. I think we'll probably want to break these apart into separate files to keep things easier to maintain in the long run.

An easy way to disable it is to return immediately from the start() function. If this fixes the problem for you then we'll have to loop in @kbielefe who is the original author of the win32 directory monitoring.

BTW, does this repo happen to be a submodule, or does it use a .git file (instead of a .git directory)? I ask because I noticed that the win32 monitoring checks for if not path.startswith('.git/') ... to detect whether the file in question is beneath the .git/ directory. Repos with .git files (newer submodules, for example) may not be properly detected by this test. But, I'm not very familiar with the win32 side so I'll defer to kbielefe who knows better than I.

Thanks for the heads-up.

@AndiDog
Copy link
Contributor Author

AndiDog commented Mar 21, 2012

Thanks for telling me where to look. I actually found that the problem is the line you mentioned in run_win32. For me, it handles a file in the .git directory of a submodule, e.g. path == 'lib-src/ServiceStack/.git/index.lock'. The following change fixes that:

if not path.startswith('.git/') and "/.git/" not in path and os.path.isfile(path):

@davvid
Copy link
Member

davvid commented Mar 21, 2012

Awesome, I'm glad that worked. I'd like to credit you with this change. Do you mind if I make a commit with you as the author?

@davvid davvid closed this as completed in 4ba9b60 Mar 21, 2012
@AndiDog
Copy link
Contributor Author

AndiDog commented Mar 21, 2012

That's fine with me, thanks for resolving!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants