Shallow and Pedantic
Using git for code review
At my workplace, I’ve recently been using git for code review purposes. I work on code in my own git clone, and ask a peer to review it. It works somewhat like this:
masterbranch is same code as currently in upstream.- Working to resolve issue #1234 pertaining to “Performance for gizmo”, I work
on a branch
1234-gizmo-performance. - I mail a peer, John, with this information, as well as my repository location.
- John adds my repository as a remote, lutzky. Then he branches
review1(orreview2if that is taken, and so on) atlutzky/1234-gizmo-performance. - John adds comments with nice big
FIXMEtags, which are highlighted in any decent editor. He commits this, the commit-message stating that it was code review. - John tags his final review commit (or, if he had no comments -
lutzky/1234-gizmo-performance) with areviewed1(orreviewed2, etc.) annotated tag. Since the annotated tag includes all the necessary information (who tagged, when, and what), the number doesn’t really matter. - I merge
john/review1, incorporate the changes (or reject them) and remove the comments. If no further review is necessary, I submit this - and once submitted, I merge this back into master.
It’s a nice system. I wonder what other methods there are of doing this.
Hardware doesn't like me
Whatever happened to black & white LCDs?
I had a Game Boy once. I could play it just about anywhere, and battery life - for the time - was great. I lost it at one point, and replaced it with a Game Gear, which sucked the life out of 6 AA batteries rather quickly. The Game Boy Color was actually decent on battery life, but since it didn’t have a backlight, you had to play it at very specific angles.
Another SSH trick
Ever have a machine you can only ssh into through another machine? It’s a very
common situation in the Technion. Here’s one way to get around it: Assume you
can directly ssh into alpha, and from alpha you can ssh into beta. Have
the following code in your ~/.ssh/config:
| |
This requires you to have nc (netcat) installed on alpha. Once you do that,
you can run ssh beta directly from your own box.
Automatically starting rtorrent within screen
These days I don’t stay at home often, but I do have an RSS/BitTorrent combo
fetching me all kinds of neat stuff for me, so I can have it ready for me on
the weekend. I love rtorrent, especially due
to the fact that I can run it in screen, ssh home and see how things are
doing (or add more torrent to the download). However, sometimes my net
connection breaks down, computers gets shut off, or things like that. This week
my router broke down, so I can’t even ssh home to manually start up rtorrent.
My solution: A small script, which checks whether rtorrent is already running,
and if not - runs it in a detached screen session. Run this with your favorite
cron software.
