1. Merging pull requests like a boss (er Pulley)

    I’ve been using John Resig’s pulley with open source projects on Github for a while now. It’s great because it automates the process of merging pull requests, including squashing commits and closing issues.

    Squashing commits is the most valuable part. There will often be back-and-forth comments and minor code updates on a pull request before it’s finally accepted, and squashing commits compacts all those changes into one commit, keeping the git history clean. Pulley will also update the author of the new commit to be the pull request submitter, otherwise it’s you, and the contributor doesn’t get credit for the changes.

    Recently I wanted to modify the process a little and automate it using a different tool, so I ended up breaking down pulley into the manual git commands, and then changing them a little. You can see the original commands in Resig’s pulley blog post. This is my modified version.

    # check out a new branch for the pull request based on master
    $ git checkout -b mmcc-feature/reset master
    
    # fetch the changes from the pull request
    $ git fetch git://github.com/mmcc/video.js.git feature/reset
    

    Fetching instead of pulling allows me to grab the author before any merging or squashing happens. If either of those happens the most recent commit may not be by the original author.

    # get the author of the pull request
    $ git --no-pager show -s --format='%an ' FETCH_HEAD
    --> Matthew McClure <email redacted>
    
    # squash and merge the changes without a commit
    $ git merge --no-commit --squash FETCH_HEAD
    
    # commit the changes and update the author
    $ git commit -a --author="Matthew McClure <email redacted> " -m "Reset player on source change. closes #1124"
    

    Here I have to make sure to add ‘closes #XXX’ so it closes the pull request when the commit is merged.

    # switch to the master branch
    $ git checkout master 
        
    # merge the changes into master
    $ git merge mmcc-feature/reset 
    
    # push the change to the remote
    $ git push origin master
    
    # delete the pr branch
    $ git branch -D mmcc-feature/reset master
    

    For the most part this is just like how pulley works, but now that I have the individual steps it allows me to automate it myself, and pause in the middle of the process to run tests.

    If you see somewhere this can be improved, let me know. And thanks to John Resig for Pulley!

    Cheers,
    -heff

  2. Default Video Element Sizing

    We’re currently having a discussion around responsive sizing in Video.js. I wanted to have a better understanding around what the video element does by default when you don’t provide width/height values, both before and after metadata is available. So I threw together a JSbin to see the results.

    Summary

    • If you do not provide values for width and height, the video element will default to 300x150 pixels
    • If you provide either a width or a height, but not both, the video element will fill in the missing value to match the same 2:1 ratio*
    • Once metadata is available, if you didn’t specify a width or height, the video element will match the dimensions in the metadata
    • If you provide either a width or a height, when metadata is available, the video element will use the value you supplied for width or height, and then fill in the missing value by matching the ratio of the source video

    *iOS doesn’t match the 2:1 ratio, but instead keeps the specific default value, 300px for width or 150px for height.

    Also, Chrome has issues with these tests because it breaks whenever you use the same source twice on the same page.

    Chrome

    iOS

  3. Introducing `chg` - a simple changelog CLI lib

    I’ve been working on the Video.js release process lately, trying to make it faster and more automated. The Zencoder team uses zenflow to automate workflow tasks, which includes changelog updates, and I wanted something that worked similarly.

    Over the weekend I threw together chg, a command line tool (or node module, or grunt task) for quickly creating, updating, and adding new versions to changelogs. Here’s the gist of how it works currently:

    Create a CHANGELOG.md

    chg init
    

    Add a new change

    chg add "My new change"
    

    Results in

    CHANGELOG
    =========
    
    ## HEAD (Unreleased)
    * My new change
    
    --------------------
    

    Create a new release (from unreleased changes)

    chg release "0.1.0"
    

    Results in

    CHANGELOG
    =========
    
    ## HEAD (Unreleased)
    * _(none)_
    
    --------------------
    
    ## 0.1.0 (2014-01-31)
    * My new change
    

    and so on…

    That’s it

    That’s all it does. I showed my wife and she asked why I wouldn’t just update the text file.

    me: …but…it’s automatic…

    My justification is that I’m building it into a larger release task that involves version bumping, tagging, publishing, and a lot of git commands in between. The more I can automate the release process and take the pain out it, the more releases will happen, which is good for everyone.

    I don’t plan to add any features to this, but I like the idea of automatically generating a changelog from pull requests (assuming all changes come through PRs) so I may build something on top of chg to make that happen. We’ll see.

  4. @chrismjohnson, now if I could just grab heff.tumblr to match my twitter/github/IRC, my @ identity would be complete…

    staff:

    Are you always mentioning things? Gross! Stop mentioning things and start mentioning blogs.

    Just type @ and a username when you’re writing a post and we’ll let that user know that you mentioned them. They will be thrilled by this.

    Blogs. Finally something worth mentioning.

    (via chrismjohnson)

  5. My First Post!

    UPDATE: This was my first test post years ago on Tumblr. I didn’t get it.

    What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr?? What is the character limit of Tumblr??