Up to Main Index                             Up to Journal for April, 2015

                     JOURNAL FOR FRIDAY 10TH APRIL, 2015
______________________________________________________________________________

SUBJECT: Time to rewrite history
   DATE: Fri 10 Apr 20:50:45 BST 2015

I realised today that I'd been committing changes to WolfMUD-mini into git
using my normal work credentials :( Most of the time I'm doing my day job to
pay the bills. So my global git configuration has my name and work email. For
my own projects like WolfMUD I use a local repository configuration to
override the global settings. Seem I forgot to setup the local repository
configuration for WolfMUD-mini :(

Once I realised my mistake I had to 'rewrite' all of my commits and correct
the author, committer and sign-off information. It was time to wield git's
filter-branch command and rewrite history. Good job I hadn't pushed anything
public yet. The hardest part was working out how to escape single quotes
inside single quotes inside double quotes for Bash. You have to use '\'' for
example:


  git filter-branch -f --msg-filter "sed -e 's/a b c/a '\''b'\'' c/'" -- --all


This will change "a b c" to "a 'b' c" if it appears in any git commit messages.

Rewriting history is not something to be done lightly as it will assign new
commit IDs to everything. There is also plenty that can go wrong. It was time
to take a backup, copy backup off of the local machine somewhere safe just in
case, then rewrite all my commits and double check the results.

A couple of hours and three attempts later - yay for backups! - and everything
was sorted.

What else has been going on? The Easter bank holiday was a bust - no coding
for me. Still documenting code. Still need to rebuild my server, which is
becoming more urgent as it can take over an hour and two dozen reboots before
the system runs, even if it was already running when rebooted - weird huh?
Runs fine once it gets going. Have been thinking about getting a multi-core
Raspberry Pi 2 - ha! fat chance, never even got my own original Raspberry Pi!

Reality sucks.

--
Diddymus


  Up to Main Index                             Up to Journal for April, 2015