bobrk / d-h-lawrence_women-in-love

Other
0 stars 0 forks source link

Review #1

Closed vr8hub closed 2 weeks ago

vr8hub commented 1 month ago

And for the big finale (sorry):

vr8hub commented 1 month ago

Every rebase is different, and this one is especially different. :) So some of this can be trial and error, even once you understand the basics of rebasing. Thus, the first rule of rebase: MAKE A COPY OF THE LOCAL REPOSITORY BEFORE BEGINNING! That way if anything happens, you can just copy over the backup and try again.

Note that at any point, you can type git rebase --abort at the command line, and it will abort the rebase, putting the repository back in the state it was in before you started the rebase. If things are so messed up that that doesn't work, that's what you have a backup for. :)

The gist of a rebase is: start the rebase at the commit ID before the one you want to affect, make whatever changes need to be made to that commit, then finish (continue) the rebase.

In this particular case, the sequence of events we care about is: commit 2: Deleted body.xhtml commit 3: Copied over the split files and then ran typogrify on those files.

The problem is that the two things done in commit 3 can't be separated. We can't "unrun" typogrify. So, the only alternative is to re-split the files and commit them as part of step 1, then git magic will mean that step 2 only contains the typogrify. (Git stores the difference between the last commit and the current one, so when the step 1 commit changes to include the files, then the step 2 commit will "automatically" only contain the typogrify.)

