Skip to content

Conversation

@lavanyagarg112
Copy link
Contributor

@lavanyagarg112 lavanyagarg112 commented Nov 8, 2025

Exercise Review

Exercise Discussion

#69

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?

@lavanyagarg112 lavanyagarg112 marked this pull request as draft November 9, 2025 10:27
@woojiahao woojiahao added the exercise review Review a proposed exercise label Nov 10, 2025
@woojiahao woojiahao linked an issue Nov 20, 2025 that may be closed by this pull request
1 task
@VikramGoyal23
Copy link
Collaborator

@lavanyagarg112 Can you mark this pull request as "open" instead of "draft"?

@lavanyagarg112
Copy link
Contributor Author

@lavanyagarg112 Can you mark this pull request as "open" instead of "draft"?

@VikramGoyal23 Sorry for the delay, just have to fix a few bugs. Will open by the weekend. Thanks!

@lavanyagarg112 lavanyagarg112 marked this pull request as ready for review December 7, 2025 15:54
@jovnc jovnc changed the title Implement Exercise T6L2/branch-compare Implement exercise T6L2/branch-compare Dec 12, 2025
@jovnc jovnc self-assigned this Dec 12, 2025
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.

Tests and verification logic LGTM, but some changes are needed so that we can follow conventions in this repository.

Thanks for your contribution @lavanyagarg112, once the changes are made, do ping me for a re-review and we can merge the PR

},
"exercise_repo": {
"repo_type": "local",
"repo_name": "data_streams",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"repo_name": "data_streams",
"repo_name": "data-streams",


## Task

You are recording a numerical data stream from two sources. The data are stored in `data.txt`, using a different branch for each stream. The two data streams are supposed to be identical but can vary on rare occasions.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This line should be above Task


Answer the questions given in `answers.txt`.

Run `gitmastery verify` to check if your answers are correct.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Run `gitmastery verify` to check if your answers are correct.

We can remove this line

@@ -0,0 +1,5 @@
Q: Which number (write only one number) is present in branch stream-1 but not in branch stream-2?
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Q: Which number (write only one number) is present in branch stream-1 but not in branch stream-2?
Q: Which numbers are present in stream-1 but not in stream-2?

Should align with questions in issue

Q: Which number (write only one number) is present in branch stream-1 but not in branch stream-2?
A:

Q: Which number (write only one number) is present in branch stream-2 but not in branch stream-1?
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
Q: Which number (write only one number) is present in branch stream-2 but not in branch stream-1?
Q: Which numbers are present in stream-2 but not in stream-1?

commit("Add empty data.txt", verbose)
checkout("stream-1", True, verbose)

for i in orig_data:
Copy link
Collaborator

Choose a reason for hiding this comment

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

I believe it would be more efficient to create the entire string first using join, then append only once to the file to prevent too many OS syscalls


add(["data.txt"], verbose)
commit("Add data to data.txt", verbose)

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change

checkout("main", False, verbose)
checkout("stream-2", True, verbose)

for i in modified_data:
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as above

from git_autograder.answers.rules import HasExactValueRule, NotEmptyRule


QUESTION_ONE = "Which number (write only one number) is present in branch stream-1 but not in branch stream-2?"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
QUESTION_ONE = "Which number (write only one number) is present in branch stream-1 but not in branch stream-2?"
QUESTION_ONE = "Which numbers are present in stream-1 but not in stream-2?"



QUESTION_ONE = "Which number (write only one number) is present in branch stream-1 but not in branch stream-2?"
QUESTION_TWO = "Which number (write only one number) is present in branch stream-2 but not in branch stream-1?"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
QUESTION_TWO = "Which number (write only one number) is present in branch stream-2 but not in branch stream-1?"
QUESTION_TWO = "Which numbers are present in stream-2 but not in stream-1?"

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

Labels

exercise review Review a proposed exercise

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Exercise Discussion] T6L2/branch-compare

4 participants