Skip to content

Conversation

@keerthigkaarthik
Copy link
Contributor

Exercise Review

Exercise Discussion

#66

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 the download script using test-download.sh?
  • 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?

@keerthigkaarthik keerthigkaarthik changed the title Add exercise branch forward Implement exercise branch forward Nov 17, 2025
@keerthigkaarthik keerthigkaarthik changed the title Implement exercise branch forward Implement exercise T6L2/branch-forward Nov 17, 2025
@woojiahao woojiahao self-assigned this Nov 20, 2025
@woojiahao woojiahao added exercise review Review a proposed exercise discussing labels Nov 20, 2025
@woojiahao woojiahao linked an issue Nov 20, 2025 that may be closed by this pull request
1 task
Copy link
Member

@woojiahao woojiahao left a comment

Choose a reason for hiding this comment

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

Left a preliminary question about the autograding schema! I'll review the unit tests when we flesh out the autograding

Copy link
Contributor

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

Some comments on verification process.

@@ -0,0 +1,26 @@
# branch-forward

You are outlining a story and experimenting with different plotlines. Each version lives on its own branch, and you now need to fold the right storyline back into `main` without cluttering the history.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think that the README.md should align with the instructions for students inside the issue as much as possible, not sure if we are supposed to add additional information.

Image

raise exercise.wrong_answer([ONLY_WITH_SALLY_MERGED])

return exercise.to_output(
["Great job fast-forward merging only 'with-sally' and cleaning up the branch!"],
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we remove 'cleaning up the branch', as it seems to be redundant and can also add to confusion (can be implied as expecting with-sally branch to be deleted)?


def verify(exercise: GitAutograderExercise) -> GitAutograderOutput:
main_branch = exercise.repo.branches.branch("main")
merge_logs = [
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel like using reflog for verification might be too restrictive here.

Consider the following scenario: User merges wrong branch, then undoes it, then correctly merges with-sally

git merge with-ginny --ff          # Wrong merge
git reset --hard HEAD^        # Undo the merge  
git merge with-sally --ff          # Correct merge

The reflog retains history even after reset.

This means that even after the student correctly recovers from his/her mistake, he will still likely fail the test at line 36.

if any(branch != "with-sally" for branch in merged_branches):
        raise exercise.wrong_answer([ONLY_WITH_SALLY_MERGED])

@jovnc
Copy link
Contributor

jovnc commented Dec 6, 2025

Hi @keerthigkaarthik , is this PR currently being worked on?

Would be good to get an update by 9 Dec, else we need to close this PR, so that we can resolve this issue. Thanks!

@keerthigkaarthik
Copy link
Contributor Author

keerthigkaarthik commented Dec 6, 2025 via email

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

Labels

discussing exercise review Review a proposed exercise

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Exercise Discussion] T6L2/branch-forward

3 participants