Thursday, December 31, 2009

Importance of Haste

Since Hashrocket is one of the top Ruby on Rails shops in the world we want to give back to the community and help as much as possible. Most of the time this is through emails that we get asking us how we do this, how we sketch this, or if what tools we use. That's cool. What's even cooler ... they wrote an email with their questions in it. Do you know how hard that is it to do? It's not easy I can assure you. All kinds of things can race through your head when asking questions via email:
  • How do I address them? (My name is in the "To" address, I know who its to..)
  • Do I make it a formal letter? (hell no)
  • Do I try to be funny first than ask my questions? )You can, just be honest, it's all good :))
  • Do I ask all my questions? (Sure, go for it.)
It doesn't matter how you write the email or what questions you ask. The least I can do is: answer the email quick. And hopefully help.

Next time someone writes you an email asking a question and they're not being a total ass about it, answer it quick. It's the least you can do.



Tuesday, December 29, 2009

GIT: Cause my memory sucks, renaming the author

This work's only if you HAVE NOT pushed to your remote branch yet.


$ git rebase -i HEAD~3


Then *EDIT* all the commits. At first, it will look like the below:


pick 8eefaac Prevent hitting the database twice for same query

pick 636c72g Only check the one column

pick d7a8674 Add followed_on index


You'll need to "edit" all of them so they're popped off the commit stack to be re-commited with a different author. So before you save and quit the file, it should look like this:


edit 8eefaac Prevent hitting the database twice for same query

edit 636c72g Only check the one column

edit d7a8674 Add followed_on index


Now you're at the earliest commit. To change the author all you need to do is:


$git commit --author corey@hashrocket.com --amend


You'll be put into the amend screen for the commit you're doing so now you can save and quit. Your commit should now have the correct author so you can move to the NEXT commit by running the following:


$git rebase --continue


This will bring you to the next commit to change the author on. Just rinse and repeat and you'll be done soon enough. Below are the commandline steps for future reference :)


To start:

$git rebase -i HEAD~3


Repeat the below for each commit:

$git commit --author corey@hashrocket.com --amend

(save and quit here, no further changes are needed for the commit, unless you think there are)

$git rebase --continue