gitlab
gitlab
“If debugging is the process of removing bugs, then programming must be the process of
putting them in.”
-Edsger Dijkstra
Instructions:
Handout instructions: Connect to Hex using your favorite ssh client and unpack the assignment into
your home directory by running the following commands:
You must run the “make init” command to prep the lab assignment. It is imperative you do so before
starting the problems.
To handin the assignment, you must run the “make handin” command while inside the “gitlab” directory.
This command will archive a copy of your lab assignment into a file called “handin.tar.gz” in the “/labs/dvga14-
2024/.handin/gitlab/student100/” folder, where student100 refers to your Canvas account. Remember that
we automate the grading; therefore, if the handin file does not exist, you will not get a grade for the lab assign-
ment. A couple of minutes after handin you will have the result of the grading in the ”gitlab-feedback.txt”
file in you home directory.
Example of handing in your lab assignment:
[student100@hex ~/gitlab]$ cd
[student100@hex researchers1]$ make && ./driver
Page 2
Problem 2: Saving the scientists by go back in time!
Excellent work; you have found the git commit! While you can smell the sweaty suspense in the command
room, you are not done yet. Your next task is determining what malicious command was added to the
offending commit.
Use the researchers1 git repository again to check out the commit you found from problem 1. You will
find the offending line in the commands.data file earmarked with a DVGA14{SECRET2} string. Write
the SECRET2 into the file gitlab/answers/problem2.txt.
Expected results:
Page 3
Problem 3: Add a commit to save the scientists
Marvelous work! While the contents of the git repository provided ample proof of foul play, you have
no time to discuss this with the suits. You are in a race against time and must fix the issue! We have
one shot at sending an updated command list to the drill before it is out of range. You have figured out
that the original command should have been R30 and that you still have time to do what you do best:
save the day!
Create a new commit in the researchers1 repository where you have to replace the malicious command
with the line “R30 DVGA14{FIXED}”. Ensure the email address in the commit is “[email protected]”,
where student100 is your username on Hex, and the commit has a fitting name with the email address.
No further action is needed. We can see the result in the repository when we grade it.
Page 4
Problem 4: Pushing the changes to really save the scientists
The scientists are still stuck underground with little food, no water, a shrinking air supply, and the
unfortunate company of one another. Now that you have found the location of the issue, it is clear that
they are very far underground but still not too far for you to update the code. The drill pulls all the
newest code directly from the central repository. Therefore, you can update the drill by pushing your
commit to the repository.
Push the commit you created in problem 3 to the “origin” external repository.
Page 5
Problem 5: Report your findings in a branch
Your Git abilities were a major success, and the president is in your debt. The command room is now
slowly starting to smell like cheap coffee, and the rambling is less stern than just a few moments ago.
However, you are still unsure whom you can trust with the information recovered from the git repository.
Therefore, you have decided to write a report in the repository before you hand it over to the correct
official.
Using the researchers2 repository, create a new branch called report. Then, add a commit with a new
file called report.txt that contains the text DVGA14{REPORT} in the newly created branch.
Page 6
Problem 6: A professional merge
Due to your professionalism, you know that working directly on the main branch is not desirable and
that professionals work in a separate git branch before merging it into the main branch when they are
done.
It is now time to merge the report branch from problem 5 with the new report.txt commit into the main
branch in the repository researchers2.
Page 7
Problem 7: The merge conflict fight
Panic has fueled the command room as the coffee smell fades away, and you start to feel an all too
familiar tense atmosphere again. Someone with access to the git central repository has managed to
overwrite the drill commands. But you will not let them take the drill without a fight!
Using the researchers3 repository, push the commits that are already there to the origin remote repos-
itory. You will get a merge conflict; resolve it using your commits.
Page 8
Problem 8: A bureaucratic reset
You did it! The drill is now updated, and the scientists have destroyed the drill’s antenna at their end
to stop more updates. You see the room dispersing in joy while you hear one of the scientists complain
while walking out of the room about how they could have just turned the network connection off instead
of destroying expensive equipment for no good reason. Suddenly, you notice that the suits have been
replaced with bureaucrats who have been droning into the room at an alarming rate. Armed with boring
documents, rules, and regulations, they force you to remove the last two commits from the repository
due to Article 5, section IV of the git repository act of 2019.
Delete the last two commits from repository4 using a hard reset. Force push the results to the remote
repository.
Page 9