From 3730c95b4d0f2e7dab1d28ad9c48660edd00dd41 Mon Sep 17 00:00:00 2001
From: Christian Krause <christian.krause@idiv.de>
Date: Wed, 30 May 2018 17:40:22 +0200
Subject: [PATCH] wip

---
 basics.html             | 394 ++++++++++++++++++++++++++++++++++++----
 img/Makefile            |   4 +-
 img/git-remote-solo.dot |  26 +++
 img/license-chooser.dot |  37 ++++
 img/staging-area.dot    |  22 +++
 5 files changed, 447 insertions(+), 36 deletions(-)
 create mode 100644 img/git-remote-solo.dot
 create mode 100644 img/license-chooser.dot
 create mode 100644 img/staging-area.dot

diff --git a/basics.html b/basics.html
index 1793b0a..52eef44 100644
--- a/basics.html
+++ b/basics.html
@@ -15,11 +15,13 @@
   </head>
 
   <body>
-
-    <!-- start of slides -->
-
     <div class="reveal">
       <div class="slides">
+
+        <!---------------------------------------------------------------------
+        <!-- intro
+        <!-------------------------------------------------------------------->
+
         <section>
           <section id="title" data-markdown>
             # git basics
@@ -58,7 +60,7 @@
             1.  use git in **ALL** your projects
             2.  collaborate with each other
 
-            ... that is mission accomplished.
+            ... is mission accomplished.
 
             notes:
             - there is time for fancy stuff later
@@ -67,7 +69,7 @@
             - growing pain is how we learn
           </section>
 
-          <section id="intro-you" data-markdown>
+          <section id="intro-about-you" data-markdown>
             ## about you
 
             ![people](img/people.jpg)
@@ -78,7 +80,7 @@
           <section id="intro-about-git" data-markdown>
             ## about git
 
-            1.  **records changes to a repository**
+            1.  **records changes to a *repository***
 
                 content, who, when, message
             2.  **best tool for the job**
@@ -92,6 +94,10 @@
           </section>
         </section>
 
+        <!---------------------------------------------------------------------
+        <!-- motivation
+        <!-------------------------------------------------------------------->
+
         <section>
           <section id="motivation" data-markdown>
             # motivation
@@ -104,6 +110,11 @@
             ### avoid mess
 
             ![blah](img/draft_mess.png)
+
+            notes:
+            - who has seen such a mess?
+            - who has contributed to such a mess?
+            - who has created such a mess?
           </section>
 
           <section id="motivation-want-structure" data-markdown>
@@ -111,6 +122,9 @@
             ### want structure
 
             ![blah](img/gitk-pretty-history.png)
+
+            notes:
+            - TODO better repo with more contributors
           </section>
 
           <section id="motivation-playground" data-markdown>
@@ -131,7 +145,7 @@
             ## motivation #3
             ### collaboration made easy
 
-            <!-- do not fix this typo -->
+            <!-- do not fix this typo, it's here on purpose to show collab -->
             > This text cuntains a typo.
 
             notes:
@@ -190,86 +204,398 @@
             ### automation
 
             - software testing
+            - code quality
             - build app and deploy to app store
             - put presentation on web server
 
             *(see advanced seminar)*
+
+            notes:
+            - basically, everything you can script
           </section>
         </section>
 
+        <!---------------------------------------------------------------------
+        <!-- basic command line usage
+        <!-------------------------------------------------------------------->
+
         <section>
-          <section id="start" data-markdown>
-            # let's get started
+          <section id="setup" data-markdown>
+            # setup
 
             notes:
             - git is simple and complex
             - git seems complex for 2 reasons:
               - you're unfamiliar with command line
               - there are a lot of choices
-            - only X (TODO) theory pages
+            - only X (TODO) theory/internals pages
             - I'm gonna dumb it down for you
               - aka we'll stick to the simple parts
           </section>
 
