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

`git-cola` does not cleanup after itself. #566

Closed
envygeeks opened this Issue Apr 14, 2016 · 2 comments

Comments

Projects
None yet
3 participants
@envygeeks

envygeeks commented Apr 14, 2016

After running git-cola on several directories over a period of a few days, I have well over 20 temporary directories in my /tmp folder because git-cola didn't cleanup after itself when it was told to exit. This might be related to me launching it with git cola and then doing a C-c on it when I'm done (but personally I don't think that should matter.)

Note: They all seem to be empty, so maybe it is trying to cleanup just the parent is not being removed?

@davvid davvid closed this in 3ed3dde Apr 16, 2016

@Vdragon

This comment has been minimized.

Show comment
Hide comment
@Vdragon

Vdragon Apr 16, 2016

Contributor

I wonder if the temp folder removal can/should be implemented in the interrupt signal handler instead, then the temp folders will only be preserved when the process is killed (but not when it is interrupted, such as using the Ctrl-C keystroke)

It'll prevent repeatedly cleaning up the temp files(less code being run?), and also solves this issue...?

Contributor

Vdragon commented Apr 16, 2016

I wonder if the temp folder removal can/should be implemented in the interrupt signal handler instead, then the temp folders will only be preserved when the process is killed (but not when it is interrupted, such as using the Ctrl-C keystroke)

It'll prevent repeatedly cleaning up the temp files(less code being run?), and also solves this issue...?

@davvid

This comment has been minimized.

Show comment
Hide comment
@davvid

davvid Apr 17, 2016

Member

@Vdragon I tried that first, but adding a custom handler has strange behavior in pyqt. Instead of immediately exiting like signal.SIG_DFL, the shell shows ^C but nothing happens until you give focus back to cola and then the custom signal handler finally runs.

I think I can even do away with the need for a tmp directory period, then we don't need to rmtree, just unlink for each temp file.

Member

davvid commented Apr 17, 2016

@Vdragon I tried that first, but adding a custom handler has strange behavior in pyqt. Instead of immediately exiting like signal.SIG_DFL, the shell shows ^C but nothing happens until you give focus back to cola and then the custom signal handler finally runs.

I think I can even do away with the need for a tmp directory period, then we don't need to rmtree, just unlink for each temp file.

davvid added a commit that referenced this issue Apr 17, 2016

cmds: eliminate use of rmtree() and temporary directories
There's no need to use a temporary directory when creating temp files,
so simplify things by using the default temp directory instead.

The callers can now deal with only a single return value, and we no
longer need to use rmtree, as we can simply unlink the temporary file.

Related-to: #566
Signed-off-by: David Aguilar <davvid@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment