Skip to content

Instantly share code, notes, and snippets.

@mbbx6spp
Created June 21, 2012 03:37

Revisions

  1. mbbx6spp revised this gist Jun 21, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion GITHUB-COMPARE-LINKS.md
    Original file line number Diff line number Diff line change
    @@ -45,4 +45,4 @@ github: [@mbbx6spp](https://github.com/mbbx6spp)

    twitter: [@SusanPotter](https://twitter.com/SusanPotter)

    PS Feel free to donate whatever you would like to, to a worthy cause of your liking instead of the beer (but I would welcome t-shirts of your awesome new startup any time;))
    PS Feel free to donate whatever you would like, to a worthy cause of your liking instead of the beer (but I would welcome t-shirts of your awesome new startup any time;))
  2. mbbx6spp revised this gist Jun 21, 2012. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions GITHUB-COMPARE-LINKS.md
    Original file line number Diff line number Diff line change
    @@ -39,8 +39,10 @@ Linking to this stuff over IM has never been this great. And your manager will l

    Cheers!

    ![BEER](http://25.media.tumblr.com/tumblr_m2g7mkh6I71r9f9mco1_1280.jpg)
    ![BEER](http://octodex.github.com/images/front-end-conftocat.png)

    github: [@mbbx6spp](https://github.com/mbbx6spp)

    twitter: [@SusanPotter](https://twitter.com/SusanPotter)
    twitter: [@SusanPotter](https://twitter.com/SusanPotter)

    PS Feel free to donate whatever you would like to, to a worthy cause of your liking instead of the beer (but I would welcome t-shirts of your awesome new startup any time;))
  3. mbbx6spp revised this gist Jun 21, 2012. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion GITHUB-COMPARE-LINKS.md
    Original file line number Diff line number Diff line change
    @@ -21,7 +21,7 @@ Well it also supports what the Git command line supports for references too (not
    * Compare master@{3.days.ago} to master: `https://github.com/USER/REPO/compare/master@%7B3.days.ago%7D...master`
    * Compare master@{4.weeks.ago} to master: `https://github.com/USER/REPO/compare/master@%7B4.weeks.ago%7D...master`
    * Compare last-release-tag to new-release-tag: `https://github.com/USER/REPO/compare/last-release-tag...new-release-tag`
    * Compare last-release-tag to master@{5.hours.ago}: `https://github.com/USER/REPO/compare/last-release-tag...master@{5.hours.ago}`
    * Compare last-release-tag to master@%7B5.hours.ago%7D: `https://github.com/USER/REPO/compare/last-release-tag...master@{5.hours.ago}`
    * Compare commit 7c0a4169 to master: `https://github.com/USER/REPO/compare/7c0a4169...master`

    You could already do this on your command line, but isn't it prettier?
  4. mbbx6spp revised this gist Jun 21, 2012. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions GITHUB-COMPARE-LINKS.md
    Original file line number Diff line number Diff line change
    @@ -42,4 +42,5 @@ Cheers!
    ![BEER](http://25.media.tumblr.com/tumblr_m2g7mkh6I71r9f9mco1_1280.jpg)

    github: [@mbbx6spp](https://github.com/mbbx6spp)

    twitter: [@SusanPotter](https://twitter.com/SusanPotter)
  5. mbbx6spp created this gist Jun 21, 2012.
    45 changes: 45 additions & 0 deletions GITHUB-COMPARE-LINKS.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,45 @@
    # GitHub Compare Links

    ## The Basics

    Ok, so the basic anatomy of a GitHub compare link is:

    ```url
    https://github.com/USER/REPO/compare/REF1...REF2
    ```

    where USER is the GH username or organization, REPO is the repository name and REF1, REF2 are repository references (typically branches, commit, and/or tags).

    ## Ok, so what?

    Well it also supports what the Git command line supports for references too (not sure how much coverage it has, but it support a fair bit). For example,

    * Compare master to other-branch: `https://github.com/USER/REPO/compare/master...other-branch`
    * Compare master^^ to master: `https://github.com/USER/REPO/compare/master%5E%5E...master`
    * Compare my-branch~6 to my-branch: `https://github.com/USER/REPO/compare/my-branch~6...my-branch`
    * Compare master@{yesterday} to master: `https://github.com/USER/REPO/compare/master@%7Byesterday%7D...master`
    * Compare master@{3.days.ago} to master: `https://github.com/USER/REPO/compare/master@%7B3.days.ago%7D...master`
    * Compare master@{4.weeks.ago} to master: `https://github.com/USER/REPO/compare/master@%7B4.weeks.ago%7D...master`
    * Compare last-release-tag to new-release-tag: `https://github.com/USER/REPO/compare/last-release-tag...new-release-tag`
    * Compare last-release-tag to master@{5.hours.ago}: `https://github.com/USER/REPO/compare/last-release-tag...master@{5.hours.ago}`
    * Compare commit 7c0a4169 to master: `https://github.com/USER/REPO/compare/7c0a4169...master`

    You could already do this on your command line, but isn't it prettier?

    Ok, I can tell you aren't very impressed so here you go:

    * `https://github.com/USER/REPO/compare/master@%7Byesterday%7D...master.diff`
    * `https://github.com/USER/REPO/compare/master@%7Byesterday%7D...master.patch`
    * `https://github.com/USER/REPO/compare/master@%7Byesterday%7D...master.diff?w=1` (ignore whitespace)
    * `https://github.com/USER/REPO/compare/master@%7Byesterday%7D...master.diff#L2R84` (third file, line 84)

    Linking to this stuff over IM has never been this great. And your manager will love it too.

    ## Did you buy me that beer yet?

    Cheers!

    ![BEER](http://25.media.tumblr.com/tumblr_m2g7mkh6I71r9f9mco1_1280.jpg)

    github: [@mbbx6spp](https://github.com/mbbx6spp)
    twitter: [@SusanPotter](https://twitter.com/SusanPotter)