YeOldeInn / agins-archive

Archive of Agin's Inn, the predecessor to Ye Olde Inn
1 stars 0 forks source link

weaponpix.html duplicates #2

Closed knghtbrd closed 2 years ago

knghtbrd commented 2 years ago

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.

--- weaponpix.html  2022-07-25 23:57:14.384920402 -0700
+++ weaponpix2.html 2022-07-25 23:57:10.409010325 -0700
@@ -58,8 +58,8 @@
       href="links.html">
       <center>Links</center></a></font></td></tr></tbody></table></b></center>

-<br><center>
-<!img src="hqequip.gif width="475" height="195">
+<br><br><center>
+<img src="hqequip.gif" width="475" height="195">

 <center><br><h1><b>Weapon Cards</b></h1><h3>New Weapons to add to your adventuring party.<br></h1>

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.

--- weaponpix.html  2022-07-25 23:57:14.384920402 -0700
+++ weaponspix.htm  2022-07-26 21:37:19.249666465 -0700
@@ -1,6 +1,6 @@
 <html>
 <head>
-<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
+<META http-equiv="Content-Type" content="text/html; charset=utf-8">
 <title>HeroQuest and Hero Quest - Dungeon Pits Tiles</title>
 <META content="hero quest, heroquest, kellars keep, return of the witch lord, barbarian pack, elf, against the ogre horde, wizards of morcar, dwarf, boardgame"
 name="keywords">
@@ -58,8 +58,7 @@
       href="links.html">
       <center>Links</center></a></font></td></tr></tbody></table></b></center>

-<br><center>
-<!img src="hqequip.gif width="475" height="195">
+<br><br>

 <center><br><h1><b>Weapon Cards</b></h1><h3>New Weapons to add to your adventuring party.<br></h1>
@@ -67,20 +66,20 @@
 The listed stats are merely suggestions for using them in an adventure.<br>
 Please remember that all these images are copyrighted 2002 by <a href="mailto:egc@northnet.org">Ron Shirtz</a>. <br>
 They may be only used in personal gaming, and may not be sold, distributed, <br>
-posted on web sites, or otherwise used without the permission of the artist.<br><br>
+posted on web sites, or otherwise used without the permsision of the artist.<br><br>

 <center>
 <table border="2" bgcolor="#ffffff">
 <tr>
-<td><center><img src="tiles/firesword.jpg" alt="Fire Sword" border="0" width="258" height="293"></a><br><center><b>"SunSword"
+<td><center><img src="tiles/firesword.jpg" alt="Fire Sword" border="0" width="258" height="293"></a><br><center><b>Paladin Fire Sword
 <br>Six combat dice, with each hit<br> counting double.</td>

-<td><center><img src="tiles/chaosword.jpg" alt="Doomsday Sword" border="0" width="249" height="261"></a><br><justified><b>"Doomblade" <br> Five Combat dice, every hit takes one Mind Point.<br>
+<td><center><img src="tiles/chaosword.jpg" alt="Doomsday Sword" border="0" width="249" height="261"></a><br><justified><b>Doomsday Sword <br> Five Combat dice, every hit takes one Mind Point.<br>
 When all mind points of targeted character are gone,<br>
 that character becomes a mindless servant,<br> to the sword bearer!</td>

-<td><center><img src="tiles/twohandsword.jpg" alt="Two-Handed Sword" border="0" width="243" height="261"></a><br><justified><b>"ShieldBreaker"<br>Two-Handed Sword<br> Five combat dice in attacks, <br> three combat dice in defense <br>May use "RoundHouse" attack" against<br> multiple, adjacent opponents<br>
+<td><center><img src="tiles/twohandsword.jpg" alt="Two-Handed Sword" border="0" width="243" height="261"></a><br><justified><b>Two-Handed Sword<br> Five combat dice in attacks, <br> three combat dice in defense <br>May use "RoundHouse" attack" against<br> multiple, adjacent opponents<br>
 May attack diagonally.<br>
 Cannot use a shield with this weapon.<br><br>
 </td>

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?

DaedalusInn commented 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!

knghtbrd commented 2 years ago

LOL, yes, but now you can see what it will look like when I apply the fix.

knghtbrd commented 2 years ago

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!

DaedalusInn commented 2 years ago

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?

DaedalusInn commented 2 years ago

If I wanted a try at the index files problem, how would I apply the diff files?

knghtbrd commented 2 years ago

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.