Skip to content
This repository was archived by the owner on Jul 2, 2024. It is now read-only.
57 changes: 57 additions & 0 deletions .github/workflows/build_pdf.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Simple workflow for deploying static content to GitHub Pages
name: Build PDF documents

on:
# Runs on pushes targeting the default branch
push:
branches:
- devel
pull_request:
branches:
- devel

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow one concurrent deployment
concurrency:
group: "pages"
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: true
- name: Setup Python
uses: actions/setup-python@v2
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y latexmk texlive-xetex
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Generate PDF documents
run: |
LANGUAGE=en make pdf
LANGUAGE=uk make pdf
- name: Copy generated documents to artifacts directory
run: |
mkdir pdf-docs
cp _build/latex/en/*.pdf pdf-docs
cp _build/latex/uk/*.pdf pdf-docs
- name: Upload PDF as artifacts
uses: actions/upload-artifact@v2
with:
name: pdf-docs
path: pdf-docs
Binary file added assets/mermaid/git/cherry-pick.mmd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/mermaid/git/commits.mmd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/mermaid/git/gitflow.mmd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/mermaid/git/lifecycle.mmd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/mermaid/git/merge-1.mmd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/mermaid/git/merge-2.mmd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/mermaid/git/rebase-1.mmd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/mermaid/git/rebase-2.mmd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/mermaid/git/states.mmd.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/spec/blog
Submodule blog updated from 6e7cbc to 7432eb
2 changes: 1 addition & 1 deletion src/spec/giver
Submodule giver updated from 858138 to b06b9d
2 changes: 1 addition & 1 deletion src/spec/libms
Submodule libms updated from a1762d to 20ce2e
13 changes: 11 additions & 2 deletions src/vcs/basics.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,18 @@ Remember that each file in your working directory can be in one of two states:
Untracked basically means that Git sees a file you didn't have in
a previous snapshot (commit), and which hasn't been yet staged.

.. mermaid:: /../assets/mermaid/git/lifecycle.mmd
.. only:: html

.. mermaid:: /../assets/mermaid/git/lifecycle.mmd
:align: center
:caption: The lifecycle of the status of repo's files

.. only:: latex

.. figure:: /../assets/mermaid/git/lifecycle.mmd.png
:align: center
:caption: The lifecycle of the status of repo's files

The lifecycle of the status of repo's files

Checking out status of the file(s)
----------------------------------
Expand Down
106 changes: 84 additions & 22 deletions src/vcs/branch.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,18 @@ zero parents for the initial commit, one parent for a normal commit,
and multiple parents for a commit that results from a merge of two or more
branches.

.. mermaid:: /../assets/mermaid/git/commits.mmd
:align: center
:caption: Commits tree
.. only:: html

.. mermaid:: /../assets/mermaid/git/commits.mmd
:align: center
:caption: Commits tree

.. only:: latex

.. figure:: /../assets/mermaid/git/commits.mmd.png
:align: center

Commits tree

A branch in Git is simply a lightweight movable pointer to one of these
commits. The default branch name in Git is master. As you start making commits,
Expand All @@ -33,7 +42,6 @@ Every time you commit, the master branch pointer moves forward automatically.
.. figure:: /../assets/img/git-commits.svg
:align: center


Branch management
=================

Expand Down Expand Up @@ -156,9 +164,18 @@ last commit on ``master`` branch, Git simply moves the pointer forward.
Changes from ``feature/issue53`` are now in the snapshot of the commit pointed
to by the ``master`` branch.

.. mermaid:: /../assets/mermaid/git/merge-1.mmd
:align: center
:caption: Fast-forward merge
.. only:: html

.. mermaid:: /../assets/mermaid/git/merge-1.mmd
:align: center
:caption: Fast-forward merge

.. only:: latex

.. figure:: /../assets/mermaid/git/merge-1.mmd.png
:align: center

Fast-forward merge

Now, lets assume another developer started working on ``feature/issue54`` at
the same time. And there are few commits on this feature branch. Suppose,
Expand Down Expand Up @@ -188,9 +205,18 @@ that results from this three-way merge and automatically creates a new commit
that points to it. This is referred to as a *merge commit*, and is a special in
that it has more than one parent.

.. mermaid:: /../assets/mermaid/git/merge-2.mmd
:align: center
:caption: Merge commit
.. only:: html

.. mermaid:: /../assets/mermaid/git/merge-2.mmd
:align: center
:caption: Merge commit

.. only:: latex

.. figure:: /../assets/mermaid/git/merge-2.mmd.png
:align: center

Merge commit

Merge conflicts
---------------
Expand Down Expand Up @@ -271,9 +297,18 @@ the ``merge`` and the ``rebase``.
Earlier, there was an example of diverged work and commits made on two
different branches.

.. mermaid:: /../assets/mermaid/git/rebase-1.mmd
:align: center
:caption: Before rebase
.. only:: html

.. mermaid:: /../assets/mermaid/git/rebase-1.mmd
:align: center
:caption: Before rebase

.. only:: latex

.. figure:: /../assets/mermaid/git/rebase-1.mmd.png
:align: center

Before rebase

The easiest way to integrate the branches, as we've already covered, is
the ``merge`` command. It performs a three-way merge between the two latest
Expand All @@ -298,9 +333,18 @@ those diffs to temporary files, resetting the current branch to the same
commit as the branch you are rebasing onto, and finally applying each change
in turn.

.. mermaid:: /../assets/mermaid/git/rebase-2.mmd
:align: center
:caption: After rebase
.. only:: html

.. mermaid:: /../assets/mermaid/git/rebase-2.mmd
:align: center
:caption: After rebase

.. only:: latex

.. figure:: /../assets/mermaid/git/rebase-2.mmd.png
:align: center

After rebase

.. note::
Other maintainers prefer to rebase (or cherry-pick) contributed work on
Expand All @@ -318,9 +362,18 @@ of commits on a topic branch and you want to integrate only one of them,
or if you only have one commit on a topic branch and you'd prefer to
cherry-pick it rather than run rebase.

.. mermaid:: /../assets/mermaid/git/cherry-pick.mmd
:align: center
:caption: Cherry-pick a commit
.. only:: html

.. mermaid:: /../assets/mermaid/git/cherry-pick.mmd
:align: center
:caption: Cherry-pick a commit

.. only:: latex

.. figure:: /../assets/mermaid/git/cherry-pick.mmd.png
:align: center

Cherry-pick a commit

::

Expand Down Expand Up @@ -368,6 +421,15 @@ new features and bug fixes are integrated smoothly before being released.
This strategy is particularly useful for projects with regular releases and
a team working on multiple features concurrently.

.. mermaid:: /../assets/mermaid/git/gitflow.mmd
:align: center
:caption: GitFlow diagram
.. only:: html

.. mermaid:: /../assets/mermaid/git/gitflow.mmd
:align: center
:caption: GitFlow diagram

.. only:: latex

.. figure:: /../assets/mermaid/git/gitflow.mmd.png
:align: center

GitFlow diagram
9 changes: 7 additions & 2 deletions src/vcs/intro.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,15 @@ Git has three main states that your files can reside in:
to go into your next commit snapshot.
- Committed means that the data is safely stored in your local database.

.. mermaid:: /../assets/mermaid/git/states.mmd
:align: center
.. only:: html

.. mermaid:: /../assets/mermaid/git/states.mmd
:align: center

.. only:: latex

.. figure:: /../assets/mermaid/git/states.mmd.png
:align: center

The basic Git workflow goes something like this:

Expand Down