Migrating from Mercurial to Git

Since Bitbucket announced back in August that they would be discontinuing support for Mercurial in 2020, I’ve had an item on my to-do list to convert all of my old Bitbucket Mercurial repos over to Git and move them to GitHub. Bitbucket did not provide any automated way to do this, so I’ve spent some time researching the possibilities and trying out different methods. I hit a few dead ends, but eventually found a way that worked for me. So I might as well share that here, for the benefit of anyone else who’s trying to do this.

A few preliminary notes:

  • I’m primarily a Windows user. I also have a MacBook, but I do most of my programming under Windows. So I wanted a method that would work under Windows.
  • My Mercurial repos are all pretty simple: multiple check-ins, but all in a single branch. (These are personal repos, not company repos where multiple programmers were working on them.)
  • My method was pretty similar to the one described in this blog post, from 2014, so I should give credit for that.

First, a few installs:

  1. Install Git for Windows. Any recent version should be fine. Be sure to install the bash shell.
  2. Install TortoiseHg. The most recent version should be fine. You don’t really need all the fancy Tortoise stuff here, but it’s the easiest way to get a good Mercurial install on Windows.
  3. Install Python 2.7. This probably won’t work with Python 3.x, so just install the latest version of 2.7.x. Make sure you add it to your path.

Now, from the git bash shell, run the following:

$ mkdir hg2git-work
$ cd hg2git-work
$ python -m pip install mercurial
$ git clone https://github.com/frej/fast-export.git

This will install Mercurial support for Python, then pull down hg-fast-export. That’s all the initial setup, really. The trick, I found, is using the git bash shell, which is close enough to a real bash shell for the rest of this stuff to work.

The next thing to do, which might or might not be necessary, is the create an “authors.txt” file to map your name/email from the old hg repo to the new git one. In my case, I created one with two lines that looks kind of like this:

"Andrew Huey <me@domain.com>"="Andrew Huey <me@users.noreply.github.com>"
"Andrew Huey <me@another-domain.com>"="Andrew Huey <me@users.noreply.github.com>"

This way, I’m mapping my real email addresses from Bitbucket to my private GitHub address. (My old Bitbucket repos were mostly private, but I’m making the new GitHub ones public.)

Let’s say you have a Mercurial repo in Bitbucket named “euler”. (That’s one of my repos, tracking my Project Euler work.) Now, do the following:

$ hg clone https://bitbucket.org/yourname/euler
$ mkdir euler-git
$ cd euler-git
$ git init
$ ../fast-export/hg-fast-export.sh -r ../euler --force -A ../authors.txt
$ git checkout HEAD

If all goes well, this should leave you with a nice new git repo, matching your hg repo. If you do not already have your GitHub credentials stored in your global Git config, you might now need to add them, either globally or locally. I won’t go into detail on that.

Next, you need rename or copy your .hgignore file to .gitignore. Both systems use pretty much the same format for ignore files, so you probably don’t need to edit it at all.

$ cp .hgignore .gitignore
$ git add .gitignore
$ git commit -m ".hgignore copied to .gitignore"

Now, you can just create a new target repo at GitHub, and push it up. Let’s assume your new repo is named “euler”.

$ git remote add origin https://github.com/username/euler.git
$ git push -u origin master

There are definitely other ways to do this, but this is the way that worked for me.

Reading plans for 2020

I’ve been thinking about changes I could make in my life and habits for 2020 lately. Nothing major, though. I’m mostly thinking about what I want to read, watch, and listen to next year. I briefly thought about designating 2020 as a “catch-up year,” where I resolve not to buy any new books, comics, or DVDs and just try to catch up on stuff I already own. My Goodreads want to read list currently has 348 books on it. The way I use Goodreads, this is a list of books that I already own but haven’t read yet. They’re mostly ebooks, and a bunch of them were free ebooks, so many of those may never actually get read, which is fine. But a lot of them are books that I actually paid money for, and really do want to read.

