Blogged by Ujihisa. Standard methods of programming and thoughts including Clojure, Vim, LLVM, Haskell, Ruby and Mathematics written by a Japanese programmer. github/ujihisa

Thursday, October 21, 2010

Reading Git Log In Kindle

I bought a kindle last week and realized how awesome it was.

By the way most programmers' work begins with reading git-log before they start writing great codes. If you can read it with your kindle, having fantastic coffee, it should be amazing experience.

How to do that

The git log after you git pull with time ascending order is available with the following command (*1).

$ git log HEAD@{1}..HEAD --reverse

You can read the diffs as well, with -u option.

About coloring. Vim has diff syntax coloring system and can generate an html file with the color.

$ git log -u HEAD@{1}..HEAD --reverse | vim - -c 'TOhtml' -c 'w | qa!'

This generates Untitled.html.

$ open ./Untitled.html

And

  1. Open Print dialog in your safari
  2. Save PDF
  3. Send the file to Kindle

That's it. Enjoy!

References

2 comments:

  1. >2. Save PDF

    If you're using safari, you can use Right-click->Export to PDF also.

    That way is shorter than from "Print menu"

    ReplyDelete

Followers