aboutsummaryrefslogtreecommitdiff
path: root/content/posts/2021-10-17-imported-old-repos.md
blob: 9b4918fee686b4289c263cab68f3be3c920ef876 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
---
slug: imported-old-repos
title: "Imported Old Repos"
date: "2021-10-17T07:36:37-04:00"
draft: false
---
Several months ago I used [fast-export][] to convert most of my old
repositories from [Mercurial][hg] to [Git][].  This morning I finally
imported the converted repositories to [GitHub][] and archived them.

The old repositories are as follows:

* [broker-cappy](https://github.com/pablotron/broker-cappy)
* [cuckoo2](https://github.com/pablotron/cuckoo2)
* [devil-ruby](https://github.com/pablotron/devil-ruby)
* [easing-js](https://github.com/pablotron/easing-js)
* [easy-cookie](https://github.com/pablotron/easy-cookie)
* [fam-ruby](https://github.com/pablotron/fam-ruby)
* [forced-timeout](https://github.com/pablotron/forced-timeout)
* [freshmeat-ruby](https://github.com/pablotron/freshmeat-ruby)
* [honeypot-php](https://github.com/pablotron/honeypot-php)
* [honeypot-ruby](https://github.com/pablotron/honeypot-ruby)
* [id3-ruby](https://github.com/pablotron/id3-ruby)
* [imlib2-ruby](https://github.com/pablotron/imlib2-ruby)
* [joggle](https://github.com/pablotron/joggle)
* [joystick-ruby](https://github.com/pablotron/joystick-ruby)
* [libjiffy](https://github.com/pablotron/libjiffy)
* [localfark](https://github.com/pablotron/localfark)
* [maildrop-log-colorize](https://github.com/pablotron/maildrop-log-colorize)
* [mb-ruby](https://github.com/pablotron/mb-ruby)
* [persist-js](https://github.com/pablotron/persist-js)
* [ptpgp](https://github.com/pablotron/ptpgp)
* [raggle](https://github.com/pablotron/raggle)
* [reddit-content-filter](https://github.com/pablotron/reddit-content-filter)
* [rubilicious](https://github.com/pablotron/rubilicious)
* [searchkeys-chrome](https://github.com/pablotron/searchkeys-chrome)
* [sn9c102-webcam](https://github.com/pablotron/sn9c102-webcam)
* [speedtest-kml](https://github.com/pablotron/speedtest-kml)
* [syndic8-ruby](https://github.com/pablotron/syndic8-ruby)
* [tarstream-php](https://github.com/pablotron/tarstream-php)
* [techmeme-author-filter](https://github.com/pablotron/techmeme-author-filter)
* [technorati-ruby](https://github.com/pablotron/technorati-ruby)
* [tilefu](https://github.com/pablotron/tilefu)
* [tunepimp-ruby](https://github.com/pablotron/tunepimp-ruby)
* [wirble](https://github.com/pablotron/wirble)
* [xmms-ruby](https://github.com/pablotron/xmms-ruby)

Here is the repo import script:

```bash
#!/bin/bash

set -eu 

# space-delimited list of repos
repos='... omitted for brevity ...'

# get base repo dir
base=$(pwd)

# loop through repos
for repo in $repos; do
  # print repo name, switch to repo
  echo repo: $repo
  cd "$base/$repo"

  # create repo
  gh repo create $repo

  # fix origin
  # (gh sets the origin to "https://github.com/pablotron/...)
  git remote rm origin
  git remote add origin git@github.com:pablotron/$repo.git

  # push upstream
  git push -u origin master

  # archive repo
  gh repo archive $repo
done
```

[hg]: https://www.mercurial-scm.org/ "Mercurial VCS"
[git]: https://www.git-scm.com/ "Git VCS"
[github]: https://github.com/ "GitHub"
[gh]: https://cli.github.com/ "GitHub CLI"
[fast-export]: http://repo.or.cz/w/fast-export.git "mercurial to git converter"