And, on the comic book side, I have almost 200 comics in my Comixology account that I haven’t read yet. Some of those are individual issues, but many are graphic novels. And I’ve got about a two-foot high stack of physical comic book issues, mostly from my Westfield orders. I had pretty much made up my mind to at least stop ordering new books from Westfield in 2020, but there’s still a bunch of good stuff coming out that I want to read. I’m not going crazy with Westfield; I only have 11 items in my January order and I may drop a few. (I’m starting to feel a little burnt out on Batman-related books, so I may drop those.) But if I start ordering less than a dozen books a month, then Westfield isn’t really a good deal, since the shipping costs outweigh the discounts. So I guess I still haven’t made up my mind on Westfield.

Getting back to “regular” books: I’m still the main moderator for a Goodreads group related to The Great American Read, a series that aired on PBS back in 2018. I had been planning to put the group in “maintenance mode” in 2020, discontinuing group reads and just leaving it open for miscellaneous discussion. But another member volunteered to be a co-moderator with me, and I ran a poll to see if people wanted to keep the group reads going, and of course they did, so I’m going to be doing that in 2020 too. We just did our polls for January, and we’ll be reading The Handmaid’s Tale as our standalone group read for January, and Ken Follet’s Kingsbridge series as our series read. The Follett books are all very long, so I’m allocating two months for each of those, so that’ll stretch out from January to June, for the three books.

I’ve already read The Handmaid’s Tale, back in college, so I don’t think I’ll try to read it again. (The Kindle ebook is available for free under the Prime Reading program right now, by the way.) I may read the graphic novel version though. And I’d really like to read The Pillars of the Earth, the first book in the Kingsbridge series. The Kindle version was available for $1.99 last week, as a “deal of the day”, so I went ahead and bought it. (Those $1.99 deals are how a bunch of Kindle ebooks got on my “want to read” list. It’s hard to resist those…) Meanwhile, I’m only about 25% of the way through Gone with the Wind. And 5% through The Stand, which I want to get back to after I finish Gone with the Wind. Sigh. I need to keep reminding myself that having too many good books to read is a good thing!

The Rise of Skywalker

I took the day off from work today, and went out to see the new Star Wars movie. I don’t go out to see many movies in theaters anymore, but I’ve seen most of the other Star Wars movies in a theater, so seeing this last one seemed like kind of an obligation. I’m still a bit sick, but I’m not doing too bad. I went to a 9 AM showing and made it through the film with the aid of a cup of coffee, two cough drops, and a few tissues. And one bathroom break. (I think I am now officially too old to make it through a 2.5 hour movie without a break.) Oh, and one call from my boss. (I considered ignoring it and calling back after the movie, but I thought it might be important. It wasn’t, really, but that’s ok.)

As a movie, it’s pretty much what I expected. There’s not really too much room for surprises and creativity in a movie like this. It needs to tie up everything from the prior two movies, sprinkle in some nostalgia from the original trilogy, add in some cute new characters for merchandising, and (maybe) set up some stuff for spin-off Disney+ shows. Overall, it was fun, and I’m probably going to want to see it again, if for no other reason than to the catch the parts I missed during my phone call and bathroom breaks. I may wait until it’s out on Blu-ray to see it again though.

The NY Times has a good review roundup for Rise of Skywalker. It’s (mostly) spoiler-free, as is their own review here. Their review calls it “one of the best. Also one of the worst. Perfectly middling. It all amounts to the same thing.” It’s kind of like there’s no real point in reviewing the movie, but it has to be done, I guess? Their take on The Mandalorian, Baby Yoda Is Your God Now, is also kind of weird and maybe a bit nihilistic.

I’ve been thinking back on my experiences of seeing previous Star Wars movies. I remember being pretty excited about The Phantom Menace, back in 1999, and actually going to a midnight showing for that one. I can’t imagine doing that now. For Revenge of the Sith, in 2005, I went into NYC and saw it at the Ziegfeld. (The Ziegfeld, of course, isn’t a movie theater anymore, so that option wouldn’t have been open this time around.) And for Last Jedi, the previous installment, I was also kind of sick, and also (eventually) saw it in Manville, on a weekday morning.