What makes this one a little bit special is that we have to "undo" the delete of body.xhtml in step 1 in order to re-split the files. So, again, after having MADE A BACKUP OF THE LOCAL REPOSITORY:

  1. From the command line at the root directory of the repository, do a git log --oneline to see a list of all the commits. You want the commit ID of the first commit (since it's the second commit we want to change). In this case, that is 6f4b48a.
  2. Start the rebase with git rebase -i 6f4b48a. (You can type --interactive if you want typing practice.)
  3. This will open up a vim window with a list of all the commits with the cursor on the top one, which will be the second commit, the one we want to change. If you know how to use vim, then you want to change the "pick" on the first line to "edit". If you don't know how to use vim, you should learn the basics of that, too. :) Type i to go into insert mode, use the forward delete key (if you have a full-size keyboard, the one under fn, not the one next to =) to delete the four letters in "pick," then type "edit".
  4. Exit the vim window with Esc :wq Enter.
  5. This will drop you back at the command prompt.
  6. The state of the repository is after the second commit, which deleted body.xhtml. But we don't want that delete to happen. So we have to undo the commit, and then undo the delete.
  7. To undo the commit, type git reset HEAD~. This undoes the last commit, but leaves the changes that were made (in this case, the delete).
  8. To undo the delete, type git restore src/epub/text/body.xhtml.
  9. Now you have to do all of the things you did to cleanup body and do the split. It's important that the body and split files look exactly like they did the first time; if not, the differences between commit 2 and commit 3 are going to involve more than just the typogrify, and we don't want that. I'm guessing that shouldn't be too hard; I assume you just removed the PG stuff, put in the markers, than ran the split. This is again why we have a backup; if it turns out there are other changes you missed, you can start over and do it again, picking up those changes.
  10. Once you're done, move the split files into the src/epub/text directory.
  11. You have both body.xhtml and the split files in the directory. Now you can delete body.xhtml.
  12. Run se clean.
  13. Do a git add -A and then a git commit -m "Split files and clean". This now puts us where our commit message said we were—we've split the files, run clean, and gotten rid of the original body.xhtml.
  14. Now we want to hand things back over to rebase to complete everything else. You do this with git rebase continue. If everything worked, this should rewind all of the remaining commits, and your repository is now good, with the first three commits containing what the messages say they contain.
  15. You can now make the other changes locally that need to be made from the review.
  16. When you're finished and want to push everything to GitHub, you'll have to do a force push, since we've changed history with the rebase. This is done by adding -f to the git command, i.e. git push -f origin main.

Good luck! Let me know (here) if you have any other questions or run into any problems.

bobrk commented 1 month ago

Thanks this is awesome. 

bobrk commented 1 month ago

So after I exit the vim window, I'm still in rebase. It offers "git commit --amend". Do I reset the head while I'm still in the rebase?

`d-h-lawrence_women-in-love(main) > git rebase -i 6f4b48a Stopped at aca8d6a... Split files and clean You can amend the commit now, with

git commit --amend

Once you are satisfied with your changes, run

git rebase --continue d-h-lawrence_women-in-love(main|REBASE 1/26) > git status `

bobrk commented 1 month ago

I did the head reset, I think I"m good. That prompt always throws me off, but it's just indicating where I am in the rebase, so I'll continue on.

Thanks again for the great instructions. My online searching was leading me into a morass of branching and merging and this made me confused. Also restoring the body.xhtml file is so obvious but I wasn't seeing it.

vr8hub commented 1 month ago

Yep, you're good. The prompt is reminding can be done, and what is most often done, which is to modify an existing commit. But in our case, we don't want to amend the commit, we want to do away with it entirely and then do a new commit, which is what steps 7 and on do.

bobrk commented 1 month ago

Ok, it goes ok until I do the git rebase continue, then I see some issues. First it thinks there is already a rebase going on, first time, I looked in that .git directory and it was files from this afternoon. I nuked the directory and that killed the rebase. So I started over and this time that directory had files from when I was doing the rebase, so I did "git rebase --continue" and I hit a bunch of conflicts. See below:

d-h-lawrence_women-in-love(main|REBASE 1/26) > git commit -m "Split files and clean"
[detached HEAD 0894483] Split files and clean
 32 files changed, 6442 insertions(+), 29900 deletions(-)
 delete mode 100644 src/epub/text/body.xhtml
 create mode 100644 src/epub/text/chapter-1.xhtml
 create mode 100644 src/epub/text/chapter-10.xhtml
 create mode 100644 src/epub/text/chapter-11.xhtml
 create mode 100644 src/epub/text/chapter-12.xhtml
 create mode 100644 src/epub/text/chapter-13.xhtml
 create mode 100644 src/epub/text/chapter-14.xhtml
 create mode 100644 src/epub/text/chapter-15.xhtml
 create mode 100644 src/epub/text/chapter-16.xhtml
 create mode 100644 src/epub/text/chapter-17.xhtml
 create mode 100644 src/epub/text/chapter-18.xhtml
 create mode 100644 src/epub/text/chapter-19.xhtml
 create mode 100644 src/epub/text/chapter-2.xhtml
 create mode 100644 src/epub/text/chapter-20.xhtml
 create mode 100644 src/epub/text/chapter-21.xhtml
 create mode 100644 src/epub/text/chapter-22.xhtml
 create mode 100644 src/epub/text/chapter-23.xhtml
 create mode 100644 src/epub/text/chapter-24.xhtml
 create mode 100644 src/epub/text/chapter-25.xhtml
 create mode 100644 src/epub/text/chapter-26.xhtml
 create mode 100644 src/epub/text/chapter-27.xhtml
 create mode 100644 src/epub/text/chapter-28.xhtml
 create mode 100644 src/epub/text/chapter-29.xhtml
 create mode 100644 src/epub/text/chapter-3.xhtml
 create mode 100644 src/epub/text/chapter-30.xhtml
 create mode 100644 src/epub/text/chapter-31.xhtml
 create mode 100644 src/epub/text/chapter-4.xhtml
 create mode 100644 src/epub/text/chapter-5.xhtml
 create mode 100644 src/epub/text/chapter-6.xhtml
 create mode 100644 src/epub/text/chapter-7.xhtml
 create mode 100644 src/epub/text/chapter-8.xhtml
 create mode 100644 src/epub/text/chapter-9.xhtml
d-h-lawrence_women-in-love(main|REBASE 1/26) > git rebase continue
fatal: It seems that there is already a rebase-merge directory, and
I wonder if you are in the middle of another rebase.  If that is the
case, please try
    git rebase (--continue | --abort | --skip)
If that is not the case, please
    rm -fr ".git/rebase-merge"
and run me again.  I am stopping in case you still have something
valuable there.

d-h-lawrence_women-in-love(main|REBASE 1/26) > git rebase --continue
CONFLICT (add/add): Merge conflict in src/epub/text/chapter-9.xhtml
Auto-merging src/epub/text/chapter-9.xhtml
CONFLICT (add/add): Merge conflict in src/epub/text/chapter-8.xhtml
Auto-merging src/epub/text/chapter-8.xhtml
CONFLICT (add/add): Merge conflict in src/epub/text/chapter-7.xhtml
Auto-merging src/epub/text/chapter-7.xhtml
CONFLICT (add/add): Merge conflict in src/epub/text/chapter-6.xhtml
Auto-merging src/epub/text/chapter-6.xhtml
CONFLICT (add/add): Merge conflict in src/epub/text/chapter-5.xhtml
Auto-merging src/epub/text/chapter-5.xhtml
CONFLICT (add/add): Merge conflict in src/epub/text/chapter-4.xhtml
Auto-merging src/epub/text/chapter-4.xhtml
CONFLICT (add/add): Merge conflict in src/epub/text/chapter-31.xhtml
Auto-merging src/epub/text/chapter-31.xhtml
CONFLICT (add/add): Merge conflict in src/epub/text/chapter-30.xhtml
Auto-merging src/epub/text/chapter-30.xhtml
CONFLICT (add/add): Merge conflict in src/epub/text/chapter-3.xhtml
Auto-merging src/epub/text/chapter-3.xhtml
CONFLICT (add/add): Merge conflict in src/epub/text/chapter-29.xhtml
Auto-merging src/epub/text/chapter-29.xhtml
CONFLICT (add/add): Merge conflict in src/epub/text/chapter-28.xhtml
Auto-merging src/epub/text/chapter-28.xhtml
CONFLICT (add/add): Merge conflict in src/epub/text/chapter-27.xhtml
Auto-merging src/epub/text/chapter-27.xhtml
CONFLICT (add/add): Merge conflict in src/epub/text/chapter-26.xhtml
Auto-merging src/epub/text/chapter-26.xhtml
CONFLICT (add/add): Merge conflict in src/epub/text/chapter-25.xhtml
Auto-merging src/epub/text/chapter-25.xhtml
CONFLICT (add/add): Merge conflict in src/epub/text/chapter-24.xhtml
Auto-merging src/epub/text/chapter-24.xhtml
CONFLICT (add/add): Merge conflict in src/epub/text/chapter-23.xhtml
Auto-merging src/epub/text/chapter-23.xhtml
CONFLICT (add/add): Merge conflict in src/epub/text/chapter-22.xhtml
Auto-merging src/epub/text/chapter-22.xhtml
CONFLICT (add/add): Merge conflict in src/epub/text/chapter-21.xhtml
Auto-merging src/epub/text/chapter-21.xhtml
CONFLICT (add/add): Merge conflict in src/epub/text/chapter-20.xhtml
Auto-merging src/epub/text/chapter-20.xhtml
CONFLICT (add/add): Merge conflict in src/epub/text/chapter-2.xhtml
Auto-merging src/epub/text/chapter-2.xhtml
CONFLICT (add/add): Merge conflict in src/epub/text/chapter-19.xhtml
Auto-merging src/epub/text/chapter-19.xhtml
CONFLICT (add/add): Merge conflict in src/epub/text/chapter-18.xhtml
Auto-merging src/epub/text/chapter-18.xhtml
CONFLICT (add/add): Merge conflict in src/epub/text/chapter-17.xhtml
Auto-merging src/epub/text/chapter-17.xhtml
CONFLICT (add/add): Merge conflict in src/epub/text/chapter-16.xhtml
Auto-merging src/epub/text/chapter-16.xhtml
CONFLICT (add/add): Merge conflict in src/epub/text/chapter-15.xhtml
Auto-merging src/epub/text/chapter-15.xhtml
CONFLICT (add/add): Merge conflict in src/epub/text/chapter-14.xhtml
Auto-merging src/epub/text/chapter-14.xhtml
CONFLICT (add/add): Merge conflict in src/epub/text/chapter-13.xhtml
Auto-merging src/epub/text/chapter-13.xhtml
CONFLICT (add/add): Merge conflict in src/epub/text/chapter-12.xhtml
Auto-merging src/epub/text/chapter-12.xhtml
CONFLICT (add/add): Merge conflict in src/epub/text/chapter-11.xhtml
Auto-merging src/epub/text/chapter-11.xhtml
CONFLICT (add/add): Merge conflict in src/epub/text/chapter-10.xhtml
Auto-merging src/epub/text/chapter-10.xhtml
CONFLICT (add/add): Merge conflict in src/epub/text/chapter-1.xhtml
Auto-merging src/epub/text/chapter-1.xhtml
error: could not apply f3c0d9d... Typogrify
Resolve all conflicts manually, mark them as resolved with
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".
Could not apply f3c0d9d... Typogrify
d-h-lawrence_women-in-love(main|REBASE 2/26) > git log --oneline
0894483 (HEAD) Split files and clean
6f4b48a (origin/fix-split) Initial commit

It looks like maybe I did more than typogrify... Here is a diff fragment...

git diff src/epub/text/chapter-1.xhtml
diff --cc src/epub/text/chapter-1.xhtml
index 046bd1c,ccb94cd..0000000
--- a/src/epub/text/chapter-1.xhtml
+++ b/src/epub/text/chapter-1.xhtml
@@@ -13,7 -13,7 +13,11 @@@
                        <p>“Ursula,” said Gudrun, “don’t you <i>really want</i> to get married?” Ursula laid her embroidery in her lap and looked up. Her face was calm and considerate.</p>
                        <p>“I don’t know,” she replied. “It depends how you mean.”</p>
                        <p>Gudrun was slightly taken aback. She watched her sister for some moments.</p>
++<<<<<<< HEAD
 +                      <p>“Well,” she said, ironically, “it usually means one thing! But don’t you think anyhow, you’d be—” she darkened slightly—“in a better position than you are in now.”</p>
++=======
+                       <p>“Well,” she said, ironically, “it usually means one thing! But don’t you think anyhow, you’d be⁠—” she darkened slightly⁠—“in a better position than you are in now.”</p>
++>>>>>>> f3c0d9d... Typogrify
                        <p>A shadow came over Ursula’s face.</p>
                        <p>“I might,” she said. “But I’m not sure.”</p>
                        <p>Again Gudrun paused, slightly irritated. She wanted to be quite definite.</p>
@@@ -25,30 -25,30 +29,54 @@@
vr8hub commented 1 month ago

I don't know what the first thing was; I mean, after you've split the files, you are still in the rebase. That's what the git rebase continue is doing, telling the rebase to finish out.

The merge conflicts are unfortunate. I obviously didn't do all of this myself beforehand, but I was hoping git would accept those changes as part of the typogrify, but obviously not—the amount I don't know about git far outweighs what I do know. :)