-          <section id="cheatsheet" data-markdown>
-            # [cheat sheet](https://idiv-biodiversity.github.io/git-cheat-sheet/)
-          </section>
-
-          <section id="cli" data-markdown>
+          <section id="setup-cli" data-markdown>
             ## command line
 
             - Ellen Ripley uses command line
             - Chuck Norris uses command line
           </section>
 
-          <section id="os" data-markdown>
+          <section id="setup-os-packages" data-markdown>
             ## os packages
 
-            **Linux:** bash and git
+            - **Linux:** bash and git
+            - **Mac:** bash and git
+            - **Windows:** cmder
+          </section>
+
+          <section id="cli-description" data-markdown>
+            ## command line
+            ### description syntax
+
+            ```bash
+            # command
+            git
 
-            **Mac:** bash and git
+            # sub-command
+            git status
 
-            **Windows:** cmder
+            # optional
+            git diff [--staged]
+            ```
           </section>
 
-          <section id="setup" data-markdown>
-            ## setup
+          <section id="cli-git" data-markdown>
+            ## command line
+            ### git syntax
+
+            ```bash
+            # every git command
+            git command [arguments]
+
+            # get help
+            git help [command]
+            ```
+          </section>
+
+          <section id="setup-git" data-markdown>
+            ## git setup
 
             ```bash
-            # identity
+            # configure your identity
             git config --global user.name  'Jane Doe'
-            git config --global user.email 'jane.doe@feminism.org'
+            git config --global user.email 'jane.doe@riot-grrrl.org'
 
-            # colors
+            # show colors
             git config --global color.ui auto
 
-            # aliases
+            # editor
+            git config --global core.editor emacs
+
+            # configure aliases
             git config --global alias.unstage 'reset HEAD --'
             git config --global alias.lol \
               'log --graph --decorate --oneline --all'
             ```
           </section>
+        </section>
+
+        <!---------------------------------------------------------------------
+        <!-- basic command line usage
+        <!-------------------------------------------------------------------->
+
+        <section>
+          <section id="cli-basic" data-markdown>
+            # git command line
+            ## local repositories
+          </section>
+
+          <section id="cli-create-repository" data-markdown>
+            ## command line
+            ### create repositories
+
+            ```bash
+            # create empty repository
+            git init project-name
+
+            # create repository from existing project
+            # which is not under version control
+            cd path/to/project
+            git init
+            ```
+          </section>
+
+          <section id="cli-git-status" data-markdown>
+            ## command line
+            ### git status
+
+            ```bash
+            # show status and what to do
+            git status
+            ```
+
+            notes:
+            - important git command
+            - shows a lot of information
+            - shows basic git commands
+            - later, we'll see different outputs
+          </section>
+
+          <section id="internals-staging-area" data-markdown>
+            ## internals
+            ### the staging area
+
+            ![staging area](img/staging-area.svg)
+          </section>
+
+          <section id="cli-git-files" data-markdown>
+            ## command line
+            ### file handling
+
+            ```bash
+            # use staging area
+            git stage file
+            git unstage file
+
+            # discard changes
+            git checkout file
+
+            # rename and remove
+            git mv source destination
+            git rm file
+            ```
+          </section>
+
+          <section id="cli-git-diff-1" data-markdown>
+            ## command line
+            ### show changes
+
+            ```bash
+            # from staging area to current working copy
+            git diff
+
+            # show contents of staging area, i.e.
+            # from last commit to staging area
+            git diff --staged
+            ```
+          </section>
+
+          <section id="cli-git-commit" data-markdown>
+            ## command line
+            ### commit changes
+
+            ```bash
+            # opens editor for you to edit commit message
+            git commit
+
+            # commits with a short message
+            git commit -m 'adds license and readme'
+            ```
+          </section>
+
+          <section id="commit-message-conventions" data-markdown>
+            ## TODO
+          </section>
+
+          <section id="cli-git-log" data-markdown>
+            ## command line
+            ### view history
+
+            ```bash
+            # show all commits
+            git log
 
-          <section id="demo" data-markdown>
-            ## my project
+            # show all commits plus diff
+            git log --patch
 
-            demo
+            # shows condensed view of history, i.e.
+            # - only commit message subjects
+            # - one per line
+            git lol
+            ```
+          </section>
+
+          <section id="cli-demo-basic" data-markdown>
+            ## demo
+            ### basic commands
 
             notes:
