Skip to content

Implement T8L4/glossary-branch-rename#243

Merged
jovnc merged 22 commits intogit-mastery:mainfrom
SAN-MUYUN:exercise/glossary-branch-rename
Feb 4, 2026
Merged

Implement T8L4/glossary-branch-rename#243
jovnc merged 22 commits intogit-mastery:mainfrom
SAN-MUYUN:exercise/glossary-branch-rename

Conversation

@SAN-MUYUN
Copy link
Contributor

@SAN-MUYUN SAN-MUYUN commented Jan 20, 2026

Exercise Review

Exercise Discussion

Fixes #239

Checklist

  • If you require a new remote repository on the Git-Mastery organization, have you created a request for it?
  • Have you written unit tests using repo-smith to validate the exercise grading scheme?
  • Have you tested your changes using the instructions posted?
  • Have you verified that this exercise does not already exist or is not currently in review?
  • Did you introduce a new grading mechanism that should belong to git-autograder?
  • Did you introduce a new dependency that should belong to app?

@github-actions
Copy link

Hi @SAN-MUYUN, thank you for your contribution! 🎉

This PR comes from your fork SAN-MUYUN/git-mastery-exercises on branch exercise/glossary-branch-rename.

Before you request for a review, please ensure that you have tested your changes locally!

Important

The previously recommended way of using ./test-download.py is no longer the best way to test your changes locally.

Please read the following instructions for the latest instructions.

Prerequisites

Ensure that you have the gitmastery app installed locally (instructions)

Testing steps

If you already have a local Git-Mastery root to test, you can skip the following step.

Create a Git-Mastery root locally:

gitmastery setup

Navigate into the Git-Mastery root (defaults to gitmastery-exercises/):

cd gitmastery-exercises/

Edit the .gitmastery.json configuration file. You need to set the following values under the exercises_source key.

{
    # other fields...
    "exercises_source": {
        "username": "SAN-MUYUN",
        "repository": "git-mastery-exercises",
        "branch": "exercise/glossary-branch-rename"
    }
}

Then, you can use the gitmastery app to download and verify your changes locally.

gitmastery download <your new change>
gitmastery verify

Checklist

  • (For exercises and hands-ons) I have verified that the downloading behavior works
  • (For exercises only) I have verified that the verification behavior is accurate

Important

To any reviewers of this pull request, please use the same instructions above to test the changes.

@SAN-MUYUN SAN-MUYUN marked this pull request as draft January 20, 2026 14:10
@jovnc
Copy link
Collaborator

jovnc commented Jan 20, 2026

@SAN-MUYUN Do follow the naming conventions of pull requests as they will be used for squash merge, will help us maintain a clean commit history, thank you!

@SAN-MUYUN SAN-MUYUN changed the title Implement Exercise/glossary branch rename [Exercise: glossary-branch-rename] T8L4. Renaming Branches in a Remote Jan 20, 2026
@SAN-MUYUN
Copy link
Contributor Author

@jovnc thanks for the reminder! Should I open the PR for review now? Or wait until we are ready to implement the test_verify for this exercise?

@jovnc
Copy link
Collaborator

jovnc commented Jan 20, 2026

@SAN-MUYUN Feel free to mark as ready, though we will only merge in once test_verify is implemented

@SAN-MUYUN SAN-MUYUN marked this pull request as ready for review January 20, 2026 14:59
@jovnc jovnc changed the title [Exercise: glossary-branch-rename] T8L4. Renaming Branches in a Remote Implement T8L4/glossary-branch-rename Jan 27, 2026
@jovnc
Copy link
Collaborator

jovnc commented Jan 27, 2026

@SAN-MUYUN I'll review this once tests are ready

@SAN-MUYUN SAN-MUYUN marked this pull request as draft January 29, 2026 08:02
@SAN-MUYUN SAN-MUYUN marked this pull request as ready for review January 30, 2026 05:09
@SAN-MUYUN
Copy link
Contributor Author

@jovnc The tests are ready, feel free to review

UPSTREAM_REPO = "git-mastery/samplerepo-funny-glossary"

username = get_github_username(verbose)
assert username is not None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assertion is unnecessary, assertions should be for developer mistake, get_github_username could fail if gh cli fails

# directory after setting up "remote" repo, and proceed with "local" repo
root_path = os.getcwd()

remote_worktree_dir = rs_remote.repo.working_tree_dir
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be unnecessary now, why not just set rs_remote as the origin remote of rs first, then push the necessary updates from rs to rs_remote?

@SAN-MUYUN
Copy link
Contributor Author

@jovnc Thanks for the input! I have made the relevant changes.

Copy link
Collaborator

@jovnc jovnc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, helped to remove an unnecessary os import (but my ruff auto formatter also ran), so I guess I also helped to format the code for test_verify.py

Thanks for the work @SAN-MUYUN will merge it in now

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM verified that it works as expected

Image

@jovnc jovnc merged commit bd4aee6 into git-mastery:main Feb 4, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Exercise: glossary-branch-rename] T8L4. Renaming Branches in a Remote

2 participants