Anyway, I’m feeling pretty ambivalent about the whole thing. I’m still a fan, but I think maybe I need a break. Hmm, Sátántangó is still playing at Lincoln Center. That would be a good palate cleanser. If I could get in by 3 PM, I could even see it today. (Too late for that, though, really.)

Merry Christmas, and goodbye to the 2010s

This is going to be one of those blog posts that could turn into a real monster if I’m not careful. I’ve got no particular plans for today, and a lot of thoughts swirling around in my head. I’ve started seeing a lot of “top 10 (whatever) of the 2010s” articles on the web lately, and that’s gotten me thinking about this last decade. Honestly, if not for all the click-bait articles, I don’t know if I’d even have noticed that a decade was ending. It’s been kind of a blur. Now that I’m thinking back on it, though, there were a lot of changes in my life, and maybe a few things worth commenting on. This might make more sense as a New Year’s Day post rather than a Christmas post, but, well, I’m thinking about it today, so it’s getting written today.

The end of the previous decade was pretty eventful for me, with my Dad passing away in 2009, my Mom passing away early in 2010, and the company I’d worked for through that whole decade going out of business in December 2009. So I started the 2010s in rough shape, without my parents, and looking for a new job. I don’t have a lot of Christmas day blog posts, but this one from 2009 is a little glimpse into how I was doing ten years ago.

I started using Day One in 2014, though I didn’t start using it regularly until 2016. Prior to that, I was using five-year journals, having started one in 2007 and another in 2012. So I’m looking at those, and Day One, and this blog, to try to piece together a bit of my progress over the decade. My initial impression when I started thinking about this decade was something along the lines of Comic Book Guy’s reaction in this Simpson’s clip: “Oh, I’ve wasted my life.” But then I started thinking, and realized that I’ve actually made some progress over the last ten years, and, in some ways at least, I’m in a pretty good place. So here’s a couple of personal highlights from the 2010s:

  • At the beginning of this decade, I wasn’t paying too much attention to my general health or weight. But I had started logging my weight on New Year’s Day in my five-year journal, and I see that on January 1, 2010, I was 223 pounds. I was in the 220s or 230s through to January 1, 2013. I started my diet in September 2013, and got down to 200 pounds by 1/1/2014. I was down to 150 by 1/1/2015, and I’m now maintaining my weight in the 135-140 range.
  • I started the decade working on a time-limited consulting job for the company that bought up the remnants of NMS, the company I’d worked for though the 2000s. That ended in March 2010. I spent April looking for a job and started a new one, with Electric Vine, in May. I took a significant pay cut for that, but it was fun and challenging. I stuck with EVI through to January 2013, when I accepted a job at SHI. I’m still at that job, in pretty much the same position. I’ve been doing pretty well, and I’ve managed to get back to a pretty good salary level. I have a good relationship with my boss, and I think I’m generally doing a good job. I have some concerns about the dangers of professional stagnation, but I’m doing enough interesting work that I’m not too worried about that yet.

In looking through my old paper journals and in Day One, I see some other positive trends over the last decade, but nothing else that I really want to blog about in detail. My personal relationships have changed a lot over the course of the decade, mostly due to people passing away, including my parents and my friend Gloria. The fact that I’m spending Christmas alone in my apartment, writing a blog post, should probably be a warning sign or something, but really I could be spending time with other humans if I wanted to. I’ve just been fighting a bad cold on and off since Thanksgiving and I’m probably better off taking it easy today.

Anyway, that’s about 5% of the thoughts that are rolling around in my head right now. Sorry for writing a self-indulgent and maudlin post on Christmas, but I needed to get some stuff out of my head.

