Permalink
Commits on Jan 24, 2010
  1. Add TODOS

    bloopletech committed Jan 24, 2010
  2. Fix '/ No newline at end of file' occuring in diffs; Fix scrolling at…

    bloopletech committed Jan 24, 2010
    … bottom of viewport for adds that add past the bottom of the viewport
Commits on Jan 14, 2010
Commits on Dec 29, 2009
  1. Add gitignore

    bloopletech committed Dec 29, 2009
  2. WIP of major refactoring to support seek bar; I accidentally deleted …

    bloopletech committed Dec 29, 2009
    …my .git folder for this repo, so this is a bunch of commits squished into one big commit
Commits on Nov 26, 2009
  1. Futher cleanup

    bloopletech committed Nov 26, 2009
  2. Refactor javascript

    bloopletech committed Nov 26, 2009
Commits on Nov 23, 2009
Commits on Nov 22, 2009
  1. Use class_eval to make class extension more obvious. Does Actor alrea…

    toolmantim committed Nov 22, 2009
    …dy exist? Where does it come from?
  2. In general, messages like "Loading $foo" should go to standard error.…

    quackingduck committed Nov 22, 2009
    … My litmus test is to run the command with `2> /dev/null` at the end of the line. If the output on the terminal is not 100% necessary to operate the program, it should have gone to standard error.
  3. Prompting the user for arguments via `gets` doesn't really make sense…

    quackingduck committed Nov 22, 2009
    … for the target audience of gistory. A better strategy is to provide some usage instructions (and return a non-zero exit status) when the required arguments are not provided.
    
    This allows the user to make full use of their shell (tab completion etc) when providing your program with input values.
    
    Additionally, methods that end with a `?` should *test* for some condition in their environment, their arguments or a combination of the two. Their return value should generally be a boolean.
    
    For example:
    
      def missiles_lauched?
        @missile_silo.empty?
      end
    
    The `supplied?` method should have been  a verb like `get` or `ask_for`.
    
    `get_commits` was defined then immediately called. Generally you define a method for two reasons:
    
    1. To facilitate code re-use by factoring out common functionality
    or
    2. To provide a meaningful name for a block of code
    
    In this case it looks like `get_commits` was defined simply to provide a scope for some local variables such as `log_data` and `commit_diff_data`. Ruby provides a better way to this: the `begin` keyword. So
    
      def get_commits
        ... code that builds the commits ...
      end
      commits = get_commits
    
    can be more clearly written as
    
      commits = begin
        ... code that builds the commits ...
      end
    
    As you can see on line 12 `begin` blocks can be combined with the `rescue` keyword to form basic control structures:
    
      repo = begin
        Repo.new(repo_path)
      rescue InvalidGitRepositoryError
        abort "Error: #{repo_path} is not a git repo"
      end
  4. Kernel#abort does three things:

    quackingduck committed Nov 22, 2009
    1. It sets the exit status to 1
    2. It prints its argument to stderr
    3. It terminates the process
    
    So
    
      abort "unable to launch missiles :("
    
    is equivalent to:
    
      $stderr.puts "unable to launch missiles :("
      exit(1)
    
    When printing an error message, it's often a good idea to use the word "error". Users are familiar with that. Also try not to use generic terms like "input" and "data", be specific. When possible, give the user a hint about what they did wrong. For example:
    
      Permission error
    
    Might be rephrased as:
    
      Error: Unable to start server on 366
      Are you root?
  5. This code validates preconditions that are required to run the app. Y…

    quackingduck committed Nov 22, 2009
    …ou can make this obvious by putting the code at the top of the file.
  6. Not neccessary. Set the RUBYOPT environment variable to rubygems. For…

    quackingduck committed Nov 22, 2009
    … example (in ~/.profile):
    
      export RUBYOPT=rubygems
Commits on Sep 19, 2009
  1. Add pause before remove

    Brenton Fletcher Brenton Fletcher
    Brenton Fletcher authored and Brenton Fletcher committed Sep 19, 2009
Commits on Sep 18, 2009
  1. Fix rendering bugs, make start-up a bit nicer

    Brenton Fletcher Brenton Fletcher
    Brenton Fletcher authored and Brenton Fletcher committed Sep 18, 2009
Commits on Sep 10, 2009
  1. Move wait after change delay to a variable

    Brenton Fletcher Brenton Fletcher
    Brenton Fletcher authored and Brenton Fletcher committed Sep 10, 2009
Commits on Sep 9, 2009
  1. FIx bug in diff code, improve animations

    Brenton Fletcher Brenton Fletcher
    Brenton Fletcher authored and Brenton Fletcher committed Sep 9, 2009
Commits on Sep 5, 2009
  1. Change animations to use speed instead of duration, other improvements

    Brenton Fletcher Brenton Fletcher
    Brenton Fletcher authored and Brenton Fletcher committed Sep 5, 2009
Commits on Sep 1, 2009
  1. Commit view tweaks

    Brenton Fletcher Brenton Fletcher
    Brenton Fletcher authored and Brenton Fletcher committed Sep 1, 2009