aboutsummaryrefslogtreecommitdiff
path: root/tex/git-branch.tex
blob: 9a2666a47dc9ce197393e120f7f1d316fa09989a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
\begin{columns}[t]
  \column{5cm}
  \vspace{-0.4cm}

  \begin{tikzpicture}

    \draw [white] (0,0) -- (0,7.4);

    %% Template branch.
    \ifdefined\tofuture
      \draw[->, line width=2mm] (0,0) -- (0,7.3);
    \else
      \ifdefined\tempevolve
        \draw[->, line width=2mm] (0,0) -- (0,5.5);
      \else
        \draw[->, line width=2mm] (0,0) -- (0,2.3);
      \fi
    \fi

    %% Project branch.
    \ifdefined\projinit
      \draw[line width=2mm] (0,1.5) -- (1,2);
      \ifdefined\tofuture
        \draw[->, line width=2mm] (0.95,1.92) -- (0.95,7.3);
      \else
        \ifdefined\mergewithtemp
          \draw[->, line width=2mm] (0.95,1.92) -- (0.95,5.7);
        \else
          \ifdefined\projwork
            \draw[->, line width=2mm] (0.95,1.92) -- (0.95,5);
          \else
            \draw[->, line width=2mm] (0.95,1.92) -- (0.95,3);
          \fi
        \fi
      \fi
    \fi

    %% Merge link
    \ifdefined\mergewithtemp
    \draw[line width=2mm] (0,4.5) -- (0.95,5.05);
    \fi

    %% COMMITS: Note that commits have to come after the branches,
    %% otherwise the black lines are going to be over the commit
    %% circles.

    %% Template commits.
    \ifdefined\tofuture
      \foreach \y in {0.55,...,7}
      \draw [fill=green!80!blue, opacity=0.5] (0,\y) circle [radius=2.1mm];
    \else
      \ifdefined\tempevolve
        \foreach \y in {0.55,...,5}
        \draw [fill=green!80!blue, opacity=0.5] (0,\y) circle [radius=2.1mm];
      \else
        \foreach \y in {0.55,...,2.5}
        \draw [fill=green!80!blue, opacity=0.5] (0,\y) circle [radius=2.1mm];
      \fi
    \fi

    %% Project commits.
    \ifdefined\projinit
      \draw[anchor=north] (1,1.7) node {Project};

      \ifdefined\tofuture
        \foreach \y in {2,...,6}
        \draw [fill=red!60!green, opacity=0.5] (0.95,\y) circle [radius=2.1mm];
      \else
        \ifdefined\mergewithtemp
          \foreach \y in {2,...,5}
          \draw [fill=red!60!green, opacity=0.5] (0.95,\y) circle [radius=2.1mm];
        \else
          \ifdefined\projwork
            \foreach \y in {2,...,4.9}
            \draw [fill=red!60!green, opacity=0.5] (0.95,\y) circle [radius=2.1mm];
          \else
            \foreach \y in {2,...,2.9}
            \draw [fill=red!60!green, opacity=0.5] (0.95,\y) circle [radius=2.1mm];
          \fi
        \fi
      \fi
    \fi

    \draw[anchor=north] (0,0) node {Template};

    %% Happy scientist
    \ifdefined\githappy
    \node [inner sep=0pt] at (3.5,4) {\includegraphics[width=2cm]{img/happy.jpg}};
    \node [inner sep=0pt] at (4.15,5.3) {\includegraphics[width=0.2cm]{img/checkmark.png}};
    \draw[anchor=east] (2.4,6) node {\footnotesize\texttt{5cfe2eab}};
    \draw[anchor=south] (4.5,5) node [rotate=20] {\tiny\texttt{5cfe2eab}};
    \fi

  \end{tikzpicture}

  \column{8cm}
  \vspace{-5mm}
  \begin{itemize}
    \setlength\itemsep{0.3cm}
  \item Template's history is recorded.
    \ifdefined\projinit
  \item New project: a branch from the template.
    \fi
    \ifdefined\projwork
  \item Research progresses in the project branch.
    \fi
    \ifdefined\tempevolve
  \item Template will evolve (improved infrastructure).
    \fi
    \ifdefined\mergewithtemp
  \item Template can be imported/merged back into project.
    \fi
    \ifdefined\tofuture
  \item The template and project will \alert{evolve}.
    \fi
    \ifdefined\githappy
  \item During research this \alert{encourages creative tests}\\
    (previous research states can easily be retrieved).
  \item \alert{Coauthors} can work on same project in parallel
    \\(separate project branches).
  \item Upon publication, the \alert{Git hash} is enough to verify the
    integrity of the result.

    \fi
  \end{itemize}
\end{columns}