+            - mkdir ~/projects
             - git init hello
             - README.md
             - LICENSE
-            - TODO really talk about licenses? I should, because it's
-              important, but it takes time away from other things ...
             - src/hello.py
           </section>
+
+          <section id="licenses-software" data-markdown>
+            ## software licenses
+
+            ![software licenses](img/license-chooser.svg)
+
+            https://choosealicense.com
+          </section>
+
+          <section id="licenses-none" data-markdown>
+            ## no license
+
+            - exclusive copyright to **each!** author
+            - **no one** can use, copy, distribute and modify
+            - platform: terms of service
+
+            https://choosealicense.com
+          </section>
+
+          <section id="licenses-other" data-markdown>
+            ## other licenses
+
+            - media, documentation: creative commons
+            - paper / thesis: journal vs legal department
+
+            https://choosealicense.com
+          </section>
+
+          <section id="cli-cheatsheet" data-markdown>
+            # [cheat sheet](https://idiv-biodiversity.github.io/git-cheat-sheet/)
+          </section>
+
+          <section id="cli-your-turn" data-markdown>
+            # your turn
+
+            - pick project
+            - make commits
+            - use status and diff!
+
+            notes:
+            - deputize those who already have
+          </section>
+        </section>
+
+        <section id="break" data-markdown>
+          # break
+        </section>
+
+        <!---------------------------------------------------------------------
+        <!-- distributed
+        <!-------------------------------------------------------------------->
+
+        <section>
+          <section id="distributed" data-markdown>
+            # distributed
+            ## version control system
+          </section>
+
+          <section id="distributed-local" data-markdown>
+            ## git usage until now
+
+            - has all been local
+            - repo contains entire project history
+            - not yet answered:
+              - how to publish?
+              - how to contribute?
+          </section>
+
+          <section id="distributed-remotes" data-markdown>
+            ## remotes
+
+            ![remotes](img/git-remote-solo.svg)
+          </section>
+
+          <section id="distributed-webapps" data-markdown>
+            ### how do i get remotes?
+            # web apps
+
+            - GitLab demo
+            - GitHub (no demo)
+          </section>
+
+          <section id="distributed-remote-clone" data-markdown>
+            ## command line
+            ### clone repositories
+
+            ```bash
+            # create local copy of existing repository
+            git clone https://github.com/user/project-name.git
+            ```
+          </section>
+
+          <section id="distributed-your-turn" data-markdown>
+            ## your turn
+
+            - log in
+            - create project
+            - fetch / push / pull
+          </section>
         </section>
 
-        <section id="webapps" data-markdown>
-          ## web apps
+        <!---------------------------------------------------------------------
+        <!-- collaboration
+        <!-------------------------------------------------------------------->
 
-          - GitHub demo
-          - GitLab demo
+        <section>
+          <section id="collab" data-markdown>
+            # collaboration
+          </section>
+
+          <section id="collab-" data-markdown>
+            ## command line
+            ### git 
+
+            ```bash
+            
+            ```
+          </section>
+
+          <section id="collab-" data-markdown>
+            ## command line
+            ### git 
+
+            ```bash
+            
+            ```
+          </section>
+        </section>
+
+        <section>
+          <section id="homework" data-markdown>
+            # homework
+          </section>
+
+          <section id="homework-use-git" data-markdown>
+            ## homework #1
+            ### use git
+
+            for each project you use ...
+
+            ... create repository in GitLab ...
+
+            ... and commit changes!
+          </section>
+
+          <section id="homework-collaborate" data-markdown>
+            ## homework #2
+            ### collaborate
+
+            - talk with your colleagues
+            - organize project(s) you use together
+              - open issues for problems and features
+              - contribute via merge requests
+              - review commits and merge requests
+          </section>
+
+          <section id="homework-behavior" data-markdown>
+            ## homework #3
+
+            be friendly
+
+            be responsible
+
+            be open
+
+            be creative
+
+            be proactive
+
+            have fun
+          </section>
         </section>
 
         <section id="eof" data-background="img/trex.png">
