Commit 7b8a2ce4 authored by Tomas Tomecek's avatar Tomas Tomecek
Browse files

init spring 2025 repo



base: `git reset c007a4b4`

Signed-off-by: default avatarTomas Tomecek <ttomecek@redhat.com>
parent c007a4b4
Loading
Loading
Loading
Loading

LICENSE

0 → 100644
+21 −0
Original line number Diff line number Diff line
MIT License

Copyright Contributors to the Mastering Git project.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

LICENSE.materials

0 → 100644
+3 −0
Original line number Diff line number Diff line
The teaching materials are licensed under CC BY 4.0.

https://creativecommons.org/licenses/by/4.0/?ref=chooser-v1
+137 −20
Original line number Diff line number Diff line
@@ -10,9 +10,9 @@ collaborative software development. During this course you will learn unique
benefits and concepts of [Git](https://git-scm.com/) as well as its core features via extensive
examples and hands-on exercises. We hope you will develop the joy of working
with it. This course doesn’t require any prior knowledge of Git and is perfect
for anyone who wants a jump start in learning it. If you already have some
experience with Git, then this course will make you an expert, since it gives a
deep look at the fundamental commands.
for anyone who wants a jump start in learning it. For those with prior Git
experience, this course is designed to refine and expand your skills, featuring
hands-on applications that will make your life easier.

## Objective
During this course you will learn unique benefits and concepts of Git as well
@@ -23,8 +23,9 @@ like to work on a Git project where multiple people contribute: this is what we
experience in our jobs every day.

## Lectors
* Irina Gulina (Senior Software Quality Engineer)
* [Tomáš Tomeček](https://github.com/TomasTomecek) (Senior Principal Software Engineer)
* 2022-2023: Irina Gulina (Principal Software Quality Engineer)
* 2022-2025: [Tomáš Tomeček](https://github.com/TomasTomecek) (Senior Principal Software Engineer)
* 2024-2025: Michal Hečko (Software Engineer)

You can learn more about this course in an interview with the lectors: [Red Hat
Research: Mastering Git with university
@@ -33,15 +34,16 @@ students](https://research.redhat.com/blog/2023/02/28/mastering-git-with-univers
And another interview with students:
[Intern Spotlight: Red Hat course helps students unleash the power of Git](https://research.redhat.com/blog/2023/09/11/intern-spotlight-red-hat-course-helps-students-unleash-the-power-of-git/)

## Next run
Autumn 2023 at FI MUNI Brno as part of PV177 Laboratory of Advanced Network Technologies
## Spring 2025 edition
We are teaching this course in the Spring of 2025 at FI MUNI Brno as part of PV177
Laboratory of Advanced Network Technologies.

The course is open to all students: Bc, Mgr and PhD.

This would be the second run. The first one happened in Autumn 2022.
We have one seminar group open.

**IS course info**: https://is.muni.cz/predmet/fi/podzim2023/PV177  
**Lecture time**: Group 1 10:00-11:40, Group 2 12:00-13:40
**IS course info**: https://is.muni.cz/predmet/fi/jaro2025/PV177  
**Lecture time**: Tuesday 14:00-16:00  
**Lecture room**: FI MU S505 Red Hat lab at Faculty of Informatics, Masaryk University (S505, note that the room is only available during lecture time)  
**Grading**: successfully complete 5 mandatory homeworks, or 4/5 homeworks plus a bonus task  
**ECTS Credits**: 2  
@@ -50,21 +52,21 @@ This would be the second run. The first one happened in Autumn 2022.
* Be comfortable in a command-line environment.
* Understand basic programming concepts.
* Understand basic Computer Science concepts.
* Linux-based operating system is a big plus. You may get bonus points for Fedora Linux 😇
* Linux-based operating system is a big plus.

## Homeworks

Homeworks are outdated and will be improved in the coming weeks.

### Requirements after first class

* Fork this repository
* Upload SSH keys to your account
* Comment your UCO in an issue in this repo for your respective group:
  0. https://gitlab.com/redhat/research/mastering-git/-/issues/2
  1. https://gitlab.com/redhat/research/mastering-git/-/issues/3
* Comment your UCO in issue [#11](https://gitlab.com/redhat/research/mastering-git/-/issues/11) so we can pair your GitLab account with your UCO for HW evaluation.

### Class 2 homework

**Deadline**: 11. October 2023, 23:59
**Deadline**: XX. February 2025, 23:59

* Create a new file in `class2_homework/` subdirectory of this repository with
  a name `<UCO>.txt`. Content of the file is up to you: it can be your
@@ -96,13 +98,128 @@ My favourite book series now is from Jeffery Deaver: Lincoln Rhyme.

### Class 3 homework

**Deadline**: 18. October 2023, 23:59
**Deadline**: XX. XXX 2025, 23:59

The outcome of class 3 homework will be a merge request in this repository.
It's similar as class 2 homework, except we want a merge request this time and
it needs to be merged.

- Create a new file in `class3_homework/` subdirectory of this repository with
  a name `<UCO>.txt`. Tell us what you enjoy so far on the course, what new you
  have learned and used already. We'd also appreciate if something is missing.
- Make sure the merge request complies with all the best practices from the class.
- You have to create the merge request in this upstream repository. Merge
  requests in forks (origin remote) will be ignored.
- Tomas and Irina will review all upstream merge requests: you may be asked to
  correct something.
- Your merge request needs to be merged to pass this class.
- After you've done all of the above, save your command history, especially all
  `git` binary invocations. Put the history in a new file `<UCO>_commands.txt`
  and place it in the same directory and the same branch, commit it and push
  it. We want to see how you use git so we're sure we're teaching effectively.
  If you are asked to change something, no need to account for these commands.


### Class 4 homework

**Deadline**: XX. XXX 2025, 23:59

Resolving merge conflicts is fun, right? Let's do some of that.

We have an old outdated branch in this upstream repository that someone worked
on long time ago. There are some valuable changes in there, while some content
is likely outdated.

**Task**: rebase `upstream/class4-hw-problem` against `upstream/main-oct-9`.
Create a merge request against `upstream/main-oct-9` from your fork from branch
`class4-hw-problem` with your proposal. You'll pass this HW once your MR is
approved.

- There will be merge conflicts in README.md and it's up to you to resolve
  them. Use your best judgement to pick changes you like and discard those that
  are outdated. There is no best solution here, we will review all MRs individually.
- Make sure there are **NO** merge conflict artifacts in your MR (such as `+<<<<<<< HEAD`).
- You have to create the merge request in this upstream repository. Merge
  requests in forks (origin remote) will be ignored.
- Make sure the merge request complies with all the best practices from the class.
- Hint: commit message may need some updating. (no need to worry about commit
  authorship)
- After you're done with the rebase process, save your command history,
  especially all `git` binary invocations. Put the history in a new file
  `<UCO>_commands.txt` inside `class4_homework/` directory.  Commit and push
  the file into the MR. If you are asked to change something, no need to
  account for these commands in the history file.
- Tomas and Irina will review all upstream merge requests: you may be asked to
  correct something.

### Class 5 homework

**Deadline**: XX. XXX 2025, 23:59

- Pair with any student from your class. If you did a similar lab in a class, please switch roles and be Student #1 or #2 accordingly. 
- Student #1 shares any git repo (any “Example”, but not Mastering git) with Student #2 and Irina/Tomas.
- Student #2 makes a contribution to an existing file inside Student's #1 git repo by opening a MR.
- Student #1 will push a change to the repo ("Example") that will cause a merge conflict in Student's #2 MR
- Student #2 resolves the merge conflict.
- After conflict is resolved, Student #1 asks to change something else in the MR. Based on a requested change, Student #2 needs to do a rebase again or add an additional commit. 
- MR should be merged in the end and or rejected/closed if no positive value.
- Afterwards, Student #1 makes any contribution to their own (“Example”) repo via MR, and Student #2 needs to process it accordingly.
- Both students shall mind/practise/demonstrate best Git practices on commits and MR.
- All MRs during this HW should also contain a file (in a separate commit) with a shell history. In a case of rebase / new MR change, a new history file should be attached accordingly. So, in the end, each MR may contain several commits demonstrating git history. 
- In a case of any troubles tag us on a MR to help, or just share what difficulties you had in MR conversations, so we can address the most common troubles on the last git class.

### Class 6 homework

**Deadline**: XX. XXX 2025, 23:59

The last homework consists of two parts.

Part 1: Please fill the questionnaire about the Mastering Git course: https://forms.gle/cL2bbTbKp6GfvQTn9
Partially it comes from the university faculty, partially - from us. We will truly appreciate you being honest. 

Part 2: Questions to answer
1. How many commits were merged into main between September 1st and October 30th 2023?
2. Who authored commit “Merge branch 'hw03' into 'main'” and what is the commit body?
3. Find one commit that you think should have better title or body and tell us how and why?
  - If you are the author, that’s amazing :)
4. Show us a commit that DID NOT change README.md in the month of September?
5. How many unique contributors the repository has at October 31st?
6. How many commits differ between main and main-oct-9?
7. Which commit added this line?
  `**Grading**: successfully complete 5 mandatory homeworks, or 4/5 homeworks plus a bonus task`

#### How to submit this homework?
- Name your branch `class6-homework`.
- Push a single commit with answers in your fork of mastering-git in a text file `<UCO>.txt` in `class6_homework/` directory.
- Do NOT create an MR (not a mistake though).
- For every question, send us all commands you ran to find out the answer.
The `<UCO>.txt` file syntax:
```
# Question 1
command 1
command 2
Answer/Text comment
---
# Question 2
command 2
Answer
---
Question 3
...
```

We're gonna create some more MRs!
Example:
```
$ cat class6_homework/123456.txt
# Question 1
git foo
git --bar
42
---
Question 2
...
```

* [prep] we need to create up front some content that is not valid so people can fix it
* Find a pair & review each others contributions
* There needs to be at least a single interaction: explanation, clarification, request for changes

### Bonus Task

lab-playbook.yaml

0 → 100644
+46 −0
Original line number Diff line number Diff line
# SPDX-License-Identifier: MIT
---
# requires 'ansible' RPM as it contains the podman module, `ansible-core` is not enough sadly.
# requires rootless podman: https://github.com/containers/podman/blob/main/docs/tutorials/rootless_tutorial.md
#   the alternative is to run podman as root, this playbook doesn't support that right now
# usage: ansible-playbook -i localhost -c local ./lab-playbook.yaml
#        podman attach git-container (and hit <enter> afterwards to get new prompt)
- name: 'Start a container for a class lab with git, its manpages, personal SSH key and shell completion'
  hosts: localhost
  vars:
    # name of the container for the lab
    container_name: git-container
    # path to your SSH key which will be copied in the container to /root/.ssh/
    private_ssh_key_path: ~/.ssh/id_rsa
  tasks:
  - name: 'Create a fresh container'
    containers.podman.podman_container:
      image: "fedora:41"
      name: git-container
      state: started
      command: bash
      tty: true
      interactive: true
  - name: 'Enable installing manpages'
    ansible.builtin.command: podman exec {{ container_name }} sed -i /etc/dnf/dnf.conf -e /^tsflags/d
  - name: 'Install git-core and git-core-man'
    ansible.builtin.command: podman exec {{ container_name }} dnf install -y git-core git-core-doc bash-completion
  - name: 'Create /root/.ssh'
    ansible.builtin.command: podman exec {{ container_name }} mkdir -p /root/.ssh/
  - name: 'Set correct perms to /root/.ssh'
    ansible.builtin.command: podman exec {{ container_name }} chmod 0700 /root/.ssh/
  - name: 'Make sure the SSH key exists'
    ansible.builtin.stat:
      path: '{{ private_ssh_key_path }}'
    register: ssh_key_stat
  - ansible.builtin.debug:
      msg: "The configured SSH doesn't exist, please set var `private_ssh_key_path` at the top of this playbook"
    when: not ssh_key_stat.stat.exists
  - name: 'Copy my SSH key inside [CAREFUL!]'
    ansible.builtin.command: podman cp {{ private_ssh_key_path }} {{ container_name }}:/root/.ssh/
  - name: 'Copy my pub SSH key inside'
    ansible.builtin.command: podman cp {{ private_ssh_key_path }}.pub {{ container_name }}:/root/.ssh/
  # TODO: git config --global user.name '$user' git config --global user.email
  # the beast below doesn't work, but bash completion works by just installing bash-completion package
  # - name: 'Enable bash completion and a git prompt'
  #   ansible.builtin.command: podman exec {{ container_name }} printf >/root/.bash_profile 'source /usr/share/bash-completion/completions/git\nexport PS1=[\u@\h \w $(__git_ps1 " (%s)")]#\n'
+920 KiB

File added.

No diff preview for this file type.

Loading