From 7fce0198fb88290026107647a13f22bf539216df Mon Sep 17 00:00:00 2001 From: Richard Darst Date: Tue, 12 Sep 2023 23:07:58 +0300 Subject: [PATCH] Change `` to `VAR` throughout - As discussed in chat (but not yet agreed) - Ran the command `sed -i -E 's/<([0-9a-zA-Z_-]+)>/\U\1/g' content/*.md` but also checked each with "meld" and removed cases that shouldn't be changed (like git command outputs) - If git command hints use `` maybe that's a reason to not change? - Also changed some cases which weren't in angle brackets yet. - Time taken: about 5 minutes. - Review - There's a real chocie here: is this a good idea or not? I'm not sure, I've done this to see how hard it would be, not because it should be done. - Advantages: perhaps more clear what should be replaced and that `<>` are not part of the syntax? Upper case easier to scan and see? - Disadvanages: unclear what is a replacement and what is not? (I didn't see any places that wolud be the case.) Different than what others use? - The biggest disadvantage is that `HEAD` is actually a literal that is used in git... which *is* ambiguous. --- content/archaeology.md | 18 +++++++++--------- content/basics.md | 14 +++++++------- content/branches.md | 16 ++++++++-------- content/interrupted.md | 4 ++-- content/recovering.md | 16 ++++++++-------- content/reference.md | 22 +++++++++++----------- content/remotes.md | 12 ++++++------ 7 files changed, 51 insertions(+), 51 deletions(-) diff --git a/content/archaeology.md b/content/archaeology.md index f085d310..c816cf29 100644 --- a/content/archaeology.md +++ b/content/archaeology.md @@ -55,7 +55,7 @@ With `git grep` you can find all lines in a repository which contain some string This is useful to find out where in the code some variable is used or some error message printed: ```console -$ git grep sometext +$ git grep TEXT $ git grep "some text with spaces" ``` @@ -78,7 +78,7 @@ We have seen this one before already. Using `git show` we can inspect an individ we know its hash: ```console -$ git show somehash +$ git show HASH ``` For instance: @@ -95,7 +95,7 @@ last. It also prints the precise hash of the last change which modified each lin for reproducibility. ```console -$ git annotate somefile +$ git annotate FILE ``` Example: @@ -122,7 +122,7 @@ We can create branches pointing to a commit in the past. This is the recommended mechanism to inspect old code: ```console -$ git switch --create branchname somehash +$ git switch --create BRANCHNAME HASH ``` Example (lines starting with "#" are only comments): @@ -144,7 +144,7 @@ $ git branch -d older-code On newer Git versions this is the preferred command: ```console -$ git switch --create branchname somehash +$ git switch --create BRANCHNAME HASH ``` (exercise-history)= @@ -249,7 +249,7 @@ We will probably arrive at a solution which is similar to `git bisect`: ``` - Then bisect/iterate your way until you find the commit that broke it. - If you want to go back to start, type `git bisect reset`. -- This can even be automatized with `git bisect run