There are two choices:

  1. Go through all of the merge conflicts and fix them, after which the rebase should continue without further issue. Or,
  2. Start over with a new repository and just make the changes there as you made them originally.

Neither are great options, I know, but we can't take the repository as it sits, so it's one pain or the other. They tell me that rebasing (and resolving merge conflicts) is a lot easier with one of the git GUI's, but I don't use them, so I can't recommend them or help you with that. There are others on the list that probably can.

If I had to make the choice for myself, I would just start over. The repository doesn't have that many commits, many/most of them are automated (typogrify, semanticate, build-titles, etc.), and you have the existing repository to show what changes were made, so it should go pretty quickly. Just do a create-draft in a new directory, and then go through each commit from the old repository, taking care of course to include the newly split files in the second commit, and you should be good. If you want to see the changes from a particular commit in the old repository, you can use

git show --word-diff=color --unified=0 <commit-id>

When you're finished, you can connect that repository to your existing GitHub repository and do a force-push, or you can delete the existing GitHub repository and create a new one.

bobrk commented 1 month ago

Thanks Vince, I’ll figure it out. Appreciate you taking the time…

bobrk commented 1 month ago

Got through the rebase, will start looking at the other issues soon…

bobrk commented 1 month ago

Many issues after rebase...

bobrk commented 2 weeks ago

