-
Notifications
You must be signed in to change notification settings - Fork 489
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 issue 1410: Automated Git commit script now uses subprocess.run instead of subprocess.getoutput #1433
Conversation
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.
- The changes would also need to be reflected in the
README.md
- Please take a look at the deepsource output. None of that is really a thing, only
exit
should be changed tosys.exit
Python/Automate_Commiting_using_Git/automate_commiting_using_git.py
Outdated
Show resolved
Hide resolved
Python/Automate_Commiting_using_Git/automate_commiting_using_git.py
Outdated
Show resolved
Hide resolved
Python/Automate_Commiting_using_Git/automate_commiting_using_git.py
Outdated
Show resolved
Hide resolved
@ClasherKasten please review the changes. |
Please Merge the Pull Request @ClasherKasten |
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.
LGTM
Improved git commit and push automation with customizable commit message, remote name, and branch name with default value for each option.
@geekabhinav007 Hurray, your PR got merged 🥳. Thanks a bunch. Feel free to take another Issue.💖 |
Description
The new code uses the subprocess.run method instead of the deprecated subprocess.getoutput method. This makes the code more up-to-date and compatible with the latest version of Python.
The new code uses the result.returncode attribute to check if a command was executed successfully, instead of relying on the output of the command. This is a more robust way to check if a command succeeded or failed.
The new code prompts the user for input in a more user-friendly way, by providing default values that can be used if the user simply presses Enter.
The new code includes error handling, by printing an error message and exiting the script if any of the Git commands fail.
The new code includes more descriptive comments that explain what each line of code does, making it easier to understand and modify the script.
Fixes #1410
Type of change
Checklist:
README.md