Institute of Computer Science
  1. Courses
  2. 2018/19 spring
  3. Collaboration Tools in Software Engineering (LTAT.05.009)
ET
Log in

Collaboration Tools in Software Engineering 2018/19 spring

  • Main
  • Lessons
  • Resources

Practice 5: Troubleshooting

By the end of this practice, you will know how to

  1. Manually resolve simple merge conflicts
  2. Use the git blame and git bisect tools to inspect history of files

Setup

This time, everybody will be contributing to the same repository. You will get access to a repository that was created for this practice. If you don't have access to push to the repository, write to the instructor.

Because we're working with a public repository and collaborating with others, let's enforce good practices and do all work in a separate branch. Make new commits as often as you think is useful and try to write informative commit messages.

  1. Clone the repository for this practice: https://github.com/Stopa/cse-prac5-troubleshooting
  2. Create a new branch, name it after yourself (your last name) and switch to it. Make sure you are on your own branch, not on master
  3. Create a new directory with your last name and create a file answers.txt in it.

Tracing changes

Use the tools introduced in lecture to answer the following questions and write the answers to your answers.txt file:

  1. How many commits have been made in this repository?
  2. What is the SHA-1 hash of the last commit that changed the line containing the <title> tag in the index.html file?
  3. How many different commits can you see in the blame output for index.html?
  4. All of the lines in style.css have stayed the same since the beginning of the repository, except one. What is that line?

Finding the source of an issue

The repository contains a file called image.png. It is a simple rectangle. At the latest state of the repository, the image is light purple, but at the beginning it was black. Use the git bisect to find the SHA-1 of the first commit where the image was not black

  1. Use git bisect start to start bisecting. Use git bisect bad to tell Git that current state is "broken" (image is not black).
  2. Use git bisect good <hash> with the SHA-1 hash of the first commit in the repository (use git history alias introduced previously, git log or some other tool to view repository history) to tell Git that the first commit was "good" (image was black)
  3. Git will check out a commit between those. Open image.png. If it's black, use git bisect good to say that at that state, the image was "good" (black). If it's not black, use git bisect bad to tell Git that at that point the image was already "bad" (not black).
  4. Repeat the process until you find the first "bad" commit.
  5. Use git bisect reset to go to where you were you were before bisecting.
  6. Write the SHA-1 hash of the first "bad" commit that you found into your answers.txt file.

Conflicts and resolutions

In this part, we create a situation similar to the example shown in lecture and solve the emerging conflict. Also everybody contributes to the same file, so for some people adding their name will create a conflict that they will have to solve (some lucky people may not need to deal with a conflict at that stage).

  1. Write your name on a new line in the names.txt file
  2. Copy the style.css file to your own directory
  3. Create a new branch (from your own branch, not from master)
  4. On the newly created branch, in file style.css that you copied to your directory, change the value of line 8 to be "margin: 20px 10px;"
  5. Commit the changes and go back to the branch you created at the beginning of the practice and change the value of the same line to be "margin: 30px;"
  6. Merge the new branch into your branch. Resolve merge conflicts. You can choose to accept "ours", "theirs" or propose something different, as you see fit.
  7. Go back to master branch and do git pull
  8. Merge your branch into master. On this step, there may be conflicts, because other students are also adding their names into names.txt file. If you encounter merge conflicts, resolve them in a way that doesn't delete anyone's name.
  9. Push the changes to the repository. If Git tells says that you don't have access, talk to the instructor.

This time, there is no need to send the link to the repository to the instructor. Just make sure your changes are pushed to the repository.

Don't forget to fill the Quiz!

  • Institute of Computer Science
  • Faculty of Science and Technology
  • University of Tartu
In case of technical problems or questions write to:

Contact the course organizers with the organizational and course content questions.
The proprietary copyrights of educational materials belong to the University of Tartu. The use of educational materials is permitted for the purposes and under the conditions provided for in the copyright law for the free use of a work. When using educational materials, the user is obligated to give credit to the author of the educational materials.
The use of educational materials for other purposes is allowed only with the prior written consent of the University of Tartu.
Terms of use for the Courses environment