diff --git a/img/Makefile b/img/Makefile
index 899a779..47e6092 100644
--- a/img/Makefile
+++ b/img/Makefile
@@ -1,5 +1,7 @@
 SOURCES_DOT = $(wildcard *.dot)
 
+default: all
+
 OBJECTS_DOT_SVG = $(SOURCES_DOT:.dot=.svg)
 
 OBJECTS = \
@@ -15,8 +17,6 @@ all: $(OBJECTS)
 clean:
 	rm -f $(OBJECTS)
 
-default: all
-
 .PHONY: \
 	all \
 	clean \
diff --git a/img/git-remote-solo.dot b/img/git-remote-solo.dot
new file mode 100644
index 0000000..f221ad5
--- /dev/null
+++ b/img/git-remote-solo.dot
@@ -0,0 +1,26 @@
+digraph {
+    compound = true
+    node [shape = "box", style = "filled, rounded"]
+    nodesep = 0.5
+    ranksep = 1.5
+
+    subgraph clusterorigin {
+        label = "origin"
+
+        node [color = orchid]
+
+        omaster[label = "master"]
+    }
+
+    subgraph clusterlocal {
+        label = "local"
+
+        node [color = orchid]
+
+        master[label = "master"]
+    }
+
+    omaster -> master [label = "git fetch", style = dotted, ltail = clusterorigin, lhead = clusterlocal]
+    master -> omaster [label = "git push"]
+    omaster -> master [label = "git pull"]
+}
diff --git a/img/license-chooser.dot b/img/license-chooser.dot
new file mode 100644
index 0000000..f8da71f
--- /dev/null
+++ b/img/license-chooser.dot
@@ -0,0 +1,37 @@
+digraph {
+    node [shape = "diamond"]
+
+    q1[label = "how open?"]
+    q2[label = "patents?"]
+    q3[label = "commercial\nadoption?"]
+
+    node [shape = "box", style = "filled"]
+
+    a1a[label = "put software out there"]
+    a1b[label = "others should share too"]
+
+    a2a[label = "anyone can use the patents"]
+    a2b[label = "keep the rights to my patents"]
+
+    a3a[label = "code can be used in closed source"]
+    a3b[label = "others should share too"]
+
+    node [color = limegreen]
+
+    s1[label = "permissive license"]
+    s2[label = "copyleft license"]
+
+    node [color = orchid]
+
+    l1[label = "Apache"]
+    l2[label = "MIT / BSD"]
+    l3[label = "LGPL"]
+    l4[label = "GPL"]
+
+    q1 -> a1a -> s1 -> q2
+    q1 -> a1b -> s2 -> q3
+    q2 -> a2a -> l1
+    q2 -> a2b -> l2
+    q3 -> a3a -> l3
+    q3 -> a3b -> l4
+}
diff --git a/img/staging-area.dot b/img/staging-area.dot
new file mode 100644
index 0000000..450e98f
--- /dev/null
+++ b/img/staging-area.dot
@@ -0,0 +1,22 @@
+digraph {
+    node [shape = "box", style = "filled,rounded"]
+
+    # untracked[label = "untracked\n(files git doesn't know)"]
+    workdir[label = "working directory\n(changes not staged for commit)", color = lightskyblue]
+    stage[label = "staging area\n(changes to be committed)", color = orchid]
+    repo[label = "repository\n(tracked content)", color = limegreen]
+    # discard[label = "discard\n(remove file)"]
+
+    # untracked -> stage [label = "git add"]
+    # stage -> untracked [label = "git unstage"]
+
+    workdir -> stage [label = "git stage file"]
+    stage -> workdir [label = "git unstage file"]
+
+    # workdir -> discard [label = "git checkout"]
+    # untracked -> discard [label = "rm"]
+
+    stage -> repo [label = "git commit"]
+
+    # { rank = same; untracked workdir }
+}
-- 
GitLab