-
-
Notifications
You must be signed in to change notification settings - Fork 301
fix(commands/commit): create tmp file divided by user info #316
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
fix(commands/commit): create tmp file divided by user info #316
Conversation
For multi user siuation, it may get fail `Permission denied: '/tmp/cz.commit/backup` due to another user create a temp file. So if one user create temp_file should attatch with USER info to resolve permission issue
Nice, thanks! You'll have to run ./scripts/format
and the tests will pass
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd prefer something like this:
user = os.environ.get('USER', "")
name = f"cz.commit{user}.backup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the apply. we have 100+ users project using this package which have this issue, but I am new commiter for this python package. I will rebuild this issue only after work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No rush, take your time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't the file be read here?
For multi user siuation, it may get fail
The reason is another user has already created a temp file with the same name.
So if one user create temp_file should attatch with
$USER
info to resolve permission issueDescription
attach user info to temp-file name when $USER is possible
Checklist
./script/format
and./script/test
locally to ensure this change passes linter check and testExpected behavior
create
/tmp/cz.commit.backup.tom
Steps to Test This Pull Request
Additional context