I’m thinking about going out to see the new Star Wars movie today, though I’m not sure that’s a good idea, since I’m still coughing and blowing my nose a lot, and maybe staying home and resting would be better for me. I watched the first two Harry Potter movies last night, with RiffTrax commentary, and that was fun, so I’m thinking about watching some more RiffTrax stuff today, and/or reading some comic books. I’m not planning on doing anything fancy for food today, though I might indulge in some Chinese food for dinner later. So that’s what a sick, single, 50-something nerd does on Christmas, for anyone who was wondering.


sick day

Back in November, I realized that I had two PTO days that I had to use by the end of the year, so I took today and next Friday off. I kind of thought I might use today to go see Star Wars: The Rise of Skywalker. But I got very sick over this past weekend, and have been struggling through the week. I’ve actually burned an extra day and a half, by taking Monday off and a half-day Wednesday. So I’m feeling a little better today, but not “go out to see a two and a half hour Star Wars movie” better. More like “sit on the couch and binge-watch the original trilogy” better.

Anyway, I’m well enough to kill some time writing a blog post. And I have a bunch of random thoughts I’d been meaning to organize, so I’m going to make this a bit of a catch-up/catch-all post.

First, some post Catalina upgrade thoughts: As I mentioned previously, I don’t have any major issues with the new Music app. I’m a little disappointed in the TV app though. While there is still a list view, there doesn’t seem to be any way to turn on the old column browser for it. So if I want to filter it down to show just, say, my Doctor Who season 10 episodes, there’s no quick way to do that. It’s also gotten the seasons and episodes of Doctor Who quite mixed up at this point. (That may have been the case previously, but I hadn’t noticed it.) See the screenshot below for an example of how a bunch of random stuff has all ended up under “season 1, episode 1.” Doctor Who is maybe an edge case, since I’ve purchased several different seasons and collections, and there are a bunch of odds and ends, like Christmas specials and stuff like that. But there should be a better way to organize it all.

I’m also a little disappointed in the new Finder interface for syncing my iPhone and iPad. It’s mostly fine, but they’ve lost the old status display that used to show at the top of the iTunes window. Now, you just get a tiny circle in the Finder sidebar, so you can’t really tell what it’s doing. It’s not a big deal, but it’s a pain, and there’s no reason they couldn’t fix that. I guess we’ve gotten to the point now where syncing an iDevice to a Mac is the exception rather than the rule. I assume most people either sync to iCloud directly, or don’t sync at all.

Next topic: VPNs. There’s been a bit more news about PIA since I last mentioned them in my blog. Here’s an interview with the COO of the combined KAPE/PIA company. And here’s a recent blog post from PIA. They’re saying a lot of the right things, and it’s cool that they’re open-sourcing their desktop client. On the more general privacy today, the NY Times is running a series on the smartphone tracking industry that looks interesting. There really wasn’t anything in the first part that I didn’t already know. The second part has a fairly simple guide to what you can do on your phone to limit tracking. Again, not much that I didn’t already know, but useful for a more general audience. I found it interesting that they recommended a specific VPN app, Privacy Pro SmartVPN. I wasn’t familiar with that particular app/service, but it’s worth looking into. The third part talks about national security implications, which is pretty important, though again, there was nothing in there that surprised me. The series is still ongoing, and it might be worth reading the rest of it.

Last topic (probably): music. I enjoyed reading The Catastrophist’s 2019 Tech Gift Guide in the NY Times this morning. I wouldn’t give any of these items as a gift, and the only item on the list that I own are the AirPods. And, even on those, I kind of agree with their observations about disposability and the darker side of Apple’s ecosystem. (Though maybe “Your nephew dies alone.” is a bit of a stretch.) And I’m still thinking about streaming music services, though I still can’t quite talk myself into signing up for one. On a practical level, I think either Spotify or Apple Music would make the most sense for me. Spotify is the most popular and has a lot of interesting public playlists available. Apple Music is less popular, but would work better in terms of syncing my existing library to the cloud. And it has a 100,000 track limit, vs Spotify’s 10,000 track limit. (This article is a couple of years old, but as far as I can tell, that’s still the case.) And even if the track limit was higher, there doesn’t seem to be a way to get my iTunes library into Spotify without third-party software. So, I’d probably opt for Apple Music if someone held a gun to my head and told me I had to sign up for a streaming music service today. Of course, nobody’s holding a gun to my head. But every time I look at an artist’s web page and see links to their music on Spotify and Apple Music but no obvious link to buy it in MP3 format, I get nudged a little closer to signing up.

