@@ -22,7 +22,7 @@ GitHub.
22
22
* The ** GitHub** web interface allows many things to be done, but not
23
23
everything.
24
24
* ** VS Code** allows some of these, but for some it's easier to open
25
- the VS Code terminal and run git there.
25
+ the VS Code terminal and run Git there.
26
26
27
27
28
28
## Our toolbox for history inspection
@@ -200,8 +200,7 @@ modified each line. Incredibly useful for reproducibility.
200
200
201
201
:::::
202
202
203
- :::{discussion}
204
- Discuss how these relatively trivial changes affect the annotation:
203
+ :::{discussion} Discuss how these relatively trivial changes affect the annotation
205
204
- Wrapping long lines of text/code into shorter lines
206
205
- Auto-formatting tools such as ` black `
207
206
- Editors that automatically remove trailing whitespace
@@ -221,17 +220,17 @@ Discuss how these relatively trivial changes affect the annotation:
221
220
222
221
Example (lines starting with "#" are only comments):
223
222
224
- ```console
225
- $ # create branch called "older-code" from hash 347e6292419b
223
+ ```bash
224
+ # create branch called "older-code" from hash 347e6292419b
226
225
$ git switch --create older-code 347e6292419bd0e4bff077fe971f983932d7a0e9
227
226
228
- $ # now you can navigate and inspect the code as it was back then
229
- $ # ...
227
+ # now you can navigate and inspect the code as it was back then
228
+ # ...
230
229
231
- $ # after we are done we can switch back to "main"
230
+ # after we are done we can switch back to "main"
232
231
$ git switch main
233
232
234
- $ # if we like we can delete the "older-code" branch
233
+ # if we like we can delete the "older-code" branch
235
234
$ git branch -d older-code
236
235
```
237
236
@@ -272,9 +271,6 @@ Discuss how these relatively trivial changes affect the annotation:
272
271
273
272
## Exercise
274
273
275
- This is described with the command line method, but by looking above
276
- you can translate to the other options.
277
-
278
274
:::::{exercise} Exercise: Explore basic archaeology commands (20 min)
279
275
Let us explore the value of these commands in an exercise. Future
280
276
exercises do not depend on this, so it is OK if you do not complete
@@ -375,7 +371,7 @@ you can translate to the other options.
375
371
Then using the above toolbox try to:
376
372
1. Find the code line which contains `"Logic error in degree_correlation"`.
377
373
1. Find out when this line was last modified or added. Find the actual commit which modified that line.
378
- 1. Inspect that commit with `git show`.
374
+ 1. Inspect the commit. What is the commit change? What is the commit metadata?
379
375
1. Create a branch pointing to the past when that commit was created to be
380
376
able to browse and use the code as it was back then.
381
377
1. How would you bring the code to the version of the code right before that line was last modified?
@@ -422,13 +418,11 @@ you can translate to the other options.
422
418
423
419
## Finding out when something broke/changed with `git bisect`
424
420
425
- This only works with the command line.
426
-
427
- > * " But I am sure it used to work! Strange." *
421
+ This section only works with the command line.
428
422
429
- Sometimes you realize that something broke.
430
- You know that it used to work.
431
- You do not know when it broke.
423
+ *"But I am sure it used to work! Strange."* - Sometimes you realize that
424
+ something broke. You know that it used to work. You do not know **when precisely** it
425
+ broke.
432
426
433
427
:::{discussion} How would you solve this?
434
428
Before we go on first discuss how you would solve this problem: You know that it worked
@@ -467,7 +461,7 @@ We will probably arrive at a solution which is similar to `git bisect`:
467
461
468
462
This only works with the command line.
469
463
470
- ::::{exercise} (optional) History-2: Use git bisect to find the bad commit
464
+ ::::{exercise} (optional) Use git bisect to find the bad commit
471
465
In this exercise, we use ` git bisect ` on an example repository. It
472
466
is OK if you do not complete this exercise fully.
473
467
0 commit comments