Skip to content

Instantly share code, notes, and snippets.

@myitcv
Created October 25, 2018 09:19
Show Gist options
  • Save myitcv/19be9d18c7a4e139458c8dabc3be2ab2 to your computer and use it in GitHub Desktop.
Save myitcv/19be9d18c7a4e139458c8dabc3be2ab2 to your computer and use it in GitHub Desktop.

Take https://github.com/myitcv/gobin/commits/master as an example.

The repo uses squash merging:

screen shot 2018-10-25 at 10 05 43

This results in, for example (#12) being added to the first line of the squash commit on the target branch.

This is useful when reviewing commits on GitHub itself, e.g. via the link above, because you can click through to the corresponding PR.

But it becomes pretty useless when reviewing the commit history offline, or indeed in a fork.

$ git log
commit 59465ef090f7962b91884775c082e8fd29d0e925 (HEAD, origin/master, add_examples)
Author: Paul Jolly <[email protected]>
Date:   Thu Oct 25 09:25:06 2018 +0100

    main: drop requirement that main package be part of module (#12)

    Prior to being called gobin, this program was call goget. The semantics
    implied by the "get" part of the name made this wrong, and also made it
    hard to justify supporting main packages that were _not_ part of a
    module, because their dependencies would potentially be a forever moving
    feast.

    When we switched to gobin, we added a -g flag to make that "get" step
    explicit (with the exception of the initial "get" which is required).
    Hence dependencies would only "move" when a -g flag is provided, which
    could hardly be described as a surprise to the caller given that they
    have supplied a flag described as "get".

    Furthermore, it seems far more useful to have gobin work for
    non-module-based main packages for now. So this is probably a win all
    round.

    Fixes #11

commit f87a820c4941ebdd72945c7e783ea170dca231f4
Author: Paul Jolly <[email protected]>
Date:   Wed Oct 24 14:30:05 2018 +0100

    README: add credits (#16)

...

Hence I'd like to propose that GitHub automatically add the full URL to the original PR as a "footer" in the squashed committed.

Hence the first commit in the log above would become:

commit 59465ef090f7962b91884775c082e8fd29d0e925 (HEAD, origin/master, add_examples)
Author: Paul Jolly <[email protected]>
Date:   Thu Oct 25 09:25:06 2018 +0100

    main: drop requirement that main package be part of module (#12)

    Prior to being called gobin, this program was call goget. The semantics
    implied by the "get" part of the name made this wrong, and also made it
    hard to justify supporting main packages that were _not_ part of a
    module, because their dependencies would potentially be a forever moving
    feast.

    When we switched to gobin, we added a -g flag to make that "get" step
    explicit (with the exception of the initial "get" which is required).
    Hence dependencies would only "move" when a -g flag is provided, which
    could hardly be described as a surprise to the caller given that they
    have supplied a flag described as "get".

    Furthermore, it seems far more useful to have gobin work for
    non-module-based main packages for now. So this is probably a win all
    round.

    Fixes #11

    Original-PR: https://github.com/myitcv/gobin/pull/12 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment