diff --git a/materials/icons/Git-Logo-2Color.svg b/materials/icons/Git-Logo-2Color.svg new file mode 100644 index 0000000000000000000000000000000000000000..170134e39eebeb852fbc80f45801115b2a71df36 --- /dev/null +++ b/materials/icons/Git-Logo-2Color.svg @@ -0,0 +1 @@ +<svg xmlns="http://www.w3.org/2000/svg" width="292" height="92pt" viewBox="0 0 219 92"><defs><clipPath id="a"><path d="M159 .79h25V69h-25Zm0 0"/></clipPath><clipPath id="b"><path d="M183 9h35.371v60H183Zm0 0"/></clipPath><clipPath id="c"><path d="M0 .79h92V92H0Zm0 0"/></clipPath></defs><path style="stroke:none;fill-rule:nonzero;fill:#362701;fill-opacity:1" d="M130.871 31.836c-4.785 0-8.351 2.352-8.351 8.008 0 4.261 2.347 7.222 8.093 7.222 4.871 0 8.18-2.867 8.18-7.398 0-5.133-2.961-7.832-7.922-7.832Zm-9.57 39.95c-1.133 1.39-2.262 2.87-2.262 4.612 0 3.48 4.434 4.524 10.527 4.524 5.051 0 11.926-.352 11.926-5.043 0-2.793-3.308-2.965-7.488-3.227Zm25.761-39.688c1.563 2.004 3.22 4.789 3.22 8.793 0 9.656-7.571 15.316-18.536 15.316-2.789 0-5.312-.348-6.879-.785l-2.87 4.613 8.526.52c15.059.96 23.934 1.398 23.934 12.968 0 10.008-8.789 15.665-23.934 15.665-15.75 0-21.757-4.004-21.757-10.88 0-3.917 1.742-6 4.789-8.878-2.875-1.211-3.828-3.387-3.828-5.739 0-1.914.953-3.656 2.523-5.312 1.566-1.652 3.305-3.305 5.395-5.219-4.262-2.09-7.485-6.617-7.485-13.058 0-10.008 6.613-16.88 19.93-16.88 3.742 0 6.004.344 8.008.872h16.972v7.394l-8.007.61"/><g clip-path="url(#a)"><path style="stroke:none;fill-rule:nonzero;fill:#362701;fill-opacity:1" d="M170.379 16.281c-4.961 0-7.832-2.87-7.832-7.836 0-4.957 2.871-7.656 7.832-7.656 5.05 0 7.922 2.7 7.922 7.656 0 4.965-2.871 7.836-7.922 7.836Zm-11.227 52.305V61.71l4.438-.606c1.219-.175 1.394-.437 1.394-1.746V33.773c0-.953-.261-1.566-1.132-1.824l-4.7-1.656.957-7.047h18.016V59.36c0 1.399.086 1.57 1.395 1.746l4.437.606v6.875h-24.805"/></g><g clip-path="url(#b)"><path style="stroke:none;fill-rule:nonzero;fill:#362701;fill-opacity:1" d="M218.371 65.21c-3.742 1.825-9.223 3.481-14.187 3.481-10.356 0-14.27-4.175-14.27-14.015V31.879c0-.524 0-.871-.7-.871h-6.093v-7.746c7.664-.871 10.707-4.703 11.664-14.188h8.27v12.36c0 .609 0 .87.695.87h12.27v8.704h-12.965v20.797c0 5.136 1.218 7.136 5.918 7.136 2.437 0 4.96-.609 7.047-1.39l2.351 7.66"/></g><g clip-path="url(#c)"><path style="stroke:none;fill-rule:nonzero;fill:#f03c2e;fill-opacity:1" d="M89.422 42.371 49.629 2.582a5.868 5.868 0 0 0-8.3 0l-8.263 8.262 10.48 10.484a6.965 6.965 0 0 1 7.173 1.668 6.98 6.98 0 0 1 1.656 7.215l10.102 10.105a6.963 6.963 0 0 1 7.214 1.657 6.976 6.976 0 0 1 0 9.875 6.98 6.98 0 0 1-9.879 0 6.987 6.987 0 0 1-1.519-7.594l-9.422-9.422v24.793a6.979 6.979 0 0 1 1.848 1.32 6.988 6.988 0 0 1 0 9.88c-2.73 2.726-7.153 2.726-9.875 0a6.98 6.98 0 0 1 0-9.88 6.893 6.893 0 0 1 2.285-1.523V34.398a6.893 6.893 0 0 1-2.285-1.523 6.988 6.988 0 0 1-1.508-7.637L29.004 14.902 1.719 42.187a5.868 5.868 0 0 0 0 8.301l39.793 39.793a5.868 5.868 0 0 0 8.3 0l39.61-39.605a5.873 5.873 0 0 0 0-8.305"/></g></svg> \ No newline at end of file diff --git a/materials/sheet_advanced.typ b/materials/sheet_advanced.typ index eac6fbab7ee58416861a8ab7acfb6f6ff1057975..d6a8f5e180b37ce6c9688792f138e6a92b5d0ffb 100644 --- a/materials/sheet_advanced.typ +++ b/materials/sheet_advanced.typ @@ -1,7 +1,19 @@ +#import "sheet_template.typ": * +#import "global.typ": * + +#let title = "Aufgabenblatt: Advanced Git" + +#show: doc => apply-template(title, "de", doc) + = Git Blame Repository: Real OSS project repository (maybe bevy). Task: - Find out who authored a change. -- Find out the commit, that introduced a specific change and read in the commit message why the change was done. \ No newline at end of file +- Find out the commit, that introduced a specific change and read in the commit message why the change was done. + += `log -L "<start,end:filename>"` +#task[ + Welche Commits haben was an der Funktion `stream_output_chunks` in `csv-core/src/reader.rs` geändert? +] \ No newline at end of file diff --git a/materials/sheet_local.typ b/materials/sheet_local.typ index ad457df65ba8acc2d9dd738252551f23c1aa9bd0..8ffab8eeea73a5a66947d39247d58933d1fc8d6f 100644 --- a/materials/sheet_local.typ +++ b/materials/sheet_local.typ @@ -5,10 +5,6 @@ #show: doc => apply-template(title, "de", doc) -#todo_outline - -#add("Einheitlich Schreibweise von Git-Repository prüfen") - = Init Öffnet das Projekt `greekify` das ihr per Mail bekommen habt in einem Terminal. @@ -22,7 +18,7 @@ fatal: not a git repository (or any parent up to mount point /) Du kannst das Git-Repository immer aus allen Unterverzeichnissen ändern, git sucht automatisch in den höher liegenden Verzeichnissen nach Repositories. #task[ - Erstelle ein git-repository im aktuellen Verzeichnis mit `git init`. + Erstelle ein Git-Repository im aktuellen Verzeichnis mit `git init`. ] Anschließend sollte sich ein `.git` Verzeichnis in dem `greekify` Verzeichnis befinden. Die Ausgabe von `git log` zeigt dir nun, dass du auf dem aktuellen Branch (standardmäßig "main" genannt) keine Commits hast. @@ -214,7 +210,7 @@ Wenn Git eine Datei ignoriert wird sie nicht in `git status` als untracked angez = Diff Der Befehl `git diff` gibt den Unterschied zwischen zwei Versionen aus. -Beispielsweise gibt `git diff 7120114` an, was sich seit Commit `7120114` geändert hat. +Beispielsweise gibt `git diff 7120114` an, wie sich deine Working Area seit Commit `7120114` geändert hat. Alternativ akzeptiert `git diff` auch Ranges und Dateien, z.B. gibt `git diff 1f44746..7120114 -- csv-core/src/writer.rs` an, was sich von Commit `1f44746` zu Commit `7120114` in der Datei `csv-core/src/writer.rs` geändert hat. diff --git a/materials/sheet_team.typ b/materials/sheet_team.typ index 0cb11e930cb5ed6769bd2030db9b9df2f91bbda8..7363c24d3fbfc83b1651729f2193c65734b49124 100644 --- a/materials/sheet_team.typ +++ b/materials/sheet_team.typ @@ -5,7 +5,7 @@ #show: doc => apply-template(title, "de", doc) -= Pointers += Pointer ``` * bad8c60 (HEAD -> main, tag: v1.0) Merge branch 'fix-critical-bug' |\ @@ -22,17 +22,17 @@ #task[ #set enum(numbering: "a)") Der Befehl `git gc` entfernt, ähnlich dem Java Garbage-Collector, - alle Commits und Objekte die nicht mehr direkt oder indirekt referenziert werden. - Betrachte den folgenden Git-Graphen. + alle Commits und Objekte, die nicht mehr direkt oder indirekt referenziert werden. + Betrachte den Git-Graphen (erstellt mit `git log --oneline --graph --all`). Welche Commits werden bei den folgenden Befehlen gelöscht, wenn anschließend `git gc` aufgerufen wird? + `git branch --delete tmp` + `git branch --delete fix-critical-bug` - + `git reset --hard aff0f18` - + `git reset --hard rc1 && git tag --delete v1.0` + + `git reset aff0f18` + + `git reset rc1 && git tag --delete v1.0` + `git tag --delete rc1` - + `git checkout tmp && git reset --hard 6c96e08` - + `git checkout tmp && git reset --hard aff0f18 && git branch --delete fix-critical-bug` + + `git checkout tmp && git reset 6c96e08` + + `git checkout tmp && git reset aff0f18 && git branch --delete fix-critical-bug` ] = Addresssing @@ -52,7 +52,7 @@ ``` #task[ #set enum(numbering: "a)") - Betrachte den folgenden Git-Graphen. + Betrachte den Git-Graphen. Welche Commits werden mit den folgenden Aliasen bezeichnet? + `HEAD` diff --git a/materials/slides/advanced.typ b/materials/slides/advanced.typ index ab1e8fc308d9d34d33b5e39bb1acfe4cac16998c..e0488b0c970a3bf5cd59dad4918c03a1074880e5 100644 --- a/materials/slides/advanced.typ +++ b/materials/slides/advanced.typ @@ -45,4 +45,8 @@ - Entfernt alle Dateien die nicht im Git-Repository sind - `-x` entfernt nur ignorierte Dateien +#v(1fr) + +=== Customize Diff +- #link("https://github.com/dandavison/delta")[`git-delta`] #v(1fr) \ No newline at end of file diff --git a/materials/slides/local.typ b/materials/slides/local.typ index 4cdb7d52506130874c2a0edf8c616e4c90f91cb0..73a0b235c925f2c5c48d1e6f0d2bfd06c0ceb14b 100644 --- a/materials/slides/local.typ +++ b/materials/slides/local.typ @@ -59,8 +59,15 @@ ], ) +== Git +#align(center, + grid(columns: (auto, auto), column-gutter: 2em, + image("/icons/Git-Logo-2Color.svg"), + text("to the rescue", size: 48pt), + ) +) + == Beispiel -// TODO: Programmaufbau in zwei Dateien zeigen #image("/images/italogeier.svg", height: 60%) #text(font: "New Computer Modern")[ Wir $phi$lmen Vorlesungen und sorgen in Zusammenarbeit mit der @@ -305,6 +312,7 @@ === Working Area - Die aktuell angezeigt Version an der auch weitergearbeitet wird - wird durch HEAD markiert +- alles außerhalb von `.git` #v(1fr) @@ -316,6 +324,7 @@ === Repository - Versionen die in den Versionsverlauf aufgenommen wurden +- liegt in `.git` #v(1fr) diff --git a/materials/slides/remotes.typ b/materials/slides/remotes.typ index 5b3743f9920c3f77a9fb3499ba30a8d836174e5f..eb69fd575c9197c94be7724248f7fe4746929488 100644 --- a/materials/slides/remotes.typ +++ b/materials/slides/remotes.typ @@ -127,7 +127,7 @@ node-inset: 4pt, { node((0, 2), [#client("Lars")], stroke: none, name: <Lars>) - graph1(0, 3, "L", <L>, false, "feat-phi", true, "HEAD->main,\norigin/main", false, none) + graph1(0, 3, "L", <L>, false, "feat-phi", true, "HEAD->main", false, none) node((2, 2), [#client("Kevin")], stroke: none, name: <Kevin>) fletcher.hide({ diff --git a/materials/slides/team.typ b/materials/slides/team.typ index 8b5f2b159a74d676e87df34bf42eb95cf177ae3a..bbb67083009e8ec1628fd2e3fa55525117cf130b 100644 --- a/materials/slides/team.typ +++ b/materials/slides/team.typ @@ -489,4 +489,30 @@ ) ]) +== Merge-Konflikte +#[ +#let pad-spaces(n, width) = { + let s = str(n) + if s.len() < width { + return " " * (width - s.len()) + s + } + return s +} +#show raw.where(block: true): code => { + show raw.line: line => { + text(fill: gray)[#pad-spaces(line.number, 2)] + h(1em) + line.body + } + code +} +#raw("<<<<<< HEAD" + " +Content of HEAD +||||||| ab1234e +Content of last common parent +======= +Content of new incoming changes +>>>>>>> incoming_branch", block: true) +] + #include "remotes.typ" \ No newline at end of file diff --git a/projects/greekify/greekify.py b/projects/greekify/greekify.py index 34b3991900bdb1d8ae27b0551904c6c88473bac3..b0b1c3143619120f8b165d1a8050e3930830daed 100755 --- a/projects/greekify/greekify.py +++ b/projects/greekify/greekify.py @@ -1,7 +1,5 @@ #!/bin/python -# This the final file that you should get - import argparse import os from greekify_replace import greekify_replace @@ -28,4 +26,4 @@ def walk_exec(base: str, e: Callable[[str], None]): if os.path.isfile(args.file): print_replace(args.file) else: - walk_exec(args.file, print_replace) \ No newline at end of file + walk_exec(args.file, print_replace) diff --git a/projects/greekify/greekify_replace.py b/projects/greekify/greekify_replace.py index 97dd4d74568862b06e79e0f45f29d7b04d82b63d..bb944f11574f1d42dce255a6b3ceb165a2780e90 100644 --- a/projects/greekify/greekify_replace.py +++ b/projects/greekify/greekify_replace.py @@ -1,5 +1,3 @@ -# This the final file that you should get - def greekify_replace(input: str) -> str: - return input.replace("phi", "φ").replace("Phi", "Φ").replace("pi", "π").replace("Pi", "Π") \ No newline at end of file + return input.replace("phi", "φ").replace("Phi", "Φ")