diff --git a/slides/slides.qmd b/slides/slides.qmd index a31ddb122d2340694fc059e6a02583e5def63f1a..092d46ac6e739d6f3e3bb2524465c821c2f91e6e 100644 --- a/slides/slides.qmd +++ b/slides/slides.qmd @@ -2,9 +2,12 @@ title: "Git Borg Linker" subtitle: "Incremental backup of your results folder with git and borg" author: "Nicolas Fontrodona" -institute: "LBMC -- ENS" -date: "`r format(Sys.time(), '%d/%m/%y')`" +institute: "LBMC -- ENS<br>" +date: last-modified +date-format: full toc: true +mainfont: calibri +monofont: Source Code Pro format: revealjs: center: false @@ -316,9 +319,9 @@ The `gblk list` command lists all backups inside the `.borg` folder ```bash $ gblk list -b1da0e305c906fb242bc8... Mon, 2022-06-13 15:47:24 [2960...] +df0eb55ce43fa48b652340183b5f9cc69daa2350 Fri, 2023-02-10 16:15:56 [c9409...] $ git rev-parse --verify HEAD # Show current commit -b1da0e305c906fb242bc8... +df0eb55ce43fa48b652340183b5f9cc69daa2350 ``` <br> @@ -380,5 +383,61 @@ Will revert *both your code and your results* as they were. The workflow is the - `git checkout SOURCE_COMMIT`: Going back to the state before the step 1 - `gblk pre-co`: checks if there is no new data inside the results folder otherwize it stops the checkout. - `git checkout DESTINATION_COMMIT` - - `gblk checkout --mode hard`: hard is the default mode used when hooks are created. With hard mode, the results folder is completly deleted, this action is skipped if with --mode soft. Then the backup of the first commit is extracted into the results folder. -::: \ No newline at end of file + - `gblk checkout --mode hard`: *hard* is the default mode used when hooks are created. With hard mode, the *results folder is completly deleted*, this action is skipped if with `--mode soft`. Then the backup of the first commit is extracted into the results folder. `--mode soft` can lead to have a `results` folder with *both old and new files*. It usage is **not recommended**. +::: + + +## Git Borg Linker - checkout {.unnumbered .unlisted} + + +Let's go back to our example project (in slide 11, 14, 15 and 17): + +In this project, we're using *hooks*: + +```bash +$ echo "echo 'a newline' >> results/result.txt" >> src/script.sh # Add anew line into result.txt file +$ bash src/script.sh # Execute the script +$ cat results/result.txt # display the new content of the file +result line +a newline + +$ git add src/script.sh && git commit -m "src/script.sh: update" +... + +$ git co df0eb55ce43fa48b652340183b5f9cc69daa2350 # checkout to the first commit, gblk checkout is executed after that command +... +HEAD est maintenant sur df0eb55 src/script.sh: initial commit + +$ cat results/result.txt +result line + +$ git co master +Basculement sur la branche 'master' + +$ cat results/result.txt +result line +a newline +``` + + +## Git Borg Linker - checkout {.unnumbered .unlisted} + + +Example with unsaved results in our results folder: + +```bash +$ echo "test" >> results/result.txt +$ echo "new files" > results/new.txt +$ git co df0eb55ce43fa48b652340183b5f9cc69daa2350 + +27 B -22 B results/result.txt +added 10 B results/new.txt + +Your results folder contains unsaved changes! +Please update your current commit with: gblk commit --update +Or revert it back to it's previous state with gblk commit --revert +``` + +Usaved changes are detected, you can: + + - discard unsaved changes with `gblk commit --revert` + - update the current archive with the new content inside the results folder with `gblk commit --update` \ No newline at end of file diff --git a/slides/style.css b/slides/style.css index 161377f3f29de311c48de7f8da04db95f62b7988..16ea4856c936c63f17813f2f06babf95afbecbad 100644 --- a/slides/style.css +++ b/slides/style.css @@ -73,7 +73,6 @@ border-radius: 5px; background-color: rgb(214, 214, 214); color: rgb(0, 0, 0); - font-family: monospace; font-size: 0.9em; } @@ -81,7 +80,6 @@ border-radius: 5px; background-color: rgb(214, 214, 214); color: rgb(0, 0, 0); - font-family: monospace; font-size: 0.9em; }