I'm still working through the list, probably 2/3 done. Couple of notes:

In the case of "Monsieur" It looks like I made a choice between it being used in an otherwise French spoken sentence but left it off of a sentence that was mostly English. I'm happy to change to whatever, but it seems weird to have an untagged French word in a French sentence?

de trop is in M-W

for "g-o-o-d b-y-e" in chapter 4, should the phonemes be one for each letter or for the complete phrase?

vr8hub commented 2 weeks ago

Right, and here we are at edge cases, and as you saw on the list with your song question, I often don't guess correctly what Alex would do. :)

In the case of the "Non, Monsieur," the whole phrase is tagged, and I think that's fine. In the case of the "Monsieur!" separate, in front of a French sentence, that one's more iffy. I probably wouldn't there, but the exclamation might drive me to make it emphasis instead.

You're right, I didn't look up each of those that were tagged as emphasis, so de trop shouldn't be tagged at all.

I should have given you the link to SEMoS for the spelled-out words (8.2.8), as it answers your question, and if I had, I would have seen that it should be grapheme, not phoneme. :)

bobrk commented 2 weeks ago

Thanks again, I will probably finish it up today. On Sep 7, 2024, at 10:11, vr8hub @.***> wrote: Right, and here we are at edge cases, and as you saw on the list with your song question, I often don't guess correctly what Alex would do. :) In the case of the "Non, Monsieur," the whole phrase is tagged, and I think that's fine. In the case of the "Monsieur!" separate, in front of a French sentence, that one's more iffy. I probably wouldn't there, but the exclamation might drive me to make it emphasis instead. You're right, I didn't look up each of those that were tagged as emphasis, so de trop shouldn't be tagged at all. I should have given you the link to SEMoS for the spelled-out words (8.2.8), as it answers your question, and if I had, I would have seen that it should be grapheme, not phoneme. :)

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were assigned.Message ID: @.***>

bobrk commented 2 weeks ago

Ok, made the last change, cleaned, linted, and pushed. Let's try again!