Closed knghtbrd closed 2 years ago
I agree that the order was switched. Keep weaponpix2.html and nix the others. If Dwayne Agin doesn't like it, he can respond himself!
There--you tricked.me into joining this group site with an easy example!
LOL, yes, but now you can see what it will look like when I apply the fix.
That "c9ccbe8" there is a number, or part of one, called a hash. If you click it above, it'll take you to a page that shows you exactly what changed: I modified the one file, I deleted the two others, and oh yeah, I added the gif that should be there, but wasn't yet. Every "commit" (change) is tracked that way, which means you can always see exactly what's done. And once I have put all of the files from Agin's Inn into git, anyone who "clones" the git repository will have made a full backup. Not only of Dewayne's site as drathe archived it, but of every change or cleanup we make afterward if we are careful.
I could explain why we use those hashes, but unless you want to get in on the actual HTML, there's no need for specifics. Each hash represents one and only one possible state of the repository—it's a mathematical tree and a hash includes the state of its "parent". The full hash is 40 digits long (49 in decimal in this case!), but we find that the first 7 digits are almost always unique within any given tree, so no need to specify more of them.
Why we use hashes rather than some more natural revision number gets into the stuff that makes git more useful for "distributed" development like the Linux kernel, for which git was developed. We don't need to play with those things most likely, but … if we ever did, they're there!
I see in the commit that your correction is highlighted green. Also, an exclamation mark is highlighted in red. What is that for? I mean, why highlight it?
If I wanted a try at the index files problem, how would I apply the diff files?
diff is a tool from UNIX-land that compares two files. The colors you see above are added by git and represent a "unified diff", which for many people is the easiest kind to read. If I create two files:
tjcarter@aki:~$ mkdir tmp && cd tmp
tjcarter@aki:~/tmp$ cat > a.txt
one
two
three
five
four
six
tjcarter@aki:~/tmp$ cat > b.txt
one
two
three
four
five
six
The difference between those files is obvious if you can count … but let's see what diff does to it:
tjcarter@aki:~/tmp$ diff -u a.txt b.txt
--- a.txt 2022-08-02 05:19:49.669264266 -0700
+++ b.txt 2022-08-02 05:20:04.212930128 -0700
@@ -1,6 +1,6 @@
one
two
three
-five
four
+five
six
You can kind of see what it did there. The first line starts with --- (three minuses) and shows the info about the "old" file. The second starts with three pluses and shows the "new" file. Old and new are arbitrary here. Another tool called patch is capable of "applying" (or unapplying) a patch like the above.
The way I'm pasting those boxes from my terminal in these comments (which are written in Markdown) is using a code block. That won't work if you reply to your email, but if you come to the website you can type something like this:
```
text here
```
(using backticks or "grave accents") which becomes:
text here
If I take that diff output from before and do it like this:
``` diff
--- a.txt 2022-08-02 05:19:49.669264266 -0700
+++ b.txt 2022-08-02 05:20:04.212930128 -0700
@@ -1,6 +1,6 @@
one
two
three
-five
four
+five
six
```
…it tells the software that runs Github that I want the file to be colored in a way that makes "diff" files easier to read. The result is this:
--- a.txt 2022-08-02 05:19:49.669264266 -0700
+++ b.txt 2022-08-02 05:20:04.212930128 -0700
@@ -1,6 +1,6 @@
one
two
three
-five
four
+five
six
Which is a little easier to read. You don't need to know how diff works (I can explain it if you're curious) nor do you need the tools diff and patch nor to learn how to use them … they're just (sometimes) a convenient way to show what changes exist in a file in a way computers can read and reproduce that's sometimes also useful for humans.
Basically, anything you can use (including your eyeballs) to compare two files help you figure out if there's any value to one over the other, possibly help you determine which one is newer, or figure out if something was added/removed that we basically want to recover/save. I have a list of those files that are up for consideration … but as I'm going through it I'm still finding more. Usually because I've already realized what needs to be done with them. There were four versions of classic.html(!) for example. An older and a newer file, just in two places. Deleting three of them was easy.
It seems like I'm putting a lot of effort into the old site … but it's actually giving me some notions about how to better organize the Inn (not that there's any organization to Dewayne's site, but the bits are small and self-contained, which helps) and I'm learning about stuff I'm going to need to be prepared to deal with later. Plus, like I said, it's something people won't miss for half an hour or so if I screw up deploying it and need to spend time fixing it from backup, which makes it an ideal test platform for managing the website out of git.
Here's an example of an issue. I could just fix this, but let's show off how it's done.
If any of you look through the files in the root of agins-archive, you may notice that there is a weaponpix.html which is linked elsewhere, but there's also a weaponpix2.html and a weaponspix.htm file.
I'm going to provide something called "diff files" so you can see what changed. I'll do it first and then I'll explain how I did it.
A diff file shows you the difference between two files. It's actually possible to show differences between three files using a different tool, but that's confusing here so I'm not doing it.. Obviously these two files have very little difference. Do you see the differences? There are two lines different. The first change is obvious: There's an extra <br> tag on the first line. The second one is more subtle: hqequip.gif has an opening quote, but not a closing quote. Will that render properly in a browser? No freakin' idea. Let's have a look:
https://aginsinn.yeoldeinn.com/weaponpix.html https://aginsinn.yeoldeinn.com/weaponpix2.html
No. No it will not, at least not in Firefox. So this suggests that the change this page needed to make that graphic display was written, but it never went live (remember, weaponpix.html is linked, but weaponpix2.html is not!) So we we copy weaponpix2.html over weaponpix.html, delete weaponpix2.html, and the archive of Agin's Inn becomes slightly less historical but also not broken, at least not in this way. Good fix.
What about weaponspix.htm? Let's have a look.
First of all, it has no image at the top at all. And the text is different. But notice that the - lines seem to be newer than the + lines. Almost like this diff file is describing how to turn a newer file into an older one. And that's because that's because this diff file is backwards! I specified the new file first, and the old file second. How could I have known that? Before I read the diff file, I couldn't.. But since I have now, I can see what it does and … no we don't want that, I think.
So I think the weaponpix2.html version is the one that should be used. The others should be deleted. Any comments on that?