Skip to content

[Exercise Discussion] T6L2/branch-compare #69

@damithc

Description

@damithc

Existing exercise check

Lesson

https://nus-cs2103-ay2526s1.github.io/website/book/gitAndGithub/merge/index.html (see detour: Comparing Branches)

Exercise learning outcomes

Able to compare branches

Exercise setup

Inputs to the new.sh:

Exercise name: branch-compare
Tags (space separated): git-branch git-diff
Requires Git? (defaults to y)  [y/N]: y
Requires Github? (defaults to y)  [y/N]: N
Exercise repo type (local, remote, or ignore) (defaults to 'local'): local
Exercise repo name (defaults to ...): data-streams
Git-Mastery Github repository title (defaults to ''): 
Initialize exercise repo as Git repository? (defaults to y)  [y/N]: Y

Equivalent steps to populate the repo

touch data.txt
git add .
git commit -m "Add empty data.txt"

git switch -c stream-1 main
git switch -c stream-2 main

While on stream-1 branch, update the data.txt with a series of 1000 unique random numbers e.g.,

23870345
70234785
74384345
76408762
...

Switch to stream-2 branch and put the same sequence of numbers in data.txt but with one different number.

Instructions for students

Scenario: 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.

Task:

Q: Which numbers are present in stream-1 but not in stream-2?
Q: Which numbers are present in stream-2 but not in stream-1?

Exercise grading

Verify the answers are correct

Requires remote repository?

No response

Additional remarks

No response

Metadata

Metadata

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions