Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

don't load very large files (or use mmap) #142

Closed
grandinj opened this Issue · 2 comments

2 participants

@grandinj

Accidentally clicking on a core file can lock the UI up for several seconds.

First prize would be simply ignoring binary files using the git ignore rules.

Otherwise, a simply solution may be to simply not load files over some size boundary.

@davvid
Owner

git-cola does follow the regular .gitignore rules; if you have binary files showing up then it's because they are not ignored.

We had some discussion about this on the list. I had disabled this feature at one point.

I think it'd be good to also guard against files that are too large, and add a tuning knob in case someone needs a threshold larger then 0.5MB (which is what I'd probably use as a default limit).

I'd also be tempted to use a QRunnable task to do it, but python's GIL will probably make the extra effort not worth it.

@grandinj

Sorry, you are correct, following .gitignore rules is not the problem.

Just some kind of size limit would be nice to prevent me from shooting myself in the foot :-)

@davvid davvid closed this issue from a commit
@davvid davvid status: Show untracked files in the background
Large binary files can exist in the worktree.
Keep the GUI from blocking by doing it in a thread.

Limit the size of the read calls to 2k to minimize
blocking the GUI.  Even though we use a thread,
python's GIL starts blocking, so this helps keep
things responsive despite the fact that we truncate
the output.

The `cola.readsize` configuration variable can be
used to adjust the limit in case 2k is not enough.

Closes #142

Signed-off-by: David Aguilar <davvid@gmail.com>
7d8c1fe
@davvid davvid closed this in 7d8c1fe
@gdebure gdebure referenced this issue from a commit in gdebure/git-cola
@davvid davvid status: Show untracked files in the background
Large binary files can exist in the worktree.
Keep the GUI from blocking by doing it in a thread.

Limit the size of the read calls to 2k to minimize
blocking the GUI.  Even though we use a thread,
python's GIL starts blocking, so this helps keep
things responsive despite the fact that we truncate
the output.

The `cola.readsize` configuration variable can be
used to adjust the limit in case 2k is not enough.

Closes #142

Signed-off-by: David Aguilar <davvid@gmail.com>
222c67c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.