fixing my own git mess
Friday, April 28 2023
location: rural Hurley Township, Ulster County, NY
In the remote workplace today, I figured out how to install an SSL certificate on ArcGIS and then tinkered on and off with my watchdog project. At noon, I did something Gretchen wanted me to do ever since my aunt Barbara and two of my cousins visited my mother and brother down in Virginia earlier in the month: I called Barbara and talked to her while Gretchen listened along on speaker phone. Barbara isn't a particularly pleasant person, and she's casually rude whenever I want to reply to anything she's saying, since she doesn't seem to ever want to stop talking. There wasn't much new in what she said, though I did learn the names and locations of the two places my mother has been warehoused at. Barbara says that my mother goes back and forth between being fairly aware and functional followed by phases of paranoia and deep unpleasantness, which apparently makes her hard to manage at the various facilities she has been staying at. She seems to like these places, though. As for Don, nobody seems to have any idea what will happen to him, but it looks like he'll be living by himself on Stingy Hollow Road for the rest of Hoagie's life, while the bills remain on auto-pay.
This afternoon, Joe the lead developer messaged me asking how it came to be that there are now 90 spurious commits to the git repository of one of our bigger projects. I knew why: somehow I'd accidentally changed my origin URL to a totally different repository and accidentally merged their two codebases. This mostly had the effect of putting a couple unwanted directories in the project. So my fix had been to simply delete those directories, which made the code look and work as before. But with git and other versioning systems, the state of a codebase at any one time is never the whole story. Even if the codebase contains the precise files it needs and is working as expected, from the perspective of git it can still be a mess if the history contains a lot of junk. And that was the problem Joe was drawing my attention to. Working on projects earlier in my career, it was always fine if something truly terrible had happened to the repository just so long as the code looked and was working as expected. But apparently this was not good enough for Joe, who wanted there to be æsthetic beauty in the history as well. I can totally understand; if job satisfaction means anything, it should include as a possibility of keeping unrelated commits out of a code repository. So I told Joe not to worry, that I would fix it. And then I proceeded to do a number of Google searches as well as asking one or more questions of ChatGPT. I quickly developed a plan of action, which I based on something I'd found with one of my searches. I would make a copy of the currently dev branch just in case I needed it for something. Then I would create a new branch based on dev, hard reset it to the commit just before the one that introduced the code from the other repository, and then "cherry pick" each subsequent commit, skipping those that only related to deleting things from that other repo. I worked slowly and methodically, occasionally checking the results of the commits in the actual codebase to confirm that things were as they should be. This was especially true with cherry-picked "merges," where it wasn't always clear whether the correct thing had been doine. In about an hour, I had my local repository completely fixed, so I did a git push --force, which overwrote origin (the canonical repo) with this fixed version. I showed it to Joe, and he was suitably impressed I'd been able to fix it to his liking. I made it clear to him that of course I should fix things I had broken, though I also said "i like to think i'm only as incompetent as i am unable to fix." I'd made a mess, but I also had a good enough understanding of git to completely fix it in a timely manner.
A little after 4:30 pm, I rounded up the dogs and set out for the cabin in the Chevy Bolt. I would be going by myself. I had some projects to work on, but the weather forecast predicted it would be unpleasant at the cabin, so Gretchen opted not to come.
On the way up, I stopped for a piss break at the Pattersonville rest area and then drove to the Amsterdam Home Depot to get a few plumbing supplies I thought I might need for the big project I wanted to do at the cabin. While I was in the Home Depot, I was struck by how alternative the music playing on the store sound system was. Usually they play light classic rock from the late 70s to the mid-90s (in keeping with the age of their average customer), but today I heard what sounded like fairly deep cut from The Cure.
Next I got some provisions at the nearby Hannaford. I wanted a frozen vegan pizza (which is impossible to find at the Price Chopper in Johnstown) as well as lettuce, mushrooms, and a loaf of sour dough bread. But they didn't have any sourdough bread, so I opted for a different bread.
After getting my usual Impossible Whopper and two large orders of fries at the Burger King, I drove up to 349 and then through Gloversville and, finally, north to the cabin on route 309. By this point I was listening to a radio station I'd just discovered, an "oldies country" station at 104.7 (at the same frequency as my favorite Hudson Valley pop station). Country music "back then" (whenever that was) was simpler, and it seemed relatively enlightened compared to today's country, since it hadn't yet become yet another platform for fighting a cultural war against "the Woke." Also, there were more women singers in country music back before the rise of bro country (itself a reaction to the decreased marginalization of women). In terms of technical differences from modern country, I love the almost-universal use of pedal steel guitar (at least in country music from 30 or 40 years ago) to invoke the atmosphere of melancholic longing. That sound was as important to the genre as singing in a southern or Appalachian accent (whether fake or not) is now.
As I approached the cabin on Woodworth Lake Road, I saw that the last of the snow along the north side of the road had all finally melted away.
It was in the low 50s inside the cabin, so I started a fire in the woodstove before eating (and sharing with the dogs) the food I'd bought at Burger King.
I then drank a gin & tonic, which helped further wind down a 150 mg dose of pseudoephedrine I'd taken this morning. I also ate some cannabis, though it must've been pretty weak, because its effects (when I felt them in the middle of the night) were tepid at best.
For linking purposes this article's URL is:feedback
previous | next