I still have a few thoughts rolling around in my head, but it’s time to give up on this blog post and go do something else. Maybe start into that Star Wars binge I mentioned at the top.


macOS TV app

Catalina upgrade and Buffy comics

I’m been fighting a cold, on and off, for the last few weeks. I’ve got a lot of stuff that I’d like to do that involves leaving the apartment, but I think that staying home and drinking herbal tea is a better idea right now. So I managed to get my MacBook Air upgraded to Catalina yesterday. It went smoothly, no snags at all, as far as I can tell. I’d read the Take Control books on upgrading to Catalina and using Catalina, so I knew what to expect. I was a little worried about the new volume group thing, but that doesn’t seem to have broken anything.

And I was worried about the split of iTunes into separate apps, but that also, surprisingly, isn’t as bad as I thought it might be. The Music app retains (nearly) all of the music-related functionality of iTunes. Apparently, the column browser disappeared in 10.15.0 but reappeared in 10.15.2, which is the version to which I just upgraded. So I’m glad I waited before upgrading.

I need to decide if I want to switch my default shell from bash to zsh. It’s probably fine, and I should go ahead and do that, but I do have a few little aliases and scripts that I should review first.

I also just finished reading the Angel & Faith season 9 series. It was really good! I blogged about my recent Buffy kick about a month ago. I think I’m almost done with it, and ready to move on to a new kick. I still need to read a couple of spin-off mini-series, Willow: Wonderland and Spike: A Dark Place. But, after that, I think I’ll take a break from Buffy. I’d been looking at acquiring the season 10 books, but they’re all out of print and some are a bit expensive right now. It looks like Boom is finally going to start reprinting Dark Horse’s Buffy books, so hopefully they’ll get around to printing new editions of the later Dark Horse stuff that’s currently hard to find.

So that’s some random thoughts on macOS and Buffy comics. I was going to toss some unrelated music thoughts into this blog post too, but I’m running out of energy. I need to get some more tea, or maybe take a nap.

Thinking about VPNs

I’ve been using Private Internet Access (PIA) for my VPN service for a while now. I’m reasonably happy with them, but they’ve been acquired by a company called Kape, which has a bit of a checkered history. It looks like this is… maybe fine? maybe not?  I don’t know. But it seems like it might be a good time to look into other VPN services, just in case.

Firefox just announced that they’re starting up their own VPN service. So that’s a pretty good candidate for me, since I generally trust those guys. It’s in beta right now, and only available for Windows, but they plan to make it available for Mac and iOS too. They’re partnering with a company named Mullvad on this, so that got me interested in maybe just looking at their VPN service. The Firefox service is supposed to be $5/month, at least to start. Mullvad is in Sweden, and charges €5 per month, which is a little more than $5, I think.

I also took another look at ProtonVPN, from the Proton Mail guys. They’re a little pricey, at $8/month for “Plus” which is probably what I’d need. If their $4/month “Basic” plan supported more than 2 devices, I’d probably switch to that. But I can’t really justify the $8/month plan, which is what I’d need to cover all my devices.

My PIA subscription is only $40/year, so about $3.33/month. (And their plan lets me use it on up to ten devices.) So, honestly, if I can keep trusting PIA, that’s probably my best bet.

I signed up for the wait list for the Firefox VPN beta, and if I get into that, maybe I’ll give it a try. But if they still only have the Windows client out when I get in, then it’s not going to do me much good, since I spend a lot more time on macOS and iOS these days (at least for personal use) than I do on Windows.