-
Notifications
You must be signed in to change notification settings - Fork 25
Implement hands on hp-force-push #116
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
base: main
Are you sure you want to change the base?
Conversation
woojiahao
left a comment
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.
This is pending comments from @damithc but I think we won't need to fork the repository
hands_on/force_push.py
Outdated
| """ | ||
| hp-force-push (T4L5) | ||
| - Fork https://github.com/git-mastery/samplerepo-things to user account as "samplerepo-things-force-push" | ||
| - Clone the fork locally as 'samplerepo-things' |
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.
Don't need this comment
hands_on/force_push.py
Outdated
| gh_username = run_command(["gh", "api", "user", "-q", ".login"], verbose) | ||
| if not gh_username: | ||
| raise RuntimeError("Your Github CLI is not setup correctly") |
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.
This is what __requires_github__ does, so this is not necessary
| run_command( | ||
| [ | ||
| "gh", | ||
| "repo", | ||
| "fork", | ||
| UPSTREAM_REPO, | ||
| "--default-branch-only", | ||
| "--fork-name", | ||
| REPO_NAME, | ||
| "--clone=true", | ||
| "--", | ||
| WORK_DIR, | ||
| ], | ||
| verbose, | ||
| ) |
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.
This is pending comments from @damithc on the original hands-on discussion, but I don't think we need to fork the repository, cloning using git should be sufficient
hands_on/force_push.py
Outdated
| if not work_dir.is_dir(): | ||
| raise RuntimeError("Fork/clone failed") |
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.
run_command would already catch if the command errors out
Exercise Review
Exercise Discussion
#108
Checklist
Git-Masteryorganization, have you created a request for it?repo-smithto validate the exercise grading scheme?test-download.sh?git-autograder?app?