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

Fix issue 1410: Automated Git commit script now uses subprocess.run instead of subprocess.getoutput #1433

Merged
merged 1 commit into from
Jul 25, 2023

Conversation

geekabhinav007
Copy link
Contributor

Description

  1. 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.

  2. 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.

  3. 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.

  4. The new code includes error handling, by printing an error message and exiting the script if any of the Git commands fail.

  5. 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

  • New feature (non-breaking change which adds functionality)
  • Documentation Update

Checklist:

  • My code follows the style guidelines(Clean Code) of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have created a helpful and easy to understand README.md
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests/screenshots(if any) that prove my fix is effective or that my feature works

testScreenShort

Copy link
Collaborator

@ClasherKasten ClasherKasten left a 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 to sys.exit

@geekabhinav007
Copy link
Contributor Author

@ClasherKasten please review the changes.

@geekabhinav007
Copy link
Contributor Author

geekabhinav007 commented May 29, 2023

Please Merge the Pull Request @ClasherKasten

Copy link
Collaborator

@ClasherKasten ClasherKasten left a 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.
@ClasherKasten ClasherKasten merged commit 31fd3fb into HarshCasper:master Jul 25, 2023
7 of 9 checks passed
@github-actions
Copy link

PR is not linked to any issue, please make the corresponding changes in the body. The issue should look like this. For help follow this link

@github-actions
Copy link

@geekabhinav007 Hurray, your PR got merged 🥳. Thanks a bunch. Feel free to take another Issue.💖

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

Successfully merging this pull request may close these issues.

[script request]: automated git commit script